Contents | Previous | Next | Subchapters |

Syntax |
`sqp(function ` f`, function ` df`, function ` g`, function ` dg`, ...` neq`, ` xlow`, ` xup`, ` xini`, ` maxitr`, ` level`, ` eps`, ...` xout`, ` ygout`, ` ylimout`, ` flagout`)` |

See Also | Qpro , dnlsqb |

Uses successive quadratic programming to solve the problem

minimize *f*(*x*) with respect to *x* and subject to

*g*(*x*)(*i*) = 0 for *i* = 1, ... , *neq*

*g*(*x*)(*i*) __<__ 0 for *i* = *neq* + 1, ... , rowdim(*g*(*x*))

*xlow*(*i*) __<__ *x*(*i*) __<__ *xup*(*i*) for *i* = 1, ... , rowdim(*xlow*)

The Lagrangian for this problem is

*L*(*x*, *yg*, *ylim*) = *f*(*x*) + *yg* * *g*(*x*) + *ylim*

In the following function calls,
*f*(*x*)

returns the value of the objective function
at *df*(*x*)

returns the derivative of the
objective function at *g*(*x*)

returns the value of the constraints at the
point *dg*(*x*)

returns is the
derivative of the constraints at *g*(*x*)

,
and the same number of columns as `(`*i*, *j*)

of *dg*(*x*)

is the partial derivative of the

The integer scalar *g*(*x*)

.
The real or double-precision column vector *xup*(*i*)

is equal to *xlow*(*i*)

or
the value *xup*(*i*) - *xlow*(*i*)

is used to scale the problem with
respect to the

|*xout*(*i*) - *xmin*(*i*)| __<__ *eps* (*xup*(*i*) - *xlow*(*i*))

for all

The input values of *g*(*x*)

has rows.
The row vector `sqp`

contains the value of

The integer scalar `sqp`

.
If *level* __>__ 1

, the text "Beginning sqp"
and the value of
*f*(*x*)

,
the current value of the penalty function,
and the maximum scaled difference between the
approximate solution and the current point.
In addition, the value of `sqp`

returns.
If *level* __>__ 2

,
the following value are printed at each iteration:
the difference between the approximate subproblem solution
and the current point,
the value of *g*(*x*)

,
the Lagrange multiplier values used in the penalty function,
and the partial of the Lagrangian with respect to *level* __>__ 3

,
the value of the approximation to the Hessian of the
Lagrangian is printed at each iteration.
If *level* __>__ 4

,
the tracing level
*level* - 3

, is used inside of Qpro
when it solves the approximate subproblem.
The following program solves the problem

minimize *x*(1)^2 + *x*(2)^2 with respect to *x*

subject to 1 - *x*(1) = 0

Note that the solution to this problem is *x*(1) = 1

and *x*(2) = 0

.
The lower and upper limits for ```
```

clear

#

function f(x) begin

return x(1)^2 + x(2)^2

end

function df(x) begin

return 2 * x'

end

function g(x) begin

return 1 - x(1)

end

function dg(x) begin

return [-1., 0.]

end

maxitr = 10

level = 1

eps = 1e-5

xini = {2., 2.}

xlow = {-100., -100.}

xup = {+100, +100.}

neq = 1

xout = novalue

ygout = novalue

ylimout = novalue

flagout = novalue

sqp(function f, function df, function g, function dg, ...

neq, xlow, xup, xini, maxitr, level, eps, ...

xout, ygout, ylimout, flagout)

print "xout' =", xout