Examples
Here, we provide several examples demonstrating different use cases of modOpt. These examples serve as a collection of run scripts for user reference and benchmarking optimizers. Unlike tutorials, most examples are generated from Python (.py) files and may include some documentation in the form of comments. Some examples may be written in Jupyter Notebooks (.ipynb) when console outputs and plots generated from running the scripts are important and need to be included in the documentation.
- Basic examples
- 1. Minimizing a Quartic function using the ProblemLite class
- 2. Minimizing a Quartic function
- 3. Minimizing the Rosenbrock function
- 4. Minimizing a Quartic function with constraints
- 5. Minimizing a Quartic function with constraints and problem scaling
- 6. Quartic optimization with separate constraints
- 7. Optimization with CSDL models
- 8. Optimization with CSDL_alpha models
- 9. Quartic optimization using CasADi
- 10. Quartic optimization using Jax
- 11. Optimization with OpenMDAO models
- 12. Method of Newton Lagrange
- 13. Minimizing the Bean function
- Advanced examples
- 1. Traveling Salesman Problem
- 2. Benchmark optimization algorithms on four simple problems
- 3. Benchmark instructional algorithms on three analytical problems
- 4. Benchmark performant algorithms on three analytical problems
- 5. Benchmark algorithms using the uncoupled Rosenbrock problem
- 6. Benchmark algorithms using the coupled Rosenbrock problem
- 7. Cantilever beam optimization with finite difference gradients
- 8. Cantilever beam optimization with CasADi
- 9. Cantilever beam optimization with CSDL
- 10. Cantilever beam optimization with Jax
- 11. Cantilever beam optimization with OpenMDAO
- 12. Starship 2D trajectory optimization with finite difference gradients
- 13. Starship 2D trajectory optimization with CasADi
- 14. Starship 2D trajectory optimization with CSDL
- 15. Starship 2D trajectory optimization with Jax
- 16. Starship 2D trajectory optimization with OpenMDAO
- 17. Import and solve a CUTEst problem using modOpt
- 18. Benchmark OpenSQP against other solvers on CUTEst problems (nx,nc<=100)