- 3.0.2 optimal control module.
NLp3D.cpp

This example shows how to set up and solve a Nonlinear program using the Nlp and Nlpsolver classes. We show both exact Hessian (requires more implementation) and Hessian-approximation versions.

max(x1*x2 + x2*x3) s.t: x1*x1 - x2*x2 + x3*x3 <= 2 x1*x1 + x2*x2 + x3*x3 <= 10

This is a slightly more difficult problem, with local minima which only converges with nonzero initial guess. Taken from Wikipedia: https://en.wikipedia.org/wiki/Nonlinear_programming#3-dimensional_example. Wikipedia provides a nice visualization online.