# FMIN_SLSQP

Utility/Data Access SubroutineSLSQP optimizer is a sequential least squares programming algorithm for nonlinear, constrained gradient-based optimization. It supports both inequality and equality constraints.

## Definition

Note: FMIN_SLQP is only available as a Python function.

This function is also documented in Scipy at scipy.optimize.fmin_slsqp.

## Use

The utility can be called by any user-defined subroutine written in Python.

## Format

Python Calling Syntax
fmin_slsqp(func, x0, eqcons=[], f_eqcons=None, ieqcons=[], f_ieqcons=None, bounds=[], fprime=None, fprime_eqcons=None, fprime_ieqcons=None, args=(), iter=100, acc=1e-06, iprint=1, disp=None, full_output=0, epsilon=1.4901161193847656e-08)

## Attributes

func
A function that can be called by Python that evaluates the objective function that is to be minimized.
Type: Callable function of the form f(x, *args)
X0
The initial guess for the independent variables.
Type: A 1D array of floats. Denote N = len(x0)
eqcons
A list of functions of length N that specify all the equality constraints that FMIN_SLSQP must maintain. In a successfully optimized problem, FMIN_SLSQP will ensure that eqcons[i](x,*args) == 0, i=1…M, where M=len(eqcons)
Type: List
f_eqcons
f_eqcons is a function that can be called by Python. This function returns a 1-D array of floats that must equal 0.0 in a successfully optimized problem. f_eqcons has the form: f(x, *args)
If eqcons is specified, f_eqcons is ignored.

Type: Callable function of the form f(x, *args)

ieqcons
A list of functions of length N that specify all the inequality constraints that FMIN_SLSQP must satisfy. In a successfully optimized problem, FMIN_SLSQP will ensure that ieqcons[i](x,*args) >= 0, i=1…M', where M'=len(ieqcons)
Type: List
f_ieqcons
f_ieqcons is a function that can be called by Python. This function returns a 1-D array of floats that must be greater than or equal 0.0 in a successfully optimized problem.
f_eqcons has the form: f(x, *args)
If ieqcons is specified, f_ieqcons is ignored.
Type: Callable function of the form f(x, *args)
bounds
A list of types specifying the lower and upper bound for each independent variable. It has the form: [ (xl0,xu0), (xl1,xu1), ... (xlN,xuN)]
Type: Callable function of the form f(x, *args)
fprime
A function that evaluates the partial derivatives of func with respect to the independent variables.
Type: Callable function of the form f(x, *args) that returns a 1-D array of length N.
fprime_eqcons
A function that can be called by Python. This function returns the Jacobian matrix of the equality constraints in an M x N array of floats.
If fprime_eqcons is not provided, the Jacobian matrix is obtained through finite differencing. Finite differencing can be expensive and is known to be sometimes inaccurate.
Type: Callable function of the form f(x, *args) that returns an M x N array.
fprime_ieqcons
A function that can be called by Python. This function returns the Jacobian matrix of the equality constraints in an M' x N array of floats.
If fprime_ieqcons is not provided, the Jacobian matrix is obtained through finite differencing. Finite differencing can be expensive and is known to be sometimes inaccurate.
Type: Callable function of the form f(x, *args) that returns an M' x N array.
args
These are the additional arguments that are passed to func, fprime, fprime_eqcons and fprime_ieqcons.
Type: Sequence
iter
This specifies the maximum number of iterations available to FMIN_SLSQP to obtain a minimum.
Type: Integer
acc
This is the accuracy to which a solution is desired.
Type: Float
iprint
This defines the verbosity of the diagnostics generated by FMIN_SLSQP.
• iprint <= 0 : Silent operation.
• iprint == 1 : Print summary upon completion (default).
• iprint >= 2 : Print status of each iteration and summary.
Type: integer
disp
This defines the verbosity of the diagnostics generated by FMIN_SLSQP. When specified, disp overrides the iprint interface.
Type: integer
full_output
If false, it returns only the minimizer of func (default). Otherwise, it returns the output final objective function and summary information.

Type: bool

epsilon
The step size for finite-difference derivative estimates.
Type: float

## Output

out
The final minimizer of func.
Type: 1D float array
fx
If full_output is true, fx will contain the final value of the objective function.
Type: 1D float array
its
If full_output is true, this will contain the number of iterations taken.
Type: int
imode
If full_output is true, this will contain the exit mode from the optimizer. The values of imode have the following significance:
-1
0
Optimization terminated successfully.
1
Function evaluation required.
2
More equality constraints than independent variables.
3
More than 3*n iterations in LSQ subproblem.
4
Inequality constraints incompatible.
5
Singular matrix E in LSQ subproblem.
6
Singular matrix C in LSQ subproblem.
7
Rank-deficient equality constraint subproblem HFTI.
8
Positive directional derivative for linesearch.
9
Iteration limit exceeded.
Type: int
smode
If full_output is true, this will contain a message describing the exit mode from the optimizer.
Type: string