-
Notifications
You must be signed in to change notification settings - Fork 394
L_16
Joris Gillis edited this page Apr 4, 2023
·
2 revisions
[INTERNAL]
::
A simplified interface for NLP modeling/solving.
This class offers a view with model description facilities The API is
guaranteed to be stable.
Example NLP:
::
opti = casadi.Opti(); x = opti.variable(); y = opti.variable(); opti.minimize( (y-x^2)^2 ); opti.subject_to( x^2+y^2==1 ); opti.subject_to( x+y>=1 ); opti.solver('ipopt'); sol = opti.solve(); sol.value(x) sol.value(y)
Example parametric NLP:
::
opti = casadi.Opti(); x = opti.variable(2,1); p = opti.parameter(); opti.minimize( (p*x(2)-x(1)^2)^2 ); opti.subject_to( 1<=sum(x)<=2 ); opti.solver('ipopt'); opti.set_value(p, 3); sol = opti.solve(); sol.value(x) opti.set_value(p, 5); sol = opti.solve(); sol.value(x)
Joris Gillis, Erik Lambrechts, Joel Andersson
Extra doc: https://github.com/casadi/casadi/wiki/L_16
C++ includes: optistack.hpp
To edit, see writing tips.