bundles / scipy 1.17.1 / scipy / optimize / _slsqp_py / fmin_slsqp
function
scipy.optimize._slsqp_py:fmin_slsqp
source: /scipy/optimize/_slsqp_py.py :70
Signature
def 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 , callback = None ) Summary
Minimize a function using Sequential Least Squares Programming
Extended Summary
Python interface function for the SLSQP Optimization subroutine originally implemented by Dieter Kraft.
Parameters
func: callable f(x,*args)Objective function. Must return a scalar.
x0: 1-D ndarray of floatInitial guess for the independent variable(s).
eqcons: list, optionalA list of functions of length n such that eqcons[j](x,*args) == 0.0 in a successfully optimized problem.
f_eqcons: callable f(x,*args), optionalReturns a 1-D array in which each element must equal 0.0 in a successfully optimized problem. If f_eqcons is specified, eqcons is ignored.
ieqcons: list, optionalA list of functions of length n such that ieqcons[j](x,*args) >= 0.0 in a successfully optimized problem.
f_ieqcons: callable f(x,*args), optionalReturns a 1-D ndarray in which each element must be greater or equal to 0.0 in a successfully optimized problem. If f_ieqcons is specified, ieqcons is ignored.
bounds: list, optionalA list of tuples specifying the lower and upper bound for each independent variable [(xl0, xu0),(xl1, xu1),...] Infinite values will be interpreted as large floating values.
fprime: callable ``f(x,*args)``, optionalA function that evaluates the partial derivatives of func.
fprime_eqcons: callable ``f(x,*args)``, optionalA function of the form
f(x, *args)that returns the m by n array of equality constraint normals. If not provided, the normals will be approximated. The array returned by fprime_eqcons should be sized as ( len(eqcons), len(x0) ).fprime_ieqcons: callable ``f(x,*args)``, optionalA function of the form
f(x, *args)that returns the m by n array of inequality constraint normals. If not provided, the normals will be approximated. The array returned by fprime_ieqcons should be sized as ( len(ieqcons), len(x0) ).args: sequence, optionalAdditional arguments passed to func and fprime.
iter: int, optionalThe maximum number of iterations.
acc: float, optionalRequested accuracy.
iprint: int, optionalThe verbosity of fmin_slsqp :
iprint <= 0Silent operation
iprint == 1Print summary upon completion (default)
iprint >= 2Print status of each iterate and summary
disp: int, optionalOverrides the iprint interface (preferred).
full_output: bool, optionalIf False, return only the minimizer of func (default). Otherwise, output final objective function and summary information.
epsilon: float, optionalThe step size for finite-difference derivative estimates.
callback: callable, optionalCalled after each iteration, as
callback(x), wherexis the current parameter vector.
Returns
out: ndarray of floatThe final minimizer of func.
fx: ndarray of float, if full_output is trueThe final value of the objective function.
its: int, if full_output is trueThe number of iterations.
imode: int, if full_output is trueThe exit mode from the optimizer (see below).
smode: string, if full_output is trueMessage describing the exit mode from the optimizer.
Notes
Exit modes are defined as follows:
-1Gradient evaluation required (g & a)0Optimization terminated successfully1Function evaluation required (f & c)2More equality constraints than independent variables3More than 3*n iterations in LSQ subproblem4Inequality constraints incompatible5Singular matrix E in LSQ subproblem6Singular matrix C in LSQ subproblem7Rank-deficient equality constraint subproblem HFTI8Positive directional derivative for linesearch9Iteration limit reached
Examples
Examples are given :ref:`in the tutorial <tutorial-sqlsp>`.See also
- minimize
Interface to minimization algorithms for multivariate functions. See the 'SLSQP'
methodin particular.
Aliases
-
scipy.optimize.fmin_slsqp