SLSQP
To use SLSQP solver from the Scipy library, you can follow the same process as for other optimizers except when importing the optimizer. Import the optimizer as shown in the following code:
from modopt import SLSQP
Options could be set by just passing them within the solver_options dictionary when
instantiating the SLSQP optimizer object.
For example, we can set the maximum number of iterations maxiter
and the precision goal ftol for the final solution as shown below.
optimizer = SLSQP(prob, solver_options={'maxiter':20, 'ftol':1e-6})
A limited number of options are available for the SLSQP solver in modOpt as given in the following table. For more information on the Scipy SLSQP algorithm, visit Scipy documentation.
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of iterations. |
|
float ( |
Precision goal for the final solution. |
|
bool ( |
Set to |
|
callable ( |
Function to be called after each major iteration. |