bundles / scipy 1.17.1 / scipy / optimize / _slsqp_py / _minimize_slsqp
function
scipy.optimize._slsqp_py:_minimize_slsqp
Signature
def _minimize_slsqp ( func , x0 , args = () , jac = None , bounds = None , constraints = () , maxiter = 100 , ftol = 1e-06 , iprint = 1 , disp = False , eps = 1.4901161193847656e-08 , callback = None , finite_diff_rel_step = None , workers = None , ** unknown_options ) Summary
Minimize a scalar function of one or more variables using Sequential Least Squares Programming (SLSQP).
Parameters
ftol: floatPrecision target for the value of f in the stopping criterion. This value controls the final accuracy for checking various optimality conditions; gradient of the lagrangian and absolute sum of the constraint violations should be lower than
ftol. Similarly, computed step size and the objective function changes are checked against this value. Default is 1e-6.eps: floatStep size used for numerical approximation of the Jacobian.
disp: boolSet to True to print convergence messages. If False,
verbosityis ignored and set to 0.maxiter: int, optionalMaximum number of iterations. Default value is 100.
finite_diff_rel_step: None or array_like, optionalIf
jac in ['2-point', '3-point', 'cs']the relative step size to use for numerical approximation ofjac. The absolute step size is computed ash = rel_step * sign(x) * max(1, abs(x)), possibly adjusted to fit into the bounds. Formethod='3-point'the sign ofhis ignored. If None (default) then step is selected automatically.workers: int, map-like callable, optionalA map-like callable, such as
multiprocessing.Pool.mapfor evaluating any numerical differentiation in parallel. This evaluation is carried out asworkers(fun, iterable).
Returns
res: OptimizeResultThe optimization result represented as an OptimizeResult object. In this dict-like object the following fields are of particular importance:
xthe solution array,successa Boolean flag indicating if the optimizer exited successfully,messagewhich describes the reason for termination, andmultiplierswhich contains the Karush-Kuhn-Tucker (KKT) multipliers for the QP approximation used in solving the original nonlinear problem. SeeNotesbelow. See also OptimizeResult for a description of other attributes.
Notes
The KKT multipliers are returned in the OptimizeResult.multipliers attribute as a NumPy array. Denoting the dimension of the equality constraints with meq, and of inequality constraints with mineq, then the returned array slice m[:meq] contains the multipliers for the equality constraints, and the remaining m[meq:meq + mineq] contains the multipliers for the inequality constraints. The multipliers corresponding to bound inequalities are not returned. See [1] pp. 321 or [2] for an explanation of how to interpret these multipliers. The internal QP problem is solved using the methods given in [3] Chapter 25.
Note that if new-style NonlinearConstraint or LinearConstraint were used, then minimize converts them first to old-style constraint dicts. It is possible for a single new-style constraint to simultaneously contain both inequality and equality constraints. This means that if there is mixing within a single constraint, then the returned list of multipliers will have a different length than the original new-style constraints.
Aliases
-
scipy.optimize._minimize._minimize_slsqp