IPOPT
IPOPT (Interior Point OPTimizer) is a gradient-based optimization algorithm that uses an interior point method to solve general nonlinear programming problems. It can utilize second-order derivative information in the form of the Hessian of the objective for unconstrained problems or the Hessian of the Lagrangian for constrained problems. This solver uses the ‘ipopt’ algorithm from the CasADi library.
To use the IPOPT solver in modOpt, first install CasADi with pip install casadi.
You can then import the IPOPT solver from modOpt as shown in the following code:
from modopt import IPOPT
Options for the IPOPT solver are available here.
Solver options could be set by just passing them within the solver_options
dictionary when instantiating the IPOPT optimizer object.
For example, we can set the maximum number of iterations max_iter
and the convergence tolerance tol for the algorithm as shown below.
optimizer = IPOPT(prob, solver_options={'max_iter': 100, 'tol': 1e-6})
Some of the most commonly applicable options are given below:
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of iterations. |
|
float ( |
Maximum number of walltime clock seconds. |
|
float ( |
Maximum number of cpu seconds. |
|
float ( |
Convergence tolerance for the algorithm. |
|
int ( |
Controls the verbosity level for the console output. |
|
str |
Output filename. |
|
int ( |
Controls the verbosity level for the output file. |
|
str ( |
Determines whether to append to the output file. |
|
str ( |
Determines whether to print all options set by the user. |
|
str ( |
Determines whether to print the advanced options also. |
|
str ( |
Linear solver to use for computing the step direction. |
|
str |
Set |
|
str ( |
Set |
|
str ( |
To perform a derivative check at the at the initial guess
|
|
str ( |
Set |
|
float ( |
Relative size of the finite difference perturbation in derivative test. |
|
float ( |
Indicate derivatives as wrong if: |