Sequential (least-squares) quadratic programming (SQP) algorithm for nonlinearly constrained, gradient-based optimization, supporting both equality and inequality constraints.
slsqp( x0, fn, gr =NULL, lower =NULL, upper =NULL, hin =NULL, hinjac =NULL, heq =NULL, heqjac =NULL, nl.info =FALSE, control = list(), deprecatedBehavior =TRUE,...)
Arguments
x0: starting point for searching the optimum.
fn: objective function that is to be minimized.
gr: gradient of function fn; will be calculated numerically if not specified.
lower, upper: lower and upper bound constraints.
hin: function defining the inequality constraints, that is hin <= 0 for all components. This is new behavior in line with the rest of the nloptr arguments. To use the old behavior, please set deprecatedBehavior to TRUE.
hinjac: Jacobian of function hin; will be calculated numerically if not specified.
heq: function defining the equality constraints, that is heq = 0
for all components.
heqjac: Jacobian of function heq; will be calculated numerically if not specified.
nl.info: logical; shall the original NLopt info been shown.
control: list of options, see nl.opts for help.
deprecatedBehavior: logical; if TRUE (default for now), the old behavior of the Jacobian function is used, where the equality is ≥0
instead of ≤0. This will be reversed in a future release and eventually removed.
...: additional arguments passed to the function.
Returns
List with components: - par: the optimal solution found so far.
value: the function value corresponding to par.
iter: number of (outer) iterations, see maxeval.
convergence: integer code indicating successful completion (> 1) or a possible error number (< 0).
message: character string produced by NLopt and giving additional information.
Details
The algorithm optimizes successive second-order (quadratic/least-squares) approximations of the objective function (via BFGS updates), with first-order (affine) approximations of the constraints.