SLSQP¶
SLSQP optimizer is a sequential least squares programming algorithm which uses the Han–Powell quasi–Newton method with a BFGS update of the B–matrix and an L1–test function in the step–length algorithm. The optimizer uses a slightly modified version of Lawson and Hanson’s NNLS nonlinear leastsquares solver.
The version provided is the original source code from 1991 by Dieter Kraft.
Options¶
Name 
Type 
Default value 
Description 


float 
1e06 
Convergence Accurancy 

int 
500 
Maximum Iterations 

int 
1 
Output Level (<0  None, 0  Screen, 1  File) 

int 
60 
Output Unit Number 

str 

Output File Name 
Informs¶
Code 
Description 


Gradient evaluation required (g & a) 

Optimization terminated successfully. 

Function evaluation required (f & c) 

More equality constraints than independent variables 

More than 3*n iterations in LSQ subproblem 

Inequality constraints incompatible 

Singular matrix E in LSQ subproblem 

Singular matrix C in LSQ subproblem 

Rankdeficient equality constraint subproblem HFTI 

Positive directional derivative for linesearch 

Iteration limit exceeded 
API¶
 class pyoptsparse.pySLSQP.pySLSQP.SLSQP(*args, **kwargs)[source]¶
SLSQP Optimizer Class  Inherited from Optimizer Abstract Class
This is the base optimizer class that all optimizers inherit from. We define common methods here to avoid code duplication.
 Parameters
 namestr
Optimizer name
 categorystr
Typically local or global
 defaultOptionsdictionary
A dictionary containing the default options
 informsdict
Dictionary of the inform codes
 __call__(optProb, sens=None, sensStep=None, sensMode=None, storeHistory=None, hotStart=None, storeSens=True)[source]¶
This is the main routine used to solve the optimization problem.
 Parameters
 optProbOptimization or Solution class instance
This is the complete description of the optimization problem to be solved by the optimizer
 sensstr or python Function.
Specifiy method to compute sensitivities. To explictly use pyOptSparse gradient class to do the derivatives with finite differenes use ‘FD’. ‘sens’ may also be ‘CS’ which will cause pyOptSpare to compute the derivatives using the complex step method. Finally, ‘sens’ may be a python function handle which is expected to compute the sensitivities directly. For expensive function evaluations and/or problems with large numbers of design variables this is the preferred method.
 sensStepfloat
Set the step size to use for design variables. Defaults to 1e6 when sens is ‘FD’ and 1e40j when sens is ‘CS’.
 sensModestr
Use ‘pgc’ for parallel gradient computations. Only available with mpi4py and each objective evaluation is otherwise serial
 storeHistorystr
File name of the history file into which the history of this optimization will be stored
 hotStartstr
File name of the history file to “replay” for the optimziation. The optimization problem used to generate the history file specified in ‘hotStart’ must be IDENTICAL to the currently supplied ‘optProb’. By identical we mean, EVERY SINGLE PARAMETER MUST BE IDENTICAL. As soon as he requested evaluation point from SLSQP does not match the history, function and gradient evaluations revert back to normal evaluations.
 storeSensbool
Flag sepcifying if sensitivities are to be stored in hist. This is necessay for hotstarting only.