- 3.0.2 optimal control module.
|
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. We solve the following NLP:
max(x1 + x2) s.t: x1 >= 0 x2 >= 0 1 <= x1^2 + x2^2 <= 2
The optimal solution to this problem is x = [1, 1]. (taken from Wikipedia: https://en.wikipedia.org/wiki/Nonlinear_programming#2-dimensional_example)