Examples#
This section provides several examples of how to use csnlp. It ranges from the
basic, e.g., how to build an NLP with csnlp.Nlp, to more advanced examples that
showcase, e.g., how to use the csnlp.multistart submodule.
Introductory examples#
General-purpose and introductory examples for csnlp.
A simple optimization problem: Rosenbrock function
Integer Programming examples#
Here we show how to specify discrete and binary domains for variables.
Multistart Optimization examples#
The following examples demonstrate the use of csnlp.multistart to combat local
convergence.
Optimal control examples#
These examples detail how to use csnlp to create and solve optimal control
problems with csnlp.wrappers.Mpc, csnlp.wrappers.ScenarioBasedMpc, and
other similar wrapper classes.
Scaling examples#
Examples demonstrating the scaling capabilities of csnlp.wrappers.NlpScaling.
Sensitivity examples#
Examples on sensitivity computations via csnlp.wrappers.NlpSensitivity.
A simple example of sensitivity analysis (3d version)
Comparison of CasADi’s and csnlp’s sensitivity computations