SNOPT
SNOPT (Sparse Nonlinear OPTimizer) is a gradient-based optimization algorithm that uses sequential quadratic programming (SQP) to solve general nonlinear programming problems. It uses the BFGS algorithm to approximate the Hessian of the Lagrangian and an augmented Lagrangian merit function for the line search.
To use the SNOPT solver in modOpt, you need to have it installed on your machine along with its Python interface.
The binaries can be obtained from SNOPT’s official website,
and the Python interface from GitHub.
Once these are installed correctly, you can import the SNOPT solver from modOpt as shown in the following code:
from modopt import SNOPT
Options could be set by passing them within the solver_options dictionary when
instantiating the SNOPT optimizer object as shown below.
snopt_options = {
'Major iterations': 100,
'Major optimality': 1e-9,
'Major feasibility': 1e-8
}
optimizer = SNOPT(prob, solver_options=snopt_options)
modOpt-specific solver options for SNOPT
The modOpt-SNOPT interface adds two more options in addition to the standard options available with the SNOPT solver. These additional options are described in the table below.
Option |
Type (default value) |
Description |
|---|---|---|
|
bool ( |
If |
|
bool ( |
If |
Standard solver options for SNOPT
The complete list of standard options, their types, and default values for SNOPT are shown in the table below. For more details on the SNOPT optimization algorithm or its usage, see SNOPT User’s Guide.
Option |
Type |
Default value |
|---|---|---|
|
str |
|
|
str |
|
|
str |
problem.name + |
|
int |
|
|
int |
|
|
str |
|
|
str |
problem.name + |
|
int |
|
|
int |
|
|
str |
|
|
bool |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
int |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
int |
|
|
int |
|
|
float |
|
|
float |
|
|
int |
|
|
int |
|
|
int |
|
|
float |
|
|
int |
|
|
bool |
|