PDF version (NAG web site
, 64bit version, 64bit version)
NAG Toolbox: nag_opt_nlp2_solve (e04wd)
Purpose
nag_opt_nlp2_solve (e04wd) is designed to minimize an arbitrary smooth function subject to constraints (which may include simple bounds on the variables, linear constraints and smooth nonlinear constraints) using a sequential quadratic programming (SQP) method. As many first derivatives as possible should be supplied by you; any unspecified derivatives are approximated by finite differences. It is not intended for large sparse problems.
nag_opt_nlp2_solve (e04wd) may also be used for unconstrained, boundconstrained and linearly constrained optimization.
nag_opt_nlp2_solve (e04wd) uses forward
communication for evaluating the objective function, the nonlinear constraint functions, and any of their derivatives.
The initialization function
nag_opt_nlp2_init (e04wc) must have been called before to calling
nag_opt_nlp2_solve (e04wd).
Syntax
[
majits,
istate,
ccon,
cjac,
clamda,
objf,
grad,
h,
x,
iw,
rw,
user,
ifail] = e04wd(
a,
bl,
bu,
confun,
objfun,
istate,
ccon,
cjac,
clamda,
h,
x,
iw,
rw, 'n',
n, 'nclin',
nclin, 'ncnln',
ncnln, 'user',
user)
[
majits,
istate,
ccon,
cjac,
clamda,
objf,
grad,
h,
x,
iw,
rw,
user,
ifail] = nag_opt_nlp2_solve(
a,
bl,
bu,
confun,
objfun,
istate,
ccon,
cjac,
clamda,
h,
x,
iw,
rw, 'n',
n, 'nclin',
nclin, 'ncnln',
ncnln, 'user',
user)
Note: the interface to this routine has changed since earlier releases of the toolbox:
Mark 22: leniw, lenrw, has been removed from the interface
.
Description
nag_opt_nlp2_solve (e04wd) is designed to solve nonlinear programming problems – the minimization of a smooth nonlinear function subject to a set of constraints on the variables.
nag_opt_nlp2_solve (e04wd) is suitable for small dense problems. The problem is assumed to be stated in the following form:
where
F
(x)
$F\left(x\right)$ (the
objective function) is a nonlinear scalar function,
A_{L}
${A}_{L}$ is an
n_{L}
${n}_{L}$ by
n
$n$ constant matrix, and
c
(x)
$c\left(x\right)$ is an
n_{N}
${n}_{N}$vector of nonlinear constraint functions. (The matrix
A_{L}
${A}_{L}$ and the vector
c
(x)
$c\left(x\right)$ may be empty.) The objective function and the constraint functions are assumed to be smooth, here meaning at least twicecontinuously differentiable. (The method of
nag_opt_nlp2_solve (e04wd) will usually solve
(1) if there are only isolated discontinuities away from the solution.) We also write
r(x)$r\left(x\right)$ for the vector of combined functions:
Note that although the bounds on the variables could be included in the definition of the linear constraints, we prefer to distinguish between them for reasons of computational efficiency. For the same reason, the linear constraints should
not be included in the definition of the nonlinear constraints. Upper and lower bounds are specified for all the variables and for all the constraints. An
equality constraint on
r_{i}
${r}_{i}$ can be specified by setting
l_{i}
=
u_{i}
${l}_{i}={u}_{i}$. If certain bounds are not present, the associated elements of
l
$l$ or
u
$u$ can be set to special values that will be treated as
− ∞
$\infty $ or
+ ∞
$+\infty $. (See the description of the optional parameter
Infinite Bound Size.)
Figure 1 illustrates the feasible region for the
j
$j$th pair of constraints
l_{j}
≤
r_{j}
(x)
≤
u_{j}
${l}_{j}\le {r}_{j}\left(x\right)\le {u}_{j}$. The quantity of
δ
$\delta $ is the
Feasibility Tolerance, which can be set by you (see
Section [Optional Parameters]). The constraints
l_{j}
≤
r_{j}
≤
u_{j}
${l}_{j}\le {r}_{j}\le {u}_{j}$ are considered ‘satisfied’ if
r_{j}
${r}_{j}$ lies in Regions 2, 3 or 4, and ‘inactive’ if
r_{j}
${r}_{j}$ lies in Region 3. The constraint
r_{j}
≥
l_{j}
${r}_{j}\ge {l}_{j}$ is considered ‘active’ in Region 2, and ‘violated’ in Region 1. Similarly,
r_{j}
≤
u_{j}
${r}_{j}\le {u}_{j}$ is active in Region 4, and violated in Region 5. For equality constraints (
l_{j}
=
u_{j}
${l}_{j}={u}_{j}$), Regions 2 and 4 are the same and Region 3 is empty.
Figure 1:
Illustration of the constraints
l_{j}
≤
r_{j}
(x)
≤
u_{j}${l}_{j}\le {r}_{j}\left(x\right)\le {u}_{j}$
If there are no nonlinear constraints in
(1) and
F$F$ is linear or quadratic, then it will generally be more efficient to use one of
nag_opt_lp_solve (e04mf),
nag_opt_lsq_lincon_solve (e04nc) or
nag_opt_qp_dense_solve (e04nf). If the problem is large and sparse and does have nonlinear constraints, then
nag_opt_nlp2_sparse_solve (e04vh) should be used, since
nag_opt_nlp2_solve (e04wd) treats all matrices as dense.
You must supply an initial estimate of the solution to
(1), together with functions that define
F(x)$F\left(x\right)$ and
c(x)$c\left(x\right)$ with as many first partial derivatives as possible; unspecified derivatives are approximated by finite differences; see
Section [Description of the optional parameters] for a discussion of the optional parameter
Derivative Level.
The objective function is defined by
objfun, and the nonlinear constraints are defined by
confun. Note that if there
are any nonlinear constraints then the
first call to
confun will precede the
first call to
objfun.
For maximum reliability, it is preferable for you to provide all partial derivatives (see Chapter 8 of
Gill et al. (1981), for a detailed discussion). If all gradients cannot be provided, it is similarly advisable to provide as many as possible. While developing
objfun and
confun, the optional parameter
Verify Level should be used to check the calculation of any known gradients.
The method used by
nag_opt_nlp2_solve (e04wd) is based on NPOPT, which is part of the SNOPT package described in
Gill et al. (2005b), and the algorithm it uses is described in detail in
Section [Algorithmic Details].
References
Eldersveld S K (1991) Largescale sequential quadratic programming algorithms PhD Thesis Department of Operations Research, Stanford University, Stanford
Fourer R (1982) Solving staircase linear programs by the simplex method Math. Programming 23 274–313
Gill P E, Murray W and Saunders M A (2002) SNOPT: An SQP Algorithm for Largescale Constrained Optimization 12 979–1006 SIAM J. Optim.
Gill P E, Murray W and Saunders M A (2005a) Users' guide for SQOPT 7: a Fortran package for largescale linear and quadratic programming
Report NA 051 Department of Mathematics, University of California, San Diego
ftp://www.cam.ucsd.edu/pub/peg/reports/sqdoc7.pdf
Gill P E, Murray W and Saunders M A (2005b) Users' guide for SNOPT 7.1: a Fortran package for largescale linear nonlinear programming
Report NA 052 Department of Mathematics, University of California, San Diego
ftp://www.cam.ucsd.edu/pub/peg/reports/sndoc7.pdf
Gill P E, Murray W, Saunders M A and Wright M H (1986) Users' guide for NPSOL (Version 4.0): a Fortran package for nonlinear programming Report SOL 862 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1992) Some theoretical properties of an augmented Lagrangian merit function Advances in Optimization and Parallel Computing (ed P M Pardalos) 101–128 North Holland
Gill P E, Murray W and Wright M H (1981) Practical Optimization Academic Press
Hock W and Schittkowski K (1981) Test Examples for Nonlinear Programming Codes. Lecture Notes in Economics and Mathematical Systems 187 Springer–Verlag
Parameters
Compulsory Input Parameters
 1:
a(lda, : $:$) – double array

The first dimension of the array
a must be at least
max (1,nclin)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{nclin}})$The second dimension of the array must be at least
n${\mathbf{n}}$ if
nclin > 0${\mathbf{nclin}}>0$, and at least
1$1$ otherwise
The
i$\mathit{i}$th row of
a contains the
i$\mathit{i}$th row of the matrix
A_{L}${A}_{L}$ of general linear constraints in
(1). That is, the
i$\mathit{i}$th row contains the coefficients of the
i$\mathit{i}$th general linear constraint, for
i = 1,2, … ,nclin$\mathit{i}=1,2,\dots ,{\mathbf{nclin}}$.
If
nclin = 0${\mathbf{nclin}}=0$, the array
a is not referenced.
 2:
bl(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
 3:
bu(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
bl must contain the lower bounds and
bu the upper bounds for all the constraints, in the following order. The first
n $n$ elements of each array must contain the bounds on the variables, the next
n_{L} ${n}_{L}$ elements the bounds for the general linear constraints (if any) and the next
n_{N} ${n}_{N}$ elements the bounds for the general nonlinear constraints (if any). To specify a nonexistent lower bound (i.e.,
l_{j} = − ∞ ${l}_{j}=\infty $), set
bl(j) ≤ − bigbnd ${\mathbf{bl}}\left(j\right)\le \mathit{bigbnd}$, and to specify a nonexistent upper bound (i.e.,
u_{j} = + ∞ ${u}_{j}=+\infty $), set
bu(j) ≥ bigbnd ${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$; where
bigbnd $\mathit{bigbnd}$ is the optional parameter
Infinite Bound Size. To specify the
j $j$th constraint as an
equality, set
bl(j) = bu(j) = β ${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)=\beta $, say, where
β < bigbnd $\left\beta \right<\mathit{bigbnd}$.
Constraints:
 bl(j) ≤ bu(j)${\mathbf{bl}}\left(\mathit{j}\right)\le {\mathbf{bu}}\left(\mathit{j}\right)$, for j = 1,2, … ,n + nclin + ncnln$\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$;
 if bl(j) = bu(j) = β${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)=\beta $, β < bigbnd$\left\beta \right<\mathit{bigbnd}$.
 4:
confun – function handle or string containing name of mfile
confun must calculate the vector
c(x)$c\left(x\right)$ of nonlinear constraint functions and (optionally) its Jacobian,
( ∂ c)/( ∂ x) $\frac{\partial c}{\partial x}$, for a specified
n$n$vector
x$x$. If there are no nonlinear constraints (i.e.,
ncnln = 0${\mathbf{ncnln}}=0$),
nag_opt_nlp2_solve (e04wd) will never call
confun, so it may be the string
'e04wdp'. (
nag_opt_nlp2_dummy_confun (e04wdp) is included in the NAG Toolbox). If there are nonlinear constraints, the first call to
confun will occur before the first call to
objfun.
If all constraint gradients (Jacobian elements) are known (i.e.,
Derivative Level = 2${\mathbf{Derivative\; Level}}=2$ or
3$3$), any
constant elements may be assigned to
cjac once only at the start of the optimization. An element of
cjac that is not subsequently assigned in
confun will retain its initial value throughout. Constant elements may be loaded in
cjac during the first call to
confun (signalled by the value of
nstate = 1${\mathbf{nstate}}=1$). The ability to preload constants is useful when many Jacobian elements are identically zero, in which case
cjac may be initialized to zero and nonzero elements may be reset by
confun.
It must be emphasized that, if
Derivative Level < 2${\mathbf{Derivative\; Level}}<2$, unassigned elements of
cjac are
not treated as constant; they are estimated by finite differences, at nontrivial expense.
[mode, ccon, cjac, user] = confun(mode, ncnln, n, ldcj, needc, x, cjac, nstate, user)
Input Parameters
 1:
mode – int64int32nag_int scalar
Is set by
nag_opt_nlp2_solve (e04wd) to indicate which values must be assigned during each call of
confun. Only the following values need be assigned, for each value of
i$i$ such that
needc(i) > 0${\mathbf{needc}}\left(i\right)>0$:
 mode = 0${\mathbf{mode}}=0$
 The components of ccon corresponding to positive values in needc must be set. Other components and the array cjac are ignored.
 mode = 1${\mathbf{mode}}=1$
 The known components of the rows of cjac corresponding to positive values in needc must be set. Other rows of cjac and the array ccon will be ignored.
 mode = 2${\mathbf{mode}}=2$
 Only the elements of ccon corresponding to positive values of needc need to be set (and similarly for the known components of the rows of cjac).
 2:
ncnln – int64int32nag_int scalar
n_{N}${n}_{N}$, the number of nonlinear constraints.
 3:
n – int64int32nag_int scalar
n$n$, the number of variables.
 4:
ldcj – int64int32nag_int scalar
The first dimension of the array
cjac as declared in the (sub)program from which
nag_opt_nlp2_solve (e04wd) is called.
 5:
needc(ncnln) – int64int32nag_int array
The indices of the elements of
ccon and/or
cjac that must be evaluated by
confun. If
needc(i) > 0${\mathbf{needc}}\left(i\right)>0$, the
i$i$th element of
ccon and/or the available elements of the
i$i$th row of
cjac (see parameter
mode) must be evaluated at
x$x$.
 6:
x(n) – double array
x$x$, the vector of variables at which the constraint functions and/or the available elements of the constraint Jacobian are to be evaluated.
 7:
cjac(ldcj,n) – double array
The elements of
cjac are set to special values that enable
nag_opt_nlp2_solve (e04wd) to detect whether they are reset by
confun.
 8:
nstate – int64int32nag_int scalar
If
nstate = 1${\mathbf{nstate}}=1$ then
nag_opt_nlp2_solve (e04wd) is calling
confun for the first time. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
 9:
user – Any MATLAB object
confun is called from
nag_opt_nlp2_solve (e04wd) with the object supplied to
nag_opt_nlp2_solve (e04wd).
Output Parameters
 1:
mode – int64int32nag_int scalar
May be used to indicate that you are unable or unwilling to evaluate the constraint functions at the current
x $x$.
During the linesearch, the constraint functions are evaluated at points of the form
x = x_{k} + αp_{k} $x={x}_{k}+\alpha {p}_{k}$ after they have already been evaluated satisfactorily at
x_{k} ${x}_{k}$. At any such
α $\alpha $, if you set
mode = − 1 ${\mathbf{mode}}=1$,
nag_opt_nlp2_solve (e04wd) will evaluate the functions at some point closer to
x_{k} ${x}_{k}$ (where they are more likely to be defined).
If for some reason you wish to terminate the current problem, set
mode < − 1 ${\mathbf{mode}}<1$.
 2:
ccon(max (1,ncnln)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$) – double array
If
needc(i) > 0 ${\mathbf{needc}}\left(i\right)>0$ and
mode = 0${\mathbf{mode}}=0$ or
2$2$,
ccon(i) ${\mathbf{ccon}}\left(i\right)$ must contain the value of the
i$i$th constraint at
x$x$. The remaining elements of
ccon, corresponding to the nonpositive elements of
needc, are ignored.
 3:
cjac(ldcj,n) – double array
ldcj ≥ max (1,ncnln)$\mathit{ldcj}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$.
If
needc(i) > 0 ${\mathbf{needc}}\left(i\right)>0$ and
mode = 1${\mathbf{mode}}=1$ or
2$2$, the
i $i$th row of
cjac must contain the available elements of the vector
∇ c_{i} $\nabla {c}_{i}$ given by
where
( ∂ c_{i})/( ∂ x_{j}) $\frac{\partial {c}_{i}}{\partial {x}_{j}}$ is the partial derivative of the
i$i$th constraint with respect to the
j$j$th variable, evaluated at the point
x$x$. See also the parameter
nstate. The remaining rows of
cjac, corresponding to nonpositive elements of
needc, are ignored.
If all elements of the constraint Jacobian are known (i.e.,
Derivative Level = 2${\mathbf{Derivative\; Level}}=2$ or
3$3$), any constant elements may be assigned to
cjac one time only at the start of the optimization. An element of
cjac that is not subsequently assigned in
confun will retain its initial value throughout. Constant elements may be loaded into
cjac during the first call to
confun (signalled by the value
nstate = 1${\mathbf{nstate}}=1$). The ability to preload constants is useful when many Jacobian elements are identically zero, in which case
cjac may be initialized to zero and nonzero elements may be reset by
confun.
Note that constant nonzero elements do affect the values of the constraints. Thus, if
cjac(i,j) ${\mathbf{cjac}}\left(i,j\right)$ is set to a constant value, it need not be reset in subsequent calls to
confun, but the value
cjac(i,j) × x(j) ${\mathbf{cjac}}\left(i,j\right)\times {\mathbf{x}}\left(j\right)$ must nonetheless be added to
ccon(i) ${\mathbf{ccon}}\left(i\right)$. For example, if
cjac(1,1) = 2 ${\mathbf{cjac}}\left(1,1\right)=2$ and
cjac(1,2) = − 5 ${\mathbf{cjac}}\left(1,2\right)=5$ then the term
2 × x(1) − 5 × x(2) $2\times {\mathbf{x}}\left(1\right)5\times {\mathbf{x}}\left(2\right)$ must be included in the definition of
ccon(1) ${\mathbf{ccon}}\left(1\right)$.
It must be emphasized that, if
Derivative Level = 0${\mathbf{Derivative\; Level}}=0$ or
1$1$, unassigned elements of
cjac are not treated as constant; they are estimated by finite differences, at nontrivial expense. If you do not supply a value for the optional parameter
Difference Interval, an interval for each element of
x$x$ is computed automatically at the start of the optimization. The automatic procedure can usually identify constant elements of
cjac, which are then computed once only by finite differences.
 4:
user – Any MATLAB object
confun should be tested separately before being used in conjunction with
nag_opt_nlp2_solve (e04wd). See also the description of the optional parameter
Verify Level.
 5:
objfun – function handle or string containing name of mfile
objfun must calculate the objective function
F(x)$F\left(x\right)$ and (optionally) its gradient
g(x) = ( ∂ F)/( ∂ x) $g\left(x\right)=\frac{\partial F}{\partial x}$ for a specified
n$n$vector
x$x$.
[mode, objf, grad, user] = objfun(mode, n, x, grad, nstate, user)
Input Parameters
 1:
mode – int64int32nag_int scalar
Is set by
nag_opt_nlp2_solve (e04wd) to indicate which values must be assigned during each call of
objfun. Only the following values need be assigned:
 mode = 0${\mathbf{mode}}=0$
 objf.
 mode = 1${\mathbf{mode}}=1$
 All available elements of grad.
 mode = 2${\mathbf{mode}}=2$
 objf and all available elements of grad.
 2:
n – int64int32nag_int scalar
n$n$, the number of variables.
 3:
x(n) – double array
x$x$, the vector of variables at which the objective function and/or all available elements of its gradient are to be evaluated.
 4:
grad(n) – double array
The elements of
grad are set to special values.
 5:
nstate – int64int32nag_int scalar
If
nstate = 1${\mathbf{nstate}}=1$ then
nag_opt_nlp2_solve (e04wd) is calling
objfun for the first time. This parameter setting allows you to save computation time if certain data must be read or calculated only once.
 6:
user – Any MATLAB object
objfun is called from
nag_opt_nlp2_solve (e04wd) with the object supplied to
nag_opt_nlp2_solve (e04wd).
Output Parameters
 1:
mode – int64int32nag_int scalar
May be used to indicate that you are unable or unwilling to evaluate the objective function at the current
x $x$.
During the linesearch, the function is evaluated at points of the form
x = x_{k} + αp_{k} $x={x}_{k}+\alpha {p}_{k}$ after they have already been evaluated satisfactorily at
x_{k} ${x}_{k}$. For any such
x $x$, if you set
mode = − 1 ${\mathbf{mode}}=1$,
nag_opt_nlp2_solve (e04wd) will reduce
α$\alpha $ and evaluate the functions again (closer to
x_{k} ${x}_{k}$, where they are more likely to be defined).
If for some reason you wish to terminate the current problem, set
mode < − 1 ${\mathbf{mode}}<1$.
 2:
objf – double scalar
If
mode = 0${\mathbf{mode}}=0$ or
2$2$,
objf must be set to the value of the objective function at
x$x$.
 3:
grad(n) – double array
If
mode = 1${\mathbf{mode}}=1$ or
2$2$,
grad must return the available elements of the gradient evaluated at
x$x$, i.e.,
grad(i)${\mathbf{grad}}\left(i\right)$ contains the partial derivative
( ∂ F)/( ∂ x_{i}) $\frac{\partial F}{\partial {x}_{i}}$.
 4:
user – Any MATLAB object
objfun should be tested separately before being used in conjunction with
nag_opt_nlp2_solve (e04wd). See also the description of the optional parameter
Verify Level.
 6:
istate(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – int64int32nag_int array
Is an integer array that need not be initialized if
nag_opt_nlp2_solve (e04wd) is called with the
Cold Start option (the default).
If optional parameter
Warm Start has been chosen, every element of
istate must be set. If
nag_opt_nlp2_solve (e04wd) has just been called on a problem with the same dimensions,
istate already contains valid values. Otherwise,
istate(j)${\mathbf{istate}}\left(j\right)$ should indicate whether either of the constraints
r_{j} (x) ≥ l_{j} ${r}_{j}\left(x\right)\ge {l}_{j}$ or
r_{j} (x) ≤ u_{j} ${r}_{j}\left(x\right)\le {u}_{j}$ is expected to be active at a solution of
(1).
The ordering of
istate is the same as for
bl,
bu and
r(x)$r\left(x\right)$, i.e., the first
n components of
istate refer to the upper and lower bounds on the variables, the next
nclin refer to the bounds on
A_{L}x ${A}_{L}x$, and the last
ncnln refer to the bounds on
c(x) $c\left(x\right)$. Possible values of
istate(i) ${\mathbf{istate}}\left(i\right)$ follow:
0$0$  Neither r_{j} (x) ≥ l_{j} ${r}_{j}\left(x\right)\ge {l}_{j}$ nor r_{j} (x) ≤ u_{j} ${r}_{j}\left(x\right)\le {u}_{j}$ is expected to be active. 
1$1$  r_{j} (x) ≥ l_{j} ${r}_{j}\left(x\right)\ge {l}_{j}$ is expected to be active. 
2$2$  r_{j} (x) ≤ u_{j} ${r}_{j}\left(x\right)\le {u}_{j}$ is expected to be active. 
3$3$  This may be used if l_{j} = u_{j} ${l}_{j}={u}_{j}$. Normally an equality constraint r_{j} (x) = l_{j} = u_{j} ${r}_{j}\left(x\right)={l}_{j}={u}_{j}$ is active at a solution. 
The values
1$1$,
2$2$ or
3$3$ all have the same effect when
bl(j) = bu(j) ${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)$. If necessary,
nag_opt_nlp2_solve (e04wd) will override your specification of
istate, so that a poor choice will not cause the algorithm to fail.
 7:
ccon(max (1,ncnln)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$) – double array
ccon need not be initialized if the (default) optional parameter
Cold Start is used.
For a
Warm Start, and if
ncnln > 0${\mathbf{ncnln}}>0$,
ccon contains values of the nonlinear constraint functions
c_{i}${c}_{\mathit{i}}$, for
i = 1,2, … ,ncnln$\mathit{i}=1,2,\dots ,{\mathbf{ncnln}}$, calculated in a previous call to
nag_opt_nlp2_solve (e04wd).
 8:
cjac(ldcj, : $:$) – double array

The first dimension of the array
cjac must be at least
max (1,ncnln)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$The second dimension of the array must be at least
n${\mathbf{n}}$ if
ncnln > 0${\mathbf{ncnln}}>0$, and at least
1$1$ otherwise
In general,
cjac need not be initialized before the call to
nag_opt_nlp2_solve (e04wd). However, if
Derivative Level = 2${\mathbf{Derivative\; Level}}=2$ or
3$3$, any constant elements of
cjac may be initialized. Such elements need not be reassigned on subsequent calls to
confun.
 9:
clamda(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
Need not be set if the (default) optional parameter
Cold Start is used.
If the optional parameter
Warm Start has been chosen,
clamda(j)${\mathbf{clamda}}\left(\mathit{j}\right)$ must contain a multiplier estimate for each nonlinear constraint, with a sign that matches the status of the constraint specified by the
istate array, for
j = n + nclin + 1, … ,n + nclin + ncnln$\mathit{j}={\mathbf{n}}+{\mathbf{nclin}}+1,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$. The remaining elements need not be set. If the
j$j$th constraint is defined as ‘inactive’ by the initial value of the
istate array (i.e.,
istate(j) = 0${\mathbf{istate}}\left(j\right)=0$),
clamda(j)${\mathbf{clamda}}\left(j\right)$ should be zero; if the
j$j$th constraint is an inequality active at its lower bound (i.e.,
istate(j) = 1${\mathbf{istate}}\left(j\right)=1$),
clamda(j)${\mathbf{clamda}}\left(j\right)$ should be nonnegative; if the
j$j$th constraint is an inequality active at its upper bound (i.e.,
istate(j) = 2${\mathbf{istate}}\left(j\right)=2$),
clamda(j)${\mathbf{clamda}}\left(j\right)$ should be nonpositive. If necessary, the function will modify
clamda to match these rules.
 10:
h(ldh, : $:$) – double array

The first dimension of the array
h must be at least
n${\mathbf{n}}$ unless optional parameter
Hessian Limited Memory is in effect
The second dimension of the array must be at least
n${\mathbf{n}}$ unless the optional parameter
Hessian Limited Memory is in effect. If
Hessian Limited Memory is in effect, array
h is not referenced
h need not be initialized if the (default) optional parameter
Cold Start is used, and will be set to the identity.
If the optional parameter
Warm Start has been chosen,
h provides the initial approximation of the Hessian of the Lagrangian, i.e.,
h(i,j) ≈ ( ∂^{2} L (x,λ) )/( ∂x_{i} ∂x_{j} ) ${\mathbf{h}}\left(i,j\right)\approx \frac{{\partial}^{2}\mathcal{L}(x,\lambda )}{\partial {x}_{i}\partial {x}_{j}}$, where
L (x,λ) = F(x) − c(x)^{T} λ $\mathcal{L}(x,\lambda )=F\left(x\right){c\left(x\right)}^{\mathrm{T}}\lambda $ and
λ $\lambda $ is an estimate of the Lagrange multipliers.
h must be a positive definite matrix.
 11:
x(n) – double array
n, the dimension of the array, must satisfy the constraint
n > 0${\mathbf{n}}>0$.
An initial estimate of the solution.
 12:
iw(leniw) – int64int32nag_int array
leniw, the dimension of the array, must satisfy the constraint
leniw ≥ 600$\mathit{leniw}\ge 600$.
Constraint:
leniw ≥ 600$\mathit{leniw}\ge 600$.
 13:
rw(lenrw) – double array
lenrw, the dimension of the array, must satisfy the constraint
lenrw ≥ 600$\mathit{lenrw}\ge 600$.
Constraint:
lenrw ≥ 600$\mathit{lenrw}\ge 600$.
Optional Input Parameters
 1:
n – int64int32nag_int scalar
Default:
The dimension of the array
x and the first dimension of the array
h. (An error is raised if these dimensions are not equal.)
n$n$, the number of variables.
Constraint:
n > 0${\mathbf{n}}>0$.
 2:
nclin – int64int32nag_int scalar
Default:
The first dimension of the array
a.
n_{L}${n}_{L}$, the number of general linear constraints.
Constraint:
nclin ≥ 0${\mathbf{nclin}}\ge 0$.
 3:
ncnln – int64int32nag_int scalar
Default:
The first dimension of the array
cjac.
n_{N}${n}_{N}$, the number of nonlinear constraints.
Constraint:
ncnln ≥ 0${\mathbf{ncnln}}\ge 0$.
 4:
user – Any MATLAB object
user is not used by
nag_opt_nlp2_solve (e04wd), but is passed to
confun and
objfun. Note that for large objects it may be more efficient to use a global variable which is accessible from the mfiles than to use
user.
Input Parameters Omitted from the MATLAB Interface
 lda ldcj ldh leniw lenrw iuser ruser
Output Parameters
 1:
majits – int64int32nag_int scalar
The number of major iterations performed.
 2:
istate(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – int64int32nag_int array
Describes the status of the constraints
l ≤ r(x) ≤ u $l\le r\left(x\right)\le u$. For the
j$j$th lower or upper bound,
j = 1,2, … ,n + nclin + ncnln$j=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$, the possible values of
istate(j) ${\mathbf{istate}}\left(j\right)$ are as follows (see
Figure 1).
δ $\delta $ is the appropriate feasibility tolerance.
− 2$2$  (Region 1) The lower bound is violated by more than δ $\delta $. 
− 1$1$  (Region 5) The upper bound is violated by more than δ $\delta $. 
− 0$\phantom{}0$  (Region 3) Both bounds are satisfied by more than δ $\delta $. 
− 1$\phantom{}1$  (Region 2) The lower bound is active (to within δ $\delta $). 
− 2$\phantom{}2$  (Region 4) The upper bound is active (to within δ $\delta $). 
− 3$\phantom{}3$  (Region 2 = Region 4$\text{Region 2}=\text{Region 4}$) The bounds are equal and the equality constraint is satisfied (to within δ $\delta $). 
These values of
istate are labelled in the printed solution according to
Table 1.
Region  1$1$  2$2$  3$3$  4$4$  5$5$  2 ≡ 4$2\equiv 4$ 
istate(j)${\mathbf{istate}}\left(j\right)$  − 2$2$  1$1$  0$0$  2$2$  − 1$1$  3$3$ 
Printed solution    LL  FR  UL  ++  EQ 
Table 1Labels used in the printed solution for the regions in
Figure 1
 3:
ccon(max (1,ncnln)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$) – double array
If
ncnln > 0${\mathbf{ncnln}}>0$,
ccon(i)${\mathbf{ccon}}\left(\mathit{i}\right)$ contains the value of the
i$\mathit{i}$th nonlinear constraint function
c_{i}${c}_{\mathit{i}}$ at the final iterate, for
i = 1,2, … ,ncnln$\mathit{i}=1,2,\dots ,{\mathbf{ncnln}}$.
If
ncnln = 0${\mathbf{ncnln}}=0$, the array
ccon is not referenced.
 4:
cjac(ldcj, : $:$) – double array

The first dimension of the array
cjac will be
max (1,ncnln)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$The second dimension of the array will be
n${\mathbf{n}}$ if
ncnln > 0${\mathbf{ncnln}}>0$, and at least
1$1$ otherwise
ldcj ≥ max (1,ncnln)$\mathit{ldcj}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}(1,{\mathbf{ncnln}})$.
If
ncnln > 0${\mathbf{ncnln}}>0$,
cjac contains the Jacobian matrix of the nonlinear constraint functions at the final iterate, i.e.,
cjac(i,j)${\mathbf{cjac}}\left(\mathit{i},\mathit{j}\right)$ contains the partial derivative of the
i$\mathit{i}$th constraint function with respect to the
j$\mathit{j}$th variable, for
i = 1,2, … ,ncnln$\mathit{i}=1,2,\dots ,{\mathbf{ncnln}}$ and
j = 1,2, … ,n$\mathit{j}=1,2,\dots ,{\mathbf{n}}$. (See the discussion of parameter
cjac under
confun.)
If
ncnln = 0${\mathbf{ncnln}}=0$, the array
cjac is not referenced.
 5:
clamda(n + nclin + ncnln${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnln}}$) – double array
The values of the QP multipliers from the last QP subproblem.
clamda(j)${\mathbf{clamda}}\left(j\right)$ should be nonnegative if
istate(j) = 1${\mathbf{istate}}\left(j\right)=1$ and nonpositive if
istate(j) = 2${\mathbf{istate}}\left(j\right)=2$.
 6:
objf – double scalar
The value of the objective function at the final iterate.
 7:
grad(n) – double array
The gradient of the objective function (or its finite difference approximation) at the final iterate.
 8:
h(ldh, : $:$) – double array

The first dimension of the array
h will be
n${\mathbf{n}}$ unless optional parameter
Hessian Limited Memory is in effect
The second dimension of the array will be
n${\mathbf{n}}$ unless the optional parameter
Hessian Limited Memory is in effect. If
Hessian Limited Memory is in effect, array
h is not referenced
ldh ≥ n$\mathit{ldh}\ge {\mathbf{n}}$ unless optional parameter
Hessian Limited Memory is in effect.
Contains the Hessian of the Lagrangian at the final estimate x $x$.
 9:
x(n) – double array
The final estimate of the solution.
 10:
iw(leniw) – int64int32nag_int array
iw = state . iw${\mathbf{iw}}=\mathbf{state}.\text{iw}$leniw = 600$\mathit{leniw}=600$.
Communication array, used to store information between calls to nag_opt_nlp2_solve (e04wd).
 11:
rw(lenrw) – double array
rw = state . rw${\mathbf{rw}}=\mathbf{state}.\text{rw}$lenrw = 600$\mathit{lenrw}=600$.
Communication array, used to store information between calls to nag_opt_nlp2_solve (e04wd).
 12:
user – Any MATLAB object
 13:
ifail – int64int32nag_int scalar
ifail = 0${\mathrm{ifail}}={\mathbf{0}}$ unless the function detects an error (see
[Error Indicators and Warnings]).
nag_opt_nlp2_solve (e04wd) returns with
ifail = 0${\mathbf{ifail}}={\mathbf{0}}$ if the iterates have converged to a point
x$x$ that satisfies the firstorder Kuhn–Tucker (see
Section [Minor Iteration Log]) conditions to the accuracy requested by the
Major Optimality Tolerance, i.e., the projected gradient and active constraint residuals are negligible at
x$x$.
You should check whether the following four conditions are satisfied:
If all these conditions hold,
x$x$ is almost certainly a local minimum of
(1).
One caution about ‘Optimal solutions’. Some of the variables or slacks may lie outside their bounds more than desired, especially if scaling was requested.
Max Primal infeas in the Print file refers to the largest bound infeasibility and which variable is involved. If it is too large, consider restarting with a smaller
Minor Feasibility Tolerance (say
10$10$ times smaller) and perhaps
Scale Option = 0${\mathbf{Scale\; Option}}=0$.
Similarly,
Max Dual infeas in the Print file indicates which variable is most likely to be at a nonoptimal value. Broadly speaking, if
then the objective function would probably change in the
d
$d$th significant digit if optimization could be continued. If
d
$d$ seems too large, consider restarting with a smaller
Major Optimality Tolerance.
Finally,
Nonlinear constraint violn in the Print file shows the maximum infeasibility for nonlinear rows. If it seems too large, consider restarting with a smaller
Major Feasibility Tolerance.
Error Indicators and Warnings
Note: nag_opt_nlp2_solve (e04wd) may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
 ifail = 1${\mathbf{ifail}}=1$
The initialization function
nag_opt_nlp2_init (e04wc) has not been called or at least one of
leniw and
lenrw is less than
600$600$.
 ifail = 2${\mathbf{ifail}}=2$
An input parameter is invalid.
 W ifail = 3${\mathbf{ifail}}=3$
Requested accuracy could not be achieved.
A feasible solution has been found, but the requested accuracy in the dual infeasibilities could not be achieved. An abnormal termination has occurred, but
nag_opt_nlp2_solve (e04wd) is within
10^{ − 2} ${10}^{2}$ of satisfying the
Major Optimality Tolerance. Check that the
Major Optimality Tolerance is not too small.
 W ifail = 4${\mathbf{ifail}}=4$
The problem appears to be infeasible.
When the constraints are linear, this message is based on a relatively reliable indicator of infeasibility. Feasibility is measured with respect to the upper and lower bounds on the variables and slacks. Among all the points satisfying the general constraints
Ax − s = 0 $Axs=0$ (see
(5) and
(6) in
Section [Major Iterations]), there is apparently no point that satisfies the bounds on
x $x$ and
s $s$. Violations as small as the
Minor Feasibility Tolerance are ignored, but at least one component of
x $x$ or
s $s$ violates a bound by more than the tolerance.
When nonlinear constraints are present, infeasibility is much harder to recognize correctly. Even if a feasible solution exists, the current linearization of the constraints may not contain a feasible point. In an attempt to deal with this situation, when solving each QP subproblem, nag_opt_nlp2_solve (e04wd) is prepared to relax the bounds on the slacks associated with nonlinear rows.
If a QP subproblem proves to be infeasible or unbounded (or if the Lagrange multiplier estimates for the nonlinear constraints become large),
nag_opt_nlp2_solve (e04wd) enters socalled ‘nonlinear elastic’ mode. The subproblem includes the original QP objective and the sum of the infeasibilities – suitably weighted using the optional parameter
Elastic Weight. In elastic mode, some of the bounds on the nonlinear rows are ‘elastic’ – i.e., they are allowed to violate their specific bounds. Variables subject to elastic bounds are known as
elastic variables. An elastic variable is free to violate one or both of its original upper or lower bounds. If the original problem has a feasible solution and the elastic weight is sufficiently large, a feasible point eventually will be obtained for the perturbed constraints, and optimization can continue on the subproblem. If the nonlinear problem has no feasible solution,
nag_opt_nlp2_solve (e04wd) will tend to determine a ‘good’ infeasible point if the elastic weight is sufficiently large. (If the elastic weight were infinite,
nag_opt_nlp2_solve (e04wd) would locally minimize the nonlinear constraint violations subject to the linear constraints and bounds.)
Unfortunately, even though nag_opt_nlp2_solve (e04wd) locally minimizes the nonlinear constraint violations, there may still exist other regions in which the nonlinear constraints are satisfied. Wherever possible, nonlinear constraints should be defined in such a way that feasible points are known to exist when the constraints are linearized.
 W ifail = 5${\mathbf{ifail}}=5$
The problem appears to be unbounded (or badly scaled).
For linear problems, unboundedness is detected by the simplex method when a nonbasic variable can be increased or decreased by an arbitrary amount without causing a basic variable to violate a bound. Consider adding an upper or lower bound to the variable. Also, examine the constraints that have nonzeros in the associated column, to see if they have been formulated as intended.
Very rarely, the scaling of the problem could be so poor that numerical error will give an erroneous indication of unboundedness. Consider using the optional parameter
Scale Option.
For nonlinear problems,
nag_opt_nlp2_solve (e04wd) monitors both the size of the current objective function and the size of the change in the variables at each step. If either of these is very large (as judged by the unbounded parameters (see
Section [Major Iteration Log])), the problem is terminated and declared unbounded. To avoid large function values, it may be necessary to impose bounds on some of the variables in order to keep them away from singularities in the nonlinear functions.
The message may indicate an abnormal termination while enforcing the limit on the constraint violations. This exit implies that the objective is not bounded below in the feasible region defined by expanding the bounds by the value of the
Violation Limit.
 ifail = 6${\mathbf{ifail}}=6$
Iteration limit reached.
Either the
Iterations Limit or the
Major Iterations Limit was exceeded before the required solution could be found. Check the iteration log to be sure that progress was being made. If so, and if you caused a basis file to be saved by using the optional parameter
New Basis File, consider restarting the run using the optional parameter
Old Basis File to see whether further progress can be made. If you have no basis file available, you might rerun the problem after increasing the optional parameters
Minor Iterations Limit and/or
Major Iterations Limit.
If none of the above limits have been reached, this error may mean that the problem appears to be more nonlinear than anticipated. The current set of basic and superbasic variables have been optimized as much as possible and a pricing operation (where a nonbasic variable is selected to become superbasic) is necessary to continue, but it can't continue as the number of superbasic variables has already reached the limit specified by the optional parameter
Superbasics Limit. In general, raise the
Superbasics Limit s $s$ by a reasonable amount, bearing in mind the storage needed for the reduced Hessian. (The
Reduced Hessian Dimension h$h$ will also increase to
s$s$ unless specified otherwise, and the associated storage will be about
(1/2)s^{2}$\frac{1}{2}{s}^{2}$ words.) In some cases you may have to set
h < s$h<s$ to conserve storage, but beware that the rate of convergence will probably fall off severely.
 W ifail = 7${\mathbf{ifail}}=7$
Numerical difficulties have been encountered and no further progress can be made.
Several circumstances could lead to this exit.
 The usersupplied functions objfun or confun could be returning accurate function values but inaccurate gradients (or vice versa). This is the most likely cause. Study the comments given for ifail = 8${\mathbf{ifail}}={\mathbf{8}}$, and do your best to ensure that the coding is correct.
 The function and gradient values could be consistent, but their precision could be too low. For example, accidental use of a real data type when double precision was intended would lead to a relative function precision of about 10^{ − 6} ${10}^{6}$ instead of something like 10^{ − 15} ${10}^{15}$. The default Major Optimality Tolerance of 2 × 10^{ − 6} $2\times {10}^{6}$ would need to be raised to about 10^{ − 3} ${10}^{3}$ for optimality to be declared (at a rather suboptimal point). Of course, it is better to revise the function coding to obtain as much precision as economically possible.
 If function values are obtained from an expensive iterative process, they may be accurate to rather few significant figures, and gradients will probably not be available. One should specify but even then, if t $t$ is as large as 10^{ − 5} ${10}^{5}$ or 10^{ − 6} ${10}^{6}$ (only 5$5$ or 6$6$ significant figures), the same exit condition may occur. At present the only remedy is to increase the accuracy of the function calculation.
 An LU $LU$ factorization of the basis has just been obtained and used to recompute the basic variables x_{B} ${x}_{B}$, given the present values of the superbasic and nonbasic variables. A step of ‘iterative refinement’ has also been applied to increase the accuracy of x_{B} ${x}_{B}$. However, a row check has revealed that the resulting solution does not satisfy the current constraints Ax − s = 0 $Axs=0$ sufficiently well.
This probably means that the current basis is very illconditioned. If there are some linear constraints and variables, try
Scale Option = 1${\mathbf{Scale\; Option}}=1$ if scaling has not yet been used.
For certain highly structured basis matrices (notably those with band structure), a systematic growth may occur in the factor
U $U$. Consult the description of
Umax and
Growth in
Section [Basis Factorization Statistics] and set the
LU Factor Tolerance to
2.0$2.0$ (or possibly even smaller, but not less than
1.0$1.0$).
 The first factorization attempt will have found the basis to be structurally or numerically singular. (Some diagonals of the triangular matrix U $U$ were respectively zero or smaller than a certain tolerance.) The associated variables are replaced by slacks and the modified basis is refactorized, but singularity persists. This must mean that the problem is badly scaled, or the LU Factor Tolerance is too much larger than 1.0$1.0$. This is highly unlikely to occur.
 ifail = 8${\mathbf{ifail}}=8$
Derivative appears to be incorrect.
If the message refers to the derivatives of the objective function, then a check has been made on some individual elements of the objective gradient array at the first point that satisfies the linear constraints. At least one component
gradj ${\mathbf{grad}}j$ is being set to a value that disagrees markedly with its associated forwarddifference estimate
(∂F)/(∂x_{j}) $\frac{\partial F}{\partial {x}_{j}}$. (The relative difference between the computed and estimated values is
1.0$1.0$ or more.) This exit is a safeguard, since
nag_opt_nlp2_solve (e04wd) will usually fail to make progress when the computed gradients are seriously inaccurate. In the process it may expend considerable effort before terminating with
ifail = 7${\mathbf{ifail}}={\mathbf{7}}$.
Check the function and gradient computation
very carefully in
objfun. A simple omission could explain everything. If
F $F$ or a component
(∂F)/(∂x_{j}) $\frac{\partial F}{\partial {x}_{j}}$ is very large, then give serious thought to scaling the function or the nonlinear variables.
If you feel
certain that the computed
grad(j) ${\mathbf{grad}}\left(j\right)$ is correct (and that the forwarddifference estimate is therefore wrong), you can specify
Verify Level = 0${\mathbf{Verify\; Level}}=0$ to prevent individual elements from being checked. However, the optimization procedure may have difficulty.
If the message refers to derivatives of the constraints, then at least one of the computed constraint derivatives is significantly different from an estimate obtained by forwarddifferencing the vector
c(x) $c\left(x\right)$. Follow the advice given above, trying to ensure that the arrays
ccon and
cjac are being set correctly in
confun.
 ifail = 9${\mathbf{ifail}}=9$
Undefined usersupplied function.
You have indicated that the problem functions are undefined by assigning the value
mode = − 1 ${\mathbf{mode}}=1$ on exit from
objfun or
confun.
nag_opt_nlp2_solve (e04wd) attempts to evaluate the problem functions closer to a point at which the functions are already known to be defined. This exit occurs if
nag_opt_nlp2_solve (e04wd) is unable to find a point at which the functions are defined. This will occur in the case of:
– 
undefined functions with no recovery possible; 
– 
undefined functions at the first point; 
– 
undefined functions at the first feasible point; or 
– 
undefined functions when checking derivatives. 
 W ifail = 10${\mathbf{ifail}}=10$
User requested termination.
You have indicated the wish to terminate solution of the current problem by setting
mode to a value
< − 1 $<1$ on exit from
objfun or
confun.
 ifail = 11${\mathbf{ifail}}=11$
Internal memory allocation failed when attempting to obtain the required workspace. Please contact
NAG.
 ifail = 12${\mathbf{ifail}}=12$
Internal memory allocation was insufficient. Please contact
NAG.
 ifail = 13${\mathbf{ifail}}=13$
An error has occurred in the basis package, perhaps indicating incorrect setup of arrays. Set the optional parameter
Print File and examine the output carefully for further information.
 ifail = 14${\mathbf{ifail}}=14$
An unexpected error has occurred. Set the optional parameter
Print File and examine the output carefully for further information.
Accuracy
If
ifail = 0${\mathbf{ifail}}={\mathbf{0}}$ on exit, then the vector returned in the array
x is an estimate of the solution to an accuracy of approximately
Major Optimality Tolerance.
Further Comments
This section describes the final output produced by
nag_opt_nlp2_solve (e04wd). Intermediate and other output are given in
Section [Description of Monitoring Information].
The Final Output
If
Print File
>
0
${\mathbf{Print\; File}}>0$,
the final output, including a listing of the status of every variable and constraint will be sent to the
channel numbers
associated with
Print File. The following describes the output for each variable. A full stop (.) is printed for any numerical value that is zero.
Variable 
gives the name (Variable) and index j$\mathit{j}$, for j = 1,2, … ,n$\mathit{j}=1,2,\dots ,n$, of the variable. 
State 
gives the state of the variable (FR if neither bound is in the working set, EQ if a fixed variable, LL if on its lower bound, UL if on its upper bound, TF if temporarily fixed at its current value). If Value lies outside the upper or lower bounds by more than the Feasibility Tolerance, State will be ++ or  respectively.
(The latter situation can occur only when there is no feasible point for the bounds and linear constraints.)
A key is sometimes printed before State.
A 
Alternative optimum possible. The variable is active at one of its bounds, but its Lagrange multiplier is essentially zero. This means that if the variable were allowed to start moving away from its bound then there would be no change to the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case the values of the Lagrange multipliers might also change.

D 
Degenerate. The variable is free, but it is equal to (or very close to) one of its bounds.

I 
Infeasible. The variable is currently violating one of its bounds by more than the Feasibility Tolerance.


Value 
is the value of the variable at the final iteration.

Lower bound 
is the lower bound specified for the variable. None indicates that bl(j) ≤ − bigbnd${\mathbf{bl}}\left(j\right)\le \mathit{bigbnd}$. 
Upper bound 
is the upper bound specified for the variable. None indicates that bu(j) ≥ bigbnd${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$. 
Lagr multiplier 
is the Lagrange multiplier for the associated bound. This will be zero if State is FR unless bl(j) ≤ − bigbnd${\mathbf{bl}}\left(j\right)\le \mathit{bigbnd}$ and bu(j) ≥ bigbnd${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$, in which case the entry will be blank. If x$x$ is optimal, the multiplier should be nonnegative if State is LL and nonpositive if State is UL. 
Slack 
is the difference between the variable Value and the nearer of its (finite) bounds bl(j)${\mathbf{bl}}\left(j\right)$ and bu(j)${\mathbf{bu}}\left(j\right)$. A blank entry indicates that the associated variable is not bounded (i.e., bl(j) ≤ − bigbnd${\mathbf{bl}}\left(j\right)\le \mathit{bigbnd}$ and bu(j) ≥ bigbnd${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$).

The meaning of the output for linear and nonlinear constraints is the same as that given above for variables, with
bl(j)${\mathbf{bl}}\left(j\right)$ and
bu(j)${\mathbf{bu}}\left(j\right)$ replaced by
bl(n + j)${\mathbf{bl}}\left(n+j\right)$ and
bu(n + j)${\mathbf{bu}}\left(n+j\right)$ respectively, and with the following changes in the heading:
Linear constrnt 
gives the name (lincon) and index j$\mathit{j}$, for j = 1,2, … ,n_{L}$\mathit{j}=1,2,\dots ,{n}_{L}$, of the linear constraint. 
Nonlin constrnt 
gives the name (nlncon) and index (j − n_{L}$\mathit{j}{n}_{L}$), for j = n_{L} + 1, … ,n_{L} + n_{N}$\mathit{j}={n}_{L}+1,\dots ,{n}_{L}+{n}_{N}$, of the nonlinear constraint. 
Note that movement off a constraint (as opposed to a variable moving away from its bound) can be interpreted as allowing the entry in the Slack column to become positive.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
Example
Open in the MATLAB editor:
nag_opt_nlp2_solve_example
function nag_opt_nlp2_solve_example
a = [1, 1, 1, 1];
bl = [1; 1; 1; 1; 1e25; 1e25; 25];
bu = [5; 5; 5; 5; 20; 40; 1e25];
istate = zeros(7, 1, 'int64');
ccon = zeros(2,1);
cjac = zeros(2,4);
clamda = zeros(7,1);
h = zeros(4,4);
x = [1; 5; 5; 1];
[iw, rw, ifail] = nag_opt_nlp2_init();
[majits, istateOut, ccon, cjacOut, clamdaOut, objf, grad, hOut, xOut, iwOut, rwOut, user, ifail] = ...
nag_opt_nlp2_solve(a, bl, bu, @confun, @objfun, istate, ccon, cjac, clamda, h, x, iw, rw);
majits, istateOut, ccon, cjacOut, clamdaOut, objf, grad, hOut, xOut, ifail
function [mode, ccon, cjac, user] = ...
confun(mode, ncnln, n, ldcj, needc, x, cjac, nstate, user)
ccon = zeros(ncnln, 1);
if (nstate == 1)
cjac = zeros(ncnln, n);
end
if (needc(1) > 0)
if (mode == 0  mode == 2)
ccon(1) = x(1)^2 + x(2)^2 + x(3)^2 + x(4)^2;
end
if (mode == 1  mode == 2)
cjac(1,1) = 2*x(1);
cjac(1,2) = 2*x(2);
cjac(1,3) = 2*x(3);
cjac(1,4) = 2*x(4);
end
end
if (needc(2) > 0)
if (mode == 0  mode == 2)
ccon(2) = x(1)*x(2)*x(3)*x(4);
end
if (mode == 1  mode == 2)
cjac(2,1) = x(2)*x(3)*x(4);
cjac(2,2) = x(1)*x(3)*x(4);
cjac(2,3) = x(1)*x(2)*x(4);
cjac(2,4) = x(1)*x(2)*x(3);
end
end
function [mode, objf, grad, user] = objfun(mode, n, x, grad, nstate, user)
if (mode == 0  mode == 2)
objf = x(1)*x(4)*(x(1)+x(2)+x(3)) + x(3);
end
if (mode == 1  mode == 2)
grad(1) = x(4)*(2*x(1)+x(2)+x(3));
grad(2) = x(1)*x(4);
grad(3) = x(1)*x(4) + 1;
grad(4) = x(1)*(x(1)+x(2)+x(3));
end
majits =
6
istateOut =
1
0
0
0
1
2
1
ccon =
40.0000
25.0000
cjacOut =
2.0000 9.4860 7.6423 2.7588
25.0000 5.2709 6.5425 18.1237
clamdaOut =
1.0879
0.0000
0.0000
0.0000
0
0.1615
0.5523
objf =
17.0140
grad =
14.5723
1.3794
2.3794
9.5641
hOut =
1.8647 0.1748 0.5895 1.1249
0.1748 1.0068 0.1477 0.2699
0.5895 0.1477 0.8149 0.3146
1.1249 0.2699 0.3146 0.8969
xOut =
1.0000
4.7430
3.8212
1.3794
ifail =
0
Open in the MATLAB editor:
e04wd_example
function e04wd_example
a = [1, 1, 1, 1];
bl = [1; 1; 1; 1; 1e25; 1e25; 25];
bu = [5; 5; 5; 5; 20; 40; 1e25];
istate = zeros(7, 1, 'int64');
ccon = zeros(2,1);
cjac = zeros(2,4);
clamda = zeros(7,1);
h = zeros(4,4);
x = [1; 5; 5; 1];
[iw, rw, ifail] = e04wc;
[majits, istateOut, ccon, cjacOut, clamdaOut, objf, grad, hOut, xOut, ...
iwOut, rwOut, user, ifail] = ...
e04wd(a, bl, bu, @confun, @objfun, istate, ccon, cjac, clamda, h, x, iw, rw);
majits, istateOut, ccon, cjacOut, clamdaOut, objf, grad, hOut, xOut, ifail
function [mode, ccon, cjac, user] = ...
confun(mode, ncnln, n, ldcj, needc, x, cjac, nstate, user)
ccon = zeros(ncnln, 1);
if (nstate == 1)
cjac = zeros(ncnln, n);
end
if (needc(1) > 0)
if (mode == 0  mode == 2)
ccon(1) = x(1)^2 + x(2)^2 + x(3)^2 + x(4)^2;
end
if (mode == 1  mode == 2)
cjac(1,1) = 2*x(1);
cjac(1,2) = 2*x(2);
cjac(1,3) = 2*x(3);
cjac(1,4) = 2*x(4);
end
end
if (needc(2) > 0)
if (mode == 0  mode == 2)
ccon(2) = x(1)*x(2)*x(3)*x(4);
end
if (mode == 1  mode == 2)
cjac(2,1) = x(2)*x(3)*x(4);
cjac(2,2) = x(1)*x(3)*x(4);
cjac(2,3) = x(1)*x(2)*x(4);
cjac(2,4) = x(1)*x(2)*x(3);
end
end
function [mode, objf, grad, user] = objfun(mode, n, x, grad, nstate, user)
if (mode == 0  mode == 2)
objf = x(1)*x(4)*(x(1)+x(2)+x(3)) + x(3);
end
if (mode == 1  mode == 2)
grad(1) = x(4)*(2*x(1)+x(2)+x(3));
grad(2) = x(1)*x(4);
grad(3) = x(1)*x(4) + 1;
grad(4) = x(1)*(x(1)+x(2)+x(3));
end
majits =
6
istateOut =
1
0
0
0
1
2
1
ccon =
40.0000
25.0000
cjacOut =
2.0000 9.4860 7.6423 2.7588
25.0000 5.2709 6.5425 18.1237
clamdaOut =
1.0879
0.0000
0.0000
0.0000
0
0.1615
0.5523
objf =
17.0140
grad =
14.5723
1.3794
2.3794
9.5641
hOut =
1.8647 0.1748 0.5895 1.1249
0.1748 1.0068 0.1477 0.2699
0.5895 0.1477 0.8149 0.3146
1.1249 0.2699 0.3146 0.8969
xOut =
1.0000
4.7430
3.8212
1.3794
ifail =
0
the remainder of this document is intended for more advanced users. Section [Algorithmic Details] contains a detailed description of the algorithm which may be needed in order to understand Sections [Optional Parameters] and [Description of Monitoring Information]. Section [Optional Parameters] describes the optional parameters which may be set by calls to nag_opt_nlp2_option_string (e04wf), nag_opt_nlp2_option_integer_set (e04wg) and/or nag_opt_nlp2_option_double_set (e04wh). Section [Description of Monitoring Information] describes the quantities which can be requested to monitor the course of the computation.
Algorithmic Details
Here we summarise the main features of the SQP algorithm used in
nag_opt_nlp2_solve (e04wd) and introduce some terminology used in the description of the function and its arguments. The SQP algorithm is fully described in
Gill et al. (2002).
Constraints and Slack Variables
The upper and lower bounds on the
n_{L}
+
n_{N}
${n}_{L}+{n}_{N}$ components of
$\left(\begin{array}{c}{A}_{L}x\\ c\left(x\right)\end{array}\right)$ are said to define the
general constraints of the problem.
nag_opt_nlp2_solve (e04wd) converts the general constraints to equalities by introducing a set of
slack variables
s
=
(s_{1},s_{2}, … ,s_{
nL
+
nN
})^{T}
$s={({s}_{1},{s}_{2},\dots ,{s}_{{n}_{L}+{n}_{N}})}^{\mathrm{T}}$. For example, the linear constraint
5
≤
2x_{1}
+
3x_{2}
≤
∞
$5\le 2{x}_{1}+3{x}_{2}\le \infty $ is replaced by
2x_{1}
+
3x_{2}
−
s_{1}
=
0
$2{x}_{1}+3{x}_{2}{s}_{1}=0$ together with the bounded slack
5
≤
s_{1}
≤
∞
$5\le {s}_{1}\le \infty $. The minimization problem
(1) can therefore be written in the equivalent form
The general constraints become the equalities
A_{L}x
−
s_{L}
=
0
${A}_{L}x{s}_{L}=0$ and
c(x)
−
s_{N}
=
0
$c\left(x\right){s}_{N}=0$, where
s_{L}
${s}_{L}$ and
s_{N}
${s}_{N}$ are the linear and nonlinear slacks.
Major Iterations
The basic structure of the SQP algorithm involves
major and
minor iterations. The major iterations generate a sequence of iterates
{x_{k}}
$\left\{{x}_{k}\right\}$ that satisfy the linear constraints and converge to a point that satisfies the nonlinear constraints and the firstorder conditions for optimality. At each iterate
x_{k}
${x}_{k}$ a QP subproblem is used to generate a search direction towards the next iterate
x_{k + 1}
${x}_{k+1}$. The constraints of the subproblem are formed from the linear constraints
A_{L}x
−
s_{L}
=
0
${A}_{L}x{s}_{L}=0$ and the linearized constraint
where
c^{′}
(x_{k})
${c}^{\prime}\left({x}_{k}\right)$ denotes the
Jacobian matrix, whose elements are the first derivatives of
c(x)
$c\left(x\right)$ evaluated at
x_{k}
${x}_{k}$. The QP constraints therefore comprise the
n_{L}
+
n_{N}
${n}_{L}+{n}_{N}$ linear constraints
where
x
$x$ and
s
$s$ are bounded above and below by
u
$u$ and
l
$l$ as before. If the
(n_{L} + n_{N})
×
n
$({n}_{L}+{n}_{N})\times n$ matrix
A
$A$ and
(n_{L} + n_{N})
$({n}_{L}+{n}_{N})$vector
b
$b$ are defined as
then the QP subproblem can be written as
where
q
(x,x_{k})
$q(x,{x}_{k})$ is a quadratic approximation to a modified Lagrangian function (see
Gill et al. (2002)). The matrix
H_{k}
${H}_{k}$ is a quasiNewton approximation to the Hessian of the Lagrangian. A BGFS update is applied after each major iteration. If some of the variables enter the Lagrangian linearly the Hessian will have some zero rows and columns. If the nonlinear variables appear first, then only the leading
n_{N}
${n}_{N}$ rows and columns of the Hessian need to be approximated.
Minor Iterations
Solving the QP subproblem is itself an iterative procedure. Here, the iterations of the QP solver
nag_opt_qpconvex2_sparse_solve (e04nq) form the
minor iterations of the SQP method.
nag_opt_qpconvex2_sparse_solve (e04nq) uses a reducedHessian activeset method implemented as a reducedgradient method. At each minor iteration, the constraints
Ax − s = b
$Axs=b$ are partitioned into the form
where the
basis matrix
B
$B$ is square and nonsingular, and the matrices
S$S$ and
N$N$ are the remaining columns of
$\left(\begin{array}{cc}A& I\end{array}\right)$. The vectors
x_{B}
${x}_{B}$,
x_{S}${x}_{S}$ and
x_{N}
${x}_{N}$ are the associated
basic,
superbasic and
nonbasic variables respectively; they are a permutation of the elements of
x
$x$ and
s
$s$. At a QP subproblem, the basic and superbasic variables will lie somewhere between their bounds, while the nonbasic variables will normally be equal to one of their bounds. At each iteration,
x_{S}
${x}_{S}$ is regarded as a set of independent variables that are free to move in any desired direction, namely one that will improve the value of the QP objective (or the sum of infeasibilities). The basic variables are then adjusted in order to ensure that
(x,s)
$(x,s)$ continues to satisfy
Ax − s = b
$Axs=b$. The number of superbasic variables (
n_{S}
${n}_{S}$, say) therefore indicates the number of degrees of freedom remaining after the constraints have been satisfied. In broad terms,
n_{S}
${n}_{S}$ is a measure of
how nonlinear the problem is. In particular,
n_{S}
${n}_{S}$ will always be zero for LP problems.
If it appears that no improvement can be made with the current definition of
B
$B$,
S
$S$ and
N
$N$, a nonbasic variable is selected to be added to
S
$S$, and the process is repeated with the value of
n_{S}
${n}_{S}$ increased by one. At all stages, if a basic or superbasic variable encounters one of its bounds, the variable is made nonbasic and the value of
n_{S}
${n}_{S}$ is decreased by one.
Associated with each of the
n_{L}
+
n_{N}
${n}_{L}+{n}_{N}$ equality constraints
Ax − s = b
$Axs=b$ are the dual variables
π
$\pi $. Similarly, each variable in
(x,s)
$(x,s)$ has an associated reduced gradient
d_{j}
${d}_{j}$. The reduced gradients for the variables
x
$x$ are the quantities
g − A^{T}π
$g{A}^{\mathrm{T}}\pi $, where
g
$g$ is the gradient of the QP objective, and the reduced gradients for the slacks are the dual variables
π
$\pi $. The QP subproblem is optimal if
d_{j} ≥ 0
${d}_{j}\ge 0$ for all nonbasic variables at their lower bounds,
d_{j} ≤ 0
${d}_{j}\le 0$ for all nonbasic variables at their upper bounds, and
d_{j} = 0
${d}_{j}=0$ for other variables, including superbasics. In practice, an approximate QP solution
(x̂_{k},ŝ_{k},π̂_{k})
$({\hat{x}}_{k},{\hat{s}}_{k},{\hat{\pi}}_{k})$ is found by relaxing these conditions.
The Merit Function
After a QP subproblem has been solved, new estimates of the solution are computed using a linesearch on the augmented Lagrangian merit function
where
D
$D$ is a diagonal matrix of penalty parameters
(D_{ii} ≥ 0)
$({D}_{ii}\ge 0)$, and
π$\pi $ now refers to dual variables for the nonlinear constraints in
(1). If
(x_{k},s_{k},π_{k})
$({x}_{k},{s}_{k},{\pi}_{k})$ denotes the current solution estimate and
(x̂_{k},ŝ_{k},π̂_{k})
$({\hat{x}}_{k},{\hat{s}}_{k},{\hat{\pi}}_{k})$ denotes the QP solution, the linesearch determines a step
α_{k}
${\alpha}_{k}$
(0 < α_{k} ≤ 1)
$(0<{\alpha}_{k}\le 1)$ such that the new point
gives a
sufficient decrease in the merit function
M
$\mathcal{M}$. When necessary, the penalties in
D
$D$ are increased by the minimumnorm perturbation that ensures descent for
M
$\mathcal{M}$ (see
Gill et al. (1992)). The value of
s_{N}
${s}_{N}$ is adjusted to minimize the merit function as a function of
s
$s$ before the solution of the QP subproblem (see
Gill et al. (1986) and
Eldersveld (1991)).
Treatment of Constraint Infeasibilities
nag_opt_nlp2_solve (e04wd) makes explicit allowance for infeasible constraints. First, infeasible
linear constraints are detected by solving the linear program
where
e
$e$ is a vector of ones, and the nonlinear constraint bounds are temporarily excluded from
l
$l$ and
u
$u$. This is equivalent to minimizing the sum of the general linear constraint violations subject to the bounds on
x
$x$. (The sum is the
ℓ_{1}
${\ell}_{1}$norm of the linear constraint violations. In the linear programming literature, the approach is called
elastic programming.)
The linear constraints are infeasible if the optimal solution of
(10) has
v ≠ 0
$v\ne 0$ or
w ≠ 0
$w\ne 0$.
nag_opt_nlp2_solve (e04wd) then terminates without computing the nonlinear functions.
Otherwise, all subsequent iterates satisfy the linear constraints. (Such a strategy allows linear constraints to be used to define a region in which the functions can be safely evaluated.)
nag_opt_nlp2_solve (e04wd) proceeds to solve nonlinear problems as given, using search directions obtained from the sequence of QP subproblems (see
(6)).
If a QP subproblem proves to be infeasible or unbounded (or if the dual variables
π
$\pi $ for the nonlinear constraints become large),
nag_opt_nlp2_solve (e04wd) enters ‘elastic’ mode and thereafter solves the problem
where
γ
$\gamma $ is a nonnegative parameter (the
elastic weight), and
F(x)
+
γ
e^{T}
(v + w)
$F\left(x\right)+\gamma {e}^{\mathrm{T}}(v+w)$ is called a
composite objective (the
ℓ_{1}
${\ell}_{1}$ penalty function for the nonlinear constraints).
The value of
γ
$\gamma $ may increase automatically by multiples of 10$10$ if the optimal
v
$v$ and
w
$w$ continue to be nonzero. If
γ
$\gamma $ is sufficiently large, this is equivalent to minimizing the sum of the nonlinear constraint violations subject to the linear constraints and bounds.
The initial value of
γ
$\gamma $ is controlled by the optional parameter
Elastic Weight.
Optional Parameters
Several optional parameters in nag_opt_nlp2_solve (e04wd) define choices in the problem specification or the algorithm logic. In order to reduce the number of formal parameters of nag_opt_nlp2_solve (e04wd) these optional parameters have associated default values that are appropriate for most problems. Therefore, you need only specify those optional parameters whose values are to be different from their default values.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section [Description of the optional parameters].
Optional parameters may be specified by calling one, or more, of the functions
nag_opt_nlp2_option_string (e04wf) and
nag_opt_nlp2_option_integer_set (e04wg)
before a call to
nag_opt_nlp2_solve (e04wd).
All optional parameters not specified by you are set to their default values. Optional parameters specified by you are unaltered by nag_opt_nlp2_solve (e04wd) (unless they define invalid values) and so remain in effect for subsequent calls to nag_opt_nlp2_solve (e04wd), unless altered by you.
Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
 the keywords, where the minimum abbreviation of each keyword is underlined (if no characters of an optional qualifier are underlined, the qualifier may be omitted);
 a parameter value,
where the letters a$a$, i and r$i\text{ and}r$ denote options that take character, integer and real values respectively;
 the default value, where the symbol ε$\epsilon $ is a generic notation for machine precision (see nag_machine_precision (x02aj)), and ε_{r}${\epsilon}_{r}$ denotes the relative precision of the objective function Function Precision, and bigbnd$\mathit{bigbnd}$ signifies the value of Infinite Bound Size.
Keywords and character values are case and white space insensitive.
Central Difference Interval r$r$Default = ε_{r}^{(1/3)}$\text{}={\epsilon}_{r}^{\frac{1}{3}}$When
Derivative Level < 3 ${\mathbf{Derivative\; Level}}<3$, the centraldifference interval
r $r$ is used near an optimal solution to obtain more accurate (but more expensive) estimates of gradients. Twice as many function evaluations are required compared to forward differencing. The interval used for the
j $j$th variable is
h_{j} = r (1 + x_{j}) ${h}_{j}=r(1+\left{x}_{j}\right)$. The resulting derivative estimates should be accurate to
O(r^{2}) $\mathit{O}\left({r}^{2}\right)$, unless the functions are badly scaled.
If you supply a value for this optional parameter, a small value between 0.0$0.0$ and 1.0$1.0$ is appropriate.
Check Frequency i$i$Default = 60$\text{}=60$Every i $i$th minor iteration after the most recent basis factorization, a numerical test is made to see if the current solution x $x$ satisfies the general linear constraints (the linear constraints and the linearized nonlinear constraints, if any). The constraints are of the form Ax − s = b $Axs=b$, where s $s$ is the set of slack variables. To perform the numerical test, the residual vector r = b − Ax + s $r=bAx+s$ is computed. If the largest component of r $r$ is judged to be too large, the current basis is refactorized and the basic variables are recomputed to satisfy the general constraints more accurately. If i ≤ 0$i\le 0$, the value of i = 99999999$i=99999999$ is used and effectively no checks are made.
Check Frequency = 1${\mathbf{Check\; Frequency}}=1$ is useful for debugging purposes, but otherwise this option should not be needed.
Cold Start DefaultWarm Start This option controls the specification of the initial working set in the procedure for finding a feasible point for the linear constraints and bounds and in the first QP subproblem thereafter. With a
Cold Start, the first working set is chosen by
nag_opt_nlp2_solve (e04wd) based on the values of the variables and constraints at the initial point. Broadly speaking, the initial working set will include equality constraints and bounds or inequality constraints that violate or ‘nearly’ satisfy their bounds (to within
Crash Tolerance).
With a
Warm Start, you must set the
istate array and define
clamda and
h as discussed in
Section [Parameters].
istate values associated with bounds and linear constraints determine the initial working set of the procedure to find a feasible point with respect to the bounds and linear constraints.
istate values associated with nonlinear constraints determine the initial working set of the first QP subproblem after such a feasible point has been found.
nag_opt_nlp2_solve (e04wd) will override your specification of
istate if necessary, so that a poor choice of the working set will not cause a fatal error. For instance, any elements of
istate which are set to
− 2$2$,
− 1 or 4$1\text{ or}4$ will be reset to zero, as will any elements which are set to
3$3$ when the corresponding elements of
bl and
bu are not equal. A warm start will be advantageous if a good estimate of the initial working set is available – for example, when
nag_opt_nlp2_solve (e04wd) is called repeatedly to solve related problems.
Crash Option i$i$Default = 3$\text{}=3$Crash Tolerance r$r$Default = 0.1$\text{}=0.1$If a
Cold Start is specified, an internal Crash procedure is used to select an initial basis from certain rows and columns of the constraint matrix
$\left(\begin{array}{cc}A& I\end{array}\right)$. The optional parameter
Crash Option i $i$ determines which rows and columns of
A $A$ are eligible initially, and how many times the Crash procedure is called. Columns of
− I $I$ are used to pad the basis where necessary.
i$i$ 
Meaning 
0$0$ 
The initial basis contains only slack variables: B = I$B=I$. 
1$1$ 
The Crash procedure is called once, looking for a triangular basis in all rows and columns of A$A$. 
2$2$ 
The Crash procedure is called twice (if there are nonlinear constraints). The first call looks for a triangular basis in linear rows, and the iteration proceeds with simplex iterations until the linear constraints are satisfied. The Jacobian is then evaluated for the first major iteration and the Crash procedure is called again to find a triangular basis in the nonlinear rows (retaining the current basis for linear rows). 
3$3$ 
The Crash procedure is called up to three times (if there are nonlinear constraints). The first two calls treat linear equalities and linear inequalities separately. As before, the last call treats nonlinear rows before the first major iteration. 
If i ≥ 1 $i\ge 1$, certain slacks on inequality rows are selected for the basis first. (If i ≥ 2 $i\ge 2$, numerical values are used to exclude slacks that are close to a bound). The Crash procedure then makes several passes through the columns of A $A$, searching for a basis matrix that is essentially triangular. A column is assigned to ‘pivot’ on a particular row if the column contains a suitably large element in a row that has not yet been assigned. (The pivot elements ultimately form the diagonals of the triangular basis.) For remaining unassigned rows, slack variables are inserted to complete the basis.
The
Crash Tolerance r $r$ allows the starting Crash procedure to ignore certain ‘small’ nonzeros in each column of
A $A$. If
a_{max} ${a}_{\mathrm{max}}$ is the largest element in column
j $j$, other nonzeros of
a_{ij} ${a}_{ij}$ in the columns are ignored if
a_{ij} ≤ a_{max} × r $\left{a}_{ij}\right\le {a}_{\mathrm{max}}\times r$. (To be meaningful,
r $r$ must be in the range
0 ≤ r < 1 $0\le r<1$.)
When r > 0.0 $r>0.0$, the basis obtained by the Crash procedure may not be strictly triangular, but it is likely to be nonsingular and almost triangular. The intention is to obtain a starting basis containing more columns of A $A$ and fewer (arbitrary) slacks. A feasible solution may be reached sooner on some problems.
For example, suppose the first
m$m$ columns of
A$A$ form the matrix shown under
LU Factor Tolerance; i.e., a tridiagonal matrix with entries
− 1$1$,
4$4$,
− 1$1$. To help the Crash procedure choose all
m$m$ columns for the initial basis, we would specify a
Crash Tolerance of
r$r$ for some value of
r > 0.5$r>0.5$.
Defaults This special keyword may be used to reset all optional parameters to their default values.
Derivative Level i$i$Default = 3$\text{}=3$Optional parameter
Derivative Level specifies which nonlinear function gradients are known analytically and will be supplied to
nag_opt_nlp2_solve (e04wd) by usersupplied functions
objfun and
confun.
i$i$ 
Meaning 
3$3$ 
All objective and constraint gradients are known. 
2$2$ 
All constraint gradients are known, but some or all components of the objective gradient are unknown. 
1$1$ 
The objective gradient is known, but some or all of the constraint gradients are unknown. 
0$0$ 
Some components of the objective gradient are unknown and some of the constraint gradients are unknown. 
The value i = 3 $i=3$ should be used whenever possible. It is the most reliable and will usually be the most efficient.
If
i = 0 $i=0$ or
2 $2$,
nag_opt_nlp2_solve (e04wd) will
estimate the missing components of the objective gradient, using finite differences. This may simplify the coding of
objfun. However, it could increase the total runtime substantially (since a special call to
objfun is required for each missing element), and there is less assurance that an acceptable solution will be located. If the nonlinear variables are not well scaled, it may be necessary to specify a nondefault optional parameter
Difference Interval.
If
i = 0 $i=0$ or
1 $1$,
nag_opt_nlp2_solve (e04wd) will estimate missing elements of the Jacobian. For each column of the Jacobian, one call to
confun is needed to estimate all missing elements in that column, if any.
At times, central differences are used rather than forward differences. (This is not under your control.)
Derivative Linesearch DefaultNonderivative Linesearch At each major iteration a linesearch is used to improve the merit function. Optional parameter
Derivative Linesearch uses safeguarded cubic interpolation and requires both function and gradient values to compute estimates of the step
α_{k} ${\alpha}_{k}$. If some analytic derivatives are not provided, or optional parameter
Nonderivative Linesearch is specified,
nag_opt_nlp2_solve (e04wd) employs a linesearch based upon safeguarded quadratic interpolation, which does not require gradient evaluations.
A nonderivative linesearch can be slightly less robust on difficult problems, and it is recommended that the default be used if the functions and derivatives can be computed at approximately the same cost. If the gradients are very expensive relative to the functions, a nonderivative linesearch may give a significant decrease in computation time.
If
Nonderivative Linesearch is selected,
nag_opt_nlp2_solve (e04wd) signals the evaluation of the linesearch by calling
objfun with
mode = 0${\mathbf{mode}}=0$. If the potential saving provided by a nonderivative linesearch is to be realised, it is essential that
objfun be coded so that derivatives are not computed when
mode = 0${\mathbf{mode}}=0$.
Difference Interval r$r$Default = sqrt(ε_{r})$\text{}=\sqrt{{\epsilon}_{r}}$This alters the interval
r $r$ used to estimate gradients by forward differences. It does so in the following circumstances:
– 
in the interval (‘cheap’) phase of verifying the problem derivatives; 
– 
for verifying the problem derivatives; 
– 
for estimating missing derivatives. 
In all cases, a derivative with respect to x_{j} ${x}_{j}$ is estimated by perturbing that component of x $x$ to the value x_{j} + r (1 + x_{j}) ${x}_{j}+r(1+\left{x}_{j}\right)$, and then evaluating F(x) $F\left(x\right)$ or c(x) $c\left(x\right)$ at the perturbed point. The resulting gradient estimates should be accurate to O(r) $\mathit{O}\left(r\right)$ unless the functions are badly scaled. Judicious alteration of r $r$ may sometimes lead to greater accuracy.
If you supply a value for this optional parameter, a small value between 0.0$0.0$ and 1.0$1.0$ is appropriate.
Dump File i_{1}${i}_{1}$Default = 0$\text{}=0$Load File i_{2}${i}_{2}$Default = 0$\text{}=0$Optional parameters
Dump File and
Load File are similar to optional parameters
Punch File and
Insert File, but they record solution information in a manner that is more direct and more easily modified. A full description of information recorded in optional parameters
Dump File and
Load File is given in
Gill et al. (2005a).
If i_{1} > 0 ${i}_{1}>0$, the last solution obtained will be output to the file with unit number i_{1} ${i}_{1}$.
If
i_{2} > 0 ${i}_{2}>0$, the
Load File,
containing basis information, will be read. The file will usually have been output previously as a
Dump File. The file will not be accessed if optional parameters
Old Basis File or
Insert File are specified.
Elastic Weight r$r$Default = 10^{4}$\text{}={10}^{4}$This keyword determines the initial weight
γ $\gamma $ associated with the problem
(11) (see
Section [Treatment of Constraint Infeasibilities]).
At major iteration k $k$, if elastic mode has not yet started, a scale factor σ_{k} = 1 + ‖g(x_{k})‖_{∞} ${\sigma}_{k}=1+{\Vert g\left({x}_{k}\right)\Vert}_{\infty}$ is defined from the current objective gradient. Elastic mode is then started if the QP subproblem is infeasible, or the QP dual variables are larger in magnitude than σ_{k}r ${\sigma}_{k}\text{}r$. The QP is resolved in elastic mode with γ = σ_{k}r $\gamma ={\sigma}_{k}\text{}r$.
Thereafter, major iterations continue in elastic mode until they converge to a point that is optimal for
(11) (see
Section [Treatment of Constraint Infeasibilities]). If the point is feasible for equation
(1) (v = w = 0) $(v=w=0)$, it is declared locally optimal. Otherwise,
γ $\gamma $ is increased by a factor of
10$10$ and major iterations continue. If
γ$\gamma $ has already reached a maximum allowable value, equation
(1) is declared locally infeasible.
Expand Frequency i$i$Default = 10000$\text{}=10000$This option is part of the anticycling procedure designed to make progress even on highly degenerate problems.
For linear models, the strategy is to force a positive step at every iteration, at the expense of violating the bounds on the variables by a small amount. Suppose that the optional parameter
Minor Feasibility Tolerance is
δ $\delta $. Over a period of
i $i$ iterations, the tolerance actually used by
nag_opt_nlp2_solve (e04wd) increases from
0.5δ $0.5\delta $ to
δ $\delta $ (in steps of
0.5δ / i $0.5\delta /i$).
For nonlinear models, the same procedure is used for iterations in which there is only one superbasic variable. (Cycling can occur only when the current solution is at a vertex of the feasible region.) Thus, zero steps are allowed if there is more than one superbasic variable, but otherwise positive steps are enforced.
Increasing
i $i$ helps reduce the number of slightly infeasible nonbasic variables (most of which are eliminated during a resetting procedure). However, it also diminishes the freedom to choose a large pivot element (see optional parameter
Pivot Tolerance).
Factorization Frequency i$i$Default = 50$\text{}=50$At most i $i$ basis changes will occur between factorizations of the basis matrix.
With linear programs, the basis factors are usually updated every iteration. The default i $i$ is reasonable for typical problems. Higher values up to i = 100 $i=100$ (say) may be more efficient on wellscaled problems.
When the objective function is nonlinear, fewer basis updates will occur as an optimum is approached. The number of iterations between basis factorizations will therefore increase. During these iterations a test is made regularly (according to the optional parameter
Check Frequency) to ensure that the general constraints are satisfied. If necessary the basis will be refactorized before the limit of
i $i$ updates is reached.
Function Precision r$r$Default = ε^{0.8}$\text{}={\epsilon}^{0.8}$The relative function precision ε_{r} ${\epsilon}_{r}$ is intended to be a measure of the relative accuracy with which the functions can be computed. For example, if F(x) $F\left(x\right)$ is computed as 1000.56789$1000.56789$ for some relevant x $x$ and if the first 6$6$ significant digits are known to be correct, the appropriate value for ε_{r} ${\epsilon}_{r}$ would be 1.0e−6 $\text{1.0e\u22126}$.
(Ideally the functions F(x) $F\left(x\right)$ or c_{i}(x) ${c}_{i}\left(x\right)$ should have magnitude of order 1$1$. If all functions are substantially less than 1$1$ in magnitude, ε_{r} ${\epsilon}_{r}$ should be the absolute precision. For example, if F(x) = 1.23456789e−4 $F\left(x\right)=\text{1.23456789e\u22124}$ at some point and if the first 6$6$ significant digits are known to be correct, the appropriate value for ε_{r} ${\epsilon}_{r}$ would be 1.0e−10 $\text{1.0e\u221210}$.)
The default value of ε_{r} ${\epsilon}_{r}$ is appropriate for simple analytic functions.
In some cases the function values will be the result of extensive computation, possibly involving a costly iterative procedure that can provide few digits of precision. Specifying an appropriate
Function Precision may lead to savings, by allowing the linesearch procedure to terminate when the difference between function values along the search direction becomes as small as the absolute error in the values.
Hessian Full Memory Default if n ≤ 75$n\le 75$Hessian Limited Memory Default if n > 75$n>75$These options select the method for storing and updating the approximate Hessian. (nag_opt_nlp2_solve (e04wd) uses a quasiNewton approximation to the Hessian of the Lagrangian. A BFGS update is applied after each major iteration.)
If
Hessian Full Memory is specified, the approximate Hessian is treated as a dense matrix and the BFGS updates are applied explicitly. This option is most efficient when the number of variables
n$n$ is not too large (say, less than
75$75$). In this case, the storage requirement is fixed and one can expect
1$1$step Qsuperlinear convergence to the solution.
Hessian Limited Memory should be used on problems where
n$n$ is very large. In this case a limitedmemory procedure is used to update a diagonal Hessian approximation
H_{r} ${H}_{r}$ a limited number of times. (Updates are accumulated as a list of vector pairs. They are discarded at regular intervals after
H_{r} ${H}_{r}$ has been reset to their diagonal.)
Hessian Frequency i$i$Default = 99999999$\text{}=99999999$If optional parameter
Hessian Full Memory is in effect and
i $i$ BFGS updates have already been carried out, the Hessian approximation is reset to the identity matrix. (For certain problems, occasional resets may improve convergence, but in general they should not be necessary.)
Hessian Full Memory and
Hessian Frequency = 10 ${\mathbf{Hessian\; Frequency}}=10$ have a similar effect to
Hessian Limited Memory and
Hessian Updates = 10 ${\mathbf{Hessian\; Updates}}=10$ (except that the latter retains the current diagonal during resets).
Hessian Updates i$i$Default = Hessian Frequency$\text{}={\mathbf{Hessian\; Frequency}}$ if Hessian Full Memory, 10$10$ otherwiseIf optional parameter
Hessian Limited Memory is in effect and
i $i$ BFGS updates have already been carried out, all but the diagonal elements of the accumulated updates are discarded and the updating process starts again.
Broadly speaking, the more updates stored, the better the quality of the approximate Hessian. However, the more vectors stored, the greater the cost of each QP iteration. The default value is likely to give a robust algorithm without significant expense, but faster convergence can sometimes be obtained with significantly fewer updates (e.g., i = 5 $i=5$).
Infinite Bound Size r$r$Default = 10^{20}$\text{}={10}^{20}$If r > 0$r>0$, r$r$ defines the ‘infinite’ bound bigbnd$\mathit{bigbnd}$ in the definition of the problem constraints. Any upper bound greater than or equal to bigbnd$\mathit{bigbnd}$ will be regarded as + ∞$+\infty $ (and similarly any lower bound less than or equal to − bigbnd$\mathit{bigbnd}$ will be regarded as − ∞$\infty $). If r < 0$r<0$, the default value is used.
Iterations Limit i$i$Default =
max (10000,
10
max (n,n_{L} + n_{N})
)
$\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(10000,10\mathrm{max}\phantom{\rule{0.125em}{0ex}}(n,{n}_{L}+{n}_{N}))$The value of
i$i$ specifies the maximum number of minor iterations allowed (i.e., iterations of the simplex method or the QP algorithm), summed over all major iterations. (See also the description of the optional parameter
Minor Iterations Limit.)
Linesearch Tolerance r$r$Default = 0.9$=0.9$This tolerance, r $r$, controls the accuracy with which a step length will be located along the direction of search each iteration. At the start of each linesearch a target directional derivative for the merit function is identified. This parameter determines the accuracy to which this target value is approximated, and it must be a value in the range 0.0 ≤ r ≤ 1.0 $0.0\le r\le 1.0$.
The default value r = 0.9 $r=0.9$ requests just moderate accuracy in the linesearch.
If the nonlinear functions are cheap to evaluate, a more accurate search may be appropriate; try r = 0.1 , 0.01 or 0.001 $r=0.1\text{,}0.01\text{ or}0.001$.
If the nonlinear functions are expensive to evaluate, a less accurate search may be appropriate. If all gradients are known, try r = 0.99 $r=0.99$. (The number of major iterations might increase, but the total number of function evaluations may decrease enough to compensate.)
If not all gradients are known, a moderately accurate search remains appropriate. Each search will require only 1$1$–5 function values (typically), but many function calls will then be needed to estimate missing gradients for the next iteration.
Nolist DefaultList For
nag_opt_nlp2_solve (e04wd), normally each optional parameter specification is printed as it is supplied. Optional parameter
Nolist may be used to suppress the printing and optional parameter
List may be used to turn on printing.
LU Density Tolerance r_{1}${r}_{1}$Default = 0.6$\text{}=0.6$LU Singularity Tolerance r_{2}${r}_{2}$Default = ε^{(2/3)}$\text{}={\epsilon}^{\frac{2}{3}}$The density tolerance, r_{1} ${r}_{1}$, is used during LU $LU$ factorization of the basis matrix B$B$. Columns of L $L$ and rows of U $U$ are formed one at a time, and the remaining rows and columns of the basis are altered appropriately. At any stage, if the density of the remaining matrix exceeds r_{1} ${r}_{1}$, the Markowitz strategy for choosing pivots is terminated, and the remaining matrix is factored by a dense LU$LU$ procedure. Raising the density tolerance towards 1.0$1.0$ may give slightly sparser LU $LU$ factors, with a slight increase in factorization time.
The singularity tolerance, r_{2} ${r}_{2}$, helps guard against illconditioned basis matrices. After B$B$ is refactorized, the diagonal elements of U $U$ are tested as follows: if u_{jj} ≤ r_{2} $\left{u}_{jj}\right\le {r}_{2}$ or u_{jj} < r_{2} max_{i} u_{ij} $\left{u}_{jj}\right<{r}_{2}{\displaystyle \underset{i}{\mathrm{max}}}\phantom{\rule{0.25em}{0ex}}\left{u}_{ij}\right$, the j $j$th column of the basis is replaced by the corresponding slack variable. (This is most likely to occur after a restart.)
LU Factor Tolerance r_{1}${r}_{1}$Default = 1.10$\text{}=1.10$LU Update Tolerance r_{2}${r}_{2}$Default = 1.10$\text{}=1.10$The values of
r_{1}${r}_{1}$ and
r_{2}${r}_{2}$ affect the stability of the basis factorization
B = LU$B=LU$, during refactorization and updates respectively. The lower triangular matrix
L$L$ is a product of matrices of the form
where the multipliers
μ$\mu $ will satisfy
μ ≤ r_{i}$\left\mu \right\le {r}_{i}$. The default values of
r_{1}${r}_{1}$ and
r_{2}${r}_{2}$ usually strike a good compromise between stability and sparsity. They must satisfy
r_{1}${r}_{1}$,
r_{2} ≥ 1.0${r}_{2}\ge 1.0$.
For large and relatively dense problems, r_{1} = 10.0 or 5.0${r}_{1}=10.0\text{ or}5.0$ (say) may give a useful improvement in stability without impairing sparsity to a serious degree.
For certain very regular structures (e.g., band matrices) it may be necessary to reduce
r_{1} and/or r_{2}${r}_{1}\text{ and/or}{r}_{2}$ in order to achieve stability. For example, if the columns of
A$A$ include a submatrix of the form
one should set both
r_{1}${r}_{1}$ and
r_{2}${r}_{2}$ to values in the range
1.0 ≤ r_{i} < 4.0$1.0\le {r}_{i}<4.0$.
LU Partial Pivoting DefaultLU Complete Pivoting LU Rook Pivoting The
LU $LU$ factorization implements a Markowitztype search for pivots that locally minimize the fillin subject to a threshold pivoting stability criterion. The default option is to use threshhold partial pivoting. The optional parameters
LU Rook Pivoting and
LU Complete Pivoting are more expensive than partial pivoting but are more stable and better at revealing rank, as long as
LU Factor Tolerance is not too large (say
< 2.0$<2.0$). When numerical difficulties are encountered,
nag_opt_nlp2_solve (e04wd) automatically reduces the
LU$LU$ tolerance towards
1.0$1.0$ and switches (if necessary) to rook or complete pivoting, before reverting to the default or specified options at the next refactorization (with
System Information Yes, relevant messages are output to the
Print File).
Major Feasibility Tolerance r$r$Default =
max (10^{ − 6},sqrt(ε))
$\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}({10}^{6},\sqrt{\epsilon})$This tolerance, r $r$, specifies how accurately the nonlinear constraints should be satisfied. The default value is appropriate when the linear and nonlinear constraints contain data to about that accuracy.
Let
v_{max}${v}_{\mathrm{max}}$ be the maximum nonlinear constraint violation, normalized by the size of the solution, which is required to satisfy
where
v_{i} ${v}_{i}$ is the violation of the
i $i$th nonlinear constraint
(i = 1 : n_{L}) $(i=1:{n}_{L})$.
In the major iteration log (see
Section [Minor Iteration Log],
v_{max}${v}_{\mathrm{max}}$ appears as the quantity labelled ‘Feasible’. If some of the problem functions are known to be of low accuracy, a larger
Major Feasibility Tolerance may be appropriate.
Major Optimality Tolerance r$r$Default =
2
max (10^{ − 6},sqrt(ε))
$\text{}=2\mathrm{max}\phantom{\rule{0.125em}{0ex}}({10}^{6},\sqrt{\epsilon})$This tolerance,
r $r$, specifies the final accuracy of the dual variables. On successful termination,
nag_opt_nlp2_solve (e04wd) will have computed a solution
(x,s,π) $(x,s,\pi )$ such that
where
c_{j} ${c}_{j}$ is an estimate of the complementarity slackness for variable
j $j$ where
j = 1 : n + n_{L} + n_{N}$j=1:n+{n}_{L}+{n}_{N}$. The values
c_{i} ${c}_{i}$ are computed from the final QP solution using the reduced gradients
d_{j} = g_{j} − π^{T} a_{j} ${d}_{j}={g}_{j}{\pi}^{\mathrm{T}}{a}_{j}$ (where
g_{j} ${g}_{j}$ is the
j $j$th component of the objective gradient,
a_{j} ${a}_{j}$ is the associated column of the constraint matrix
$\left(\begin{array}{cc}A& I\end{array}\right)$, and
π $\pi $ is the set of QP dual variables):
In the
Print File,
c_{max}${c}_{\mathrm{max}}$ appears as the quantity labelled ‘Optimal’.
Major Iterations Limit i$i$Default =
max (1000,
3
max (n,
n_{L}
+
n_{N}
)
)
$\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(1000,3\mathrm{max}\phantom{\rule{0.125em}{0ex}}(n,{n}_{L}+{n}_{N}))$This is the maximum number of major iterations allowed. It is intended to guard against an excessive number of linearizations of the constraints. If i = 0$i=0$, optimality and feasibility are checked.
Major Print Level i$i$Default = 000001$\text{}=000001$This controls the amount of output to the optional parameters
Print File and
Summary File at each major iteration.
Major Print Level = 0${\mathbf{Major\; Print\; Level}}=0$ suppresses most output, except for error messages.
Major Print Level = 1${\mathbf{Major\; Print\; Level}}=1$ gives normal output for linear and nonlinear problems, and
Major Print Level = 11${\mathbf{Major\; Print\; Level}}=11$ gives additional details of the Jacobian factorization that commences each major iteration.
In general, the value being specified may be thought of as a binary number of the form
where each letter stands for a digit that is either
0$0$ or
1$1$ as follows:
s$s$ 
a single line that gives a summary of each major iteration. (This entry in JFDXbs $JFDXbs$ is not strictly binary since the summary line is printed whenever JFDXbs ≥ 1 $JFDXbs\ge 1$); 
b$b$ 
basis statistics, i.e., information relating to the basis matrix whenever it is refactorized. (This output is always provided if JFDXbs ≥ 10 $JFDXbs\ge 10$); 
X$X$ 
x_{k} ${x}_{k}$, the nonlinear variables involved in the objective function or the constraints. These appear under the heading ‘Jacobian variables’; 
D$D$ 
π_{k} ${\pi}_{k}$, the dual variables for the nonlinear constraints. These appear under the heading ‘Multiplier estimates’; 
F$F$ 
c(x_{k}) $c\left({x}_{k}\right)$, the values of the nonlinear constraint functions; 
J$J$ 
J(x_{k}) $J\left({x}_{k}\right)$, the Jacobian matrix. This appears under the heading ‘x$x$ and Jacobian’. 
To obtain output of any items JFDXbs $JFDXbs$, set the corresponding digit to 1$1$, otherwise to 0$0$.
If
J = 1 $J=1$, the Jacobian matrix will be output columnwise at the start of each major iteration. Column
j $j$ will be preceded by the value of the corresponding variable
x_{j} ${x}_{j}$ and a key to indicate whether the variable is basic, superbasic or nonbasic. (Hence if
J = 1 $J=1$, there is no reason to specify
X = 1 $X=1$ unless the objective contains more nonlinear variables than the Jacobian.) A typical line of output is
3 1.250000E+01 BS 1 1.00000E+00 4 2.00000E+00
which would mean that
x_{3} ${x}_{3}$ is basic at value
12.5$12.5$, and the third column of the Jacobian has elements of
1.0$1.0$ and
2.0$2.0$ in rows
1$1$ and
4$4$.
Major Step Limit r$r$Default = 2.0$\text{}=2.0$This parameter limits the change in
x $x$ during a linesearch. It applies to all nonlinear problems, once a ‘feasible solution’ or ‘feasible subproblem’ has been found. A linesearch determines a step
α $\alpha $ over the range
0 < α ≤ β $0<\alpha \le \beta $, where
β $\beta $ is
1$1$ if there are nonlinear constraints, or is the step to the nearest upper or lower bound on
x $x$ if all the constraints are linear. Normally, the first step length tried is
α_{1}
=
min (1,β)
${\alpha}_{1}=\mathrm{min}\phantom{\rule{0.125em}{0ex}}(1,\beta )$.
 In some cases, such as f(x) = a e^{bx} $f\left(x\right)=a{e}^{bx}$ or f(x) = a x^{b} $f\left(x\right)=a{x}^{b}$, even a moderate change in the components of x $x$ can lead to floating point overflow. The parameter r $r$ is therefore used to define a limit β = r(1 + ‖x‖) / ‖p‖ $\stackrel{}{\beta}=r(1+\Vert x\Vert )/\Vert p\Vert $ (where p $p$ is the search direction), and the first evaluation of f(x) $f\left(x\right)$ is at the potentially smaller step length
α_{1}
=
min (1,β,β)
${\alpha}_{1}=\mathrm{min}\phantom{\rule{0.125em}{0ex}}(1,\stackrel{}{\beta},\beta )$.
 Wherever possible, upper and lower bounds on x $x$ should be used to prevent evaluation of nonlinear functions at meaningless points. The optional parameter Major Step Limit provides an additional safeguard. The default value r = 2.0 $r=2.0$ should not affect progress on well behaved problems, but setting r = 0.1 or 0.01 $r=0.1\text{ or}0.01$ may be helpful when rapidly varying functions are present. A ‘good’ starting point may be required. An important application is to the class of nonlinear least squares problems.
 In cases where several local optima exist, specifying a small value for r $r$ may help locate an optimum near the starting point.
Minimize DefaultMaximize Feasible Point The keywords
Minimize and
Maximize specify the required direction of optimization. It applies to both linear and nonlinear terms in the objective.
The keyword
Feasible Point means ‘Ignore the objective function, while finding a feasible point for the linear and nonlinear constraints’. It can be used to check that the nonlinear constraints are feasible without altering the call to
nag_opt_nlp2_solve (e04wd).
Minor Feasibility Tolerance Feasibility Tolerance r$r$Default =
max {10^{ − 6},sqrt(ε)}
$\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}\{{10}^{6},\sqrt{\epsilon}\}$nag_opt_nlp2_solve (e04wd) tries to ensure that all variables eventually satisfy their upper and lower bounds to within this tolerance, r $r$. This includes slack variables. Hence, general linear constraints should also be satisfied to within r $r$.
Feasibility with respect to nonlinear constraints is judged by the optional parameter
Major Feasibility Tolerance (not by
r $r$).
If the bounds and linear constraints cannot be satisfied to within r $r$, the problem is declared infeasible. If
the corresponding sum of infeasibilities
is quite small, it may be appropriate to raise r $r$ by a factor of 10$10$ or 100$100$. Otherwise, some error in the data should be suspected.
Nonlinear functions will be evaluated only at points that satisfy the bounds and linear constraints. If there are regions where a function is undefined, every attempt should be made to eliminate these regions from the problem.
For example, if f(x) = sqrt(x_{1}) + log(x_{2}) $f\left(x\right)=\sqrt{{x}_{1}}+\mathrm{log}\left({x}_{2}\right)$, it is essential to place lower bounds on both variables. If r = 1.0e−6 $r=\text{1.0e\u22126}$, the bounds x_{1} ≥ 10^{ − 5} ${x}_{1}\ge {10}^{5}$ and x_{2} ≥ 10^{ − 4} ${x}_{2}\ge {10}^{4}$ might be appropriate. (The log singularity is more serious. In general, keep x $x$ as far away from singularities as possible.)
If
Scale Option ≥ 1 ${\mathbf{Scale\; Option}}\ge 1$, feasibility is defined in terms of the
scaled problem (since it is then more likely to be meaningful).
In reality,
nag_opt_nlp2_solve (e04wd) uses
r $r$ as a feasibility tolerance for satisfying the bounds on
x $x$ and
s $s$ in each QP subproblem. If the sum of infeasibilities cannot be reduced to zero, the QP subproblem is declared infeasible.
nag_opt_nlp2_solve (e04wd) is then in
elastic mode thereafter (with only the linearized nonlinear constraints defined to be elastic). See the description of the optional parameter
Elastic Weight.
Minor Iterations Limit i$i$Default = 500$\text{}=500$If the number of minor iterations for the optimality phase of the QP subproblem exceeds i $i$, then all nonbasic QP variables that have not yet moved are frozen at their current values and the reduced QP is solved to optimality.
Note that more than i $i$ minor iterations may be necessary to solve the reduced QP to optimality. These extra iterations are necessary to ensure that the terminated point gives a suitable direction for the linesearch.
In the major iteration log (see
Section [Minor Iteration Log]) a
t at the end of a line indicates that the corresponding QP was artificially terminated using the limit
i $i$.
Compare with the optional parameter
Iterations Limit, which defines an independent
absolute limit on the
total number of minor iterations (summed over all QP subproblems).
Minor Print Level i$i$Default = 1$\text{}=1$This controls the amount of output to the
Print File and the
Summary File during solution of the QP subproblems. The value of
i $i$ has the following effect:
i$i$ 
Output 
0$0$ 
No minor iteration output except error messages. 
≥ 1$\ge 1$ 
A single line of output at each minor iteration (controlled by optional parameters Print Frequency and Summary Frequency. 
≥ 10$\ge 10$ 
Basis factorization statistics generated during the periodic refactorization of the basis (see the optional parameter Factorization Frequency). Statistics for the first factorization each major iteration are controlled by the optional parameter Major Print Level. 
New Basis File i_{1}${i}_{1}$Default = 0$\text{}=0$Backup Basis File i_{2}${i}_{2}$Default = 0$\text{}=0$Save Frequency i_{3}${i}_{3}$Default = 100$\text{}=100$New Basis File and
Backup Basis File are sometimes referred to as basis maps. They contain the most compact representation of the state of each variable. They are intended for restarting the solution of a problem at a point that was reached by an earlier run. For nontrivial problems, it is advisable to save basis maps at the end of a run, in order to restart the run if necessary.
If i_{1} > 0 ${i}_{1}>0$,
a basis map will be saved on the
file associated with unit i_{1} ${i}_{1}$ every i_{3} ${i}_{3}$th iteration. The first record of the file will contain the word PROCEEDING if the run is still in progress. A basis map will also be saved at the end of a run, with some other word indicating the final solution status.
Use of
i_{2} > 0 ${i}_{2}>0$ is intended as a safeguard against losing the results of a long run. Suppose that a
New Basis File is being saved every
100$100$ (
Save Frequency) iterations, and that
nag_opt_nlp2_solve (e04wd) is about to save such a basis at iteration
2000$2000$. It is conceivable that the run may be interrupted during the next few milliseconds (in the middle of the save). In this case the Basis file will be corrupted and the run will have been essentially wasted.
To eliminate this risk, both a
New Basis File and a
Backup Basis File may be
specified. The following would be suitable for the above example:
Backup Basis File 11
New Basis File 12
The current basis will then be saved every 100$100$ iterations, first on the
file associated with unit 12$12$ and then immediately on the
file associated with unit 11$11$.
If the run is interrupted at iteration 2000$2000$ during the save on the
file associated with unit 12$12$,
there will still be a usable basis on the
file associated with unit 11$11$ (corresponding to iteration 1900$1900$).
Note that a new basis will be saved in
New Basis File at the end of a run if it terminates normally, but it will not be saved in
Backup Basis File. In the above example, if an optimum solution is found at iteration
2050$2050$ (or if the iteration limit is
2050$2050$), the final basis in the
file associated with unit
12$12$ will correspond to iteration
2050$2050$, but the last basis saved in the
file associated with unit
11$11$ will be the one for iteration
2000$2000$.
A full description of information recorded in
New Basis File and
Backup Basis File is given in
Gill et al. (2005a).
New Superbasics Limit i$i$Default = 99$\text{}=99$This option causes early termination of the QP subproblems if the number of free variables has increased significantly since the first feasible point. If the number of new superbasics is greater than i $i$, the nonbasic variables that have not yet moved are frozen and the resulting smaller QP is solved to optimality.
In the major iteration log (see
Section [Major Iteration Log]), a
t at the end of a line indicates that the QP was terminated early in this way.
Old Basis File i$i$Default = 0$\text{}=0$
If
i > 0 $i>0$, the basis maps information will be obtained from this file.
The file will usually have been output previously as a
New Basis File or
Backup Basis File.
A full description of information recorded in
New Basis File and
Backup Basis File is given in
Gill et al. (2005a).
The file will not be acceptable if the number of rows or columns in the problem has been altered.
Partial Price i$i$Default = 1$\text{}=1$This parameter is recommended for large problems that have significantly more variables than constraints. It reduces the work required for each ‘pricing’ operation (where a nonbasic variable is selected to become superbasic). When
i = 1 $i=1$, all columns of the constraint matrix
$\left(\begin{array}{cc}A& I\end{array}\right)$ are searched. Otherwise,
A $A$ and
I $I$ are partitioned to give
i $i$ roughly equal segments
A_{j} ${A}_{\mathit{j}}$ and
I_{j} ${I}_{\mathit{j}}$, for
j = 1,2, … ,i$\mathit{j}=1,2,\dots ,i$. If the previous pricing search was successful on
A_{j − 1} ${A}_{j1}$ and
I_{j − 1} ${I}_{j1}$, the next search begins on the segments
A_{j} ${A}_{j}$ and
I_{j} ${I}_{j}$. (All subscripts here are modulo
i $i$.) If a reduced gradient is found that is larger than some dynamic tolerance, the variable with the largest such reduced gradient (of appropriate sign) is selected to become superbasic. If nothing is found, the search continues on the next segments
A_{j + 1} ${A}_{j+1}$ and
I_{j + 1} ${I}_{j+1}$, and so on.
For timestage models having
t $t$ time periods,
Partial Price t $t$ (or
t / 2 $t/2$ or
t / 3 $t/3$) may be appropriate.
Pivot Tolerance r$r$Default = ε^{(2/3)}$\text{}={\epsilon}^{\frac{2}{3}}$During the solution of QP subproblems, the pivot tolerance is used to prevent columns entering the basis if they would cause the basis to become almost singular.
When x $x$ changes to x + αp $x+\alpha p$ for some search direction p $p$, a ‘ratio test’ determines which component of x $x$ reaches an upper or lower bound first. The corresponding element of p $p$ is called the pivot element. Elements of p $p$ are ignored (and therefore cannot be pivot elements) if they are smaller than the pivot tolerance r $r$.
It is common for two or more variables to reach a bound at essentially the same time. In such cases, the
Minor Feasibility Tolerance (say,
t $t$) provides some freedom to maximize the pivot element and thereby improve numerical stability. Excessively small values of
t $t$ should therefore not be specified. To a lesser extent, the
Expand Frequency (say,
f $f$) also provides some freedom to maximize the pivot element. Excessively
large values of
f $f$ should therefore not be specified.
Print File i$i$Default = 0$\text{}=0$
If
i > 0 $i>0$,
the following information is output to a file associated with
unit
i$i$ during the solution of each problem:
– 
a listing of the optional parameters; 
– 
some statistics about the problem; 
– 
the amount of storage available for the LU $LU$ factorization of the basis matrix; 
– 
notes about the initial basis resulting from a Crash procedure or a Basis file; 
– 
the iteration log; 
– 
basis factorization statistics; 
– 
the exit ifail condition and some statistics about the solution obtained; 
– 
the printed solution, if requested. 
These items are described in
Sections [Further Comments] and
[Description of Monitoring Information]. Further brief output may be directed to the
Summary File.
Print Frequency i$i$Default = 100$\text{}=100$If i > 0 $i>0$, one line of the iteration log will be printed every i $i$th iteration. A value such as i = 10 $i=10$ is suggested for those interested only in the final solution. If i ≤ 0$i\le 0$, the value of i = 99999999$i=99999999$ is used and effectively no checks are made.
Proximal Point Method i$i$Default = 1$\text{}=1$ i = 1 or 2 $i=1\text{ or}2$ specifies minimization of ‖x − x_{0}‖_{1} ${\Vert x{x}_{0}\Vert}_{1}$ or (1/2) ‖x − x_{0}‖_{2}^{2}$\frac{1}{2}{\Vert x{x}_{0}\Vert}_{2}^{2}$ when the starting point x_{0} ${x}_{0}$ is changed to satisfy the linear constraints (where x_{0} ${x}_{0}$ refers to nonlinear variables).
Punch File i_{1}${i}_{1}$Default = 0$=0$Insert File i_{2}${i}_{2}$Default = 0$=0$The
Punch File from a previous run may be used as an
Insert File for a later run on the same problem. A full description of information recorded in
Insert File and
Punch File is given in
Gill et al. (2005a).
If i_{1} > 0 ${i}_{1}>0$, the final solution obtained will be output to the file.
For linear programs, this format is compatible with various commercial systems.
If
i_{2} > 0 ${i}_{2}>0$ the
Insert File containing basis information will be read from unit
i_{2} ${i}_{2}$.
The file will usually have been output previously as a
Punch File. The file will not be accessed if
Old Basis File is specified.
QPSolver Cholesky DefaultQPSolver CG QPSolver QN Specifies the activeset algorithm used to solve subproblem
(11) (see
Section [Treatment of Constraint Infeasibilities]).
QPSolver Cholesky holds the full Cholesky factor
R$R$ of the reduced Hessian
Z^{T}HZ${Z}^{\mathrm{T}}HZ$. As the QP iterations proceed, the dimension of
R$R$ changes with the number of superbasic variables. If the number of superbasic variables needs to increase beyond the value of
Reduced Hessian Dimension, the reduced Hessian cannot be stored and the solver switches to
QPSolver CG. The Cholesky solver is reactivated if the number of superbasics stabilizes at a value less than
Reduced Hessian Dimension.
QPSolver QN solves the QP using a quasiNewton method. In this case,
R$R$ is the factor of a quasiNewton approximate Hessian.
QPSolver CG uses an activeset method similar to
QPSolver QN, but uses the conjugategradient method to solve all systems involving the reduced Hessian.
The Cholesky QP solver is the most robust, but may require a significant amount of computation if there are many superbasics.
The quasiNewton QP solver does not require computation of the exact
R$R$ at the start of the subproblem in
(11). It may be appropriate when the number of superbasics is large but relatively few iterations are needed to reach a solution (e.g., if
nag_opt_nlp2_solve (e04wd) is called with a Warm Start).
The conjugategradient QP solver is appropriate for problems with many degrees of freedom (say, more than 2000$2000$ superbasics).
Reduced Hessian Dimension i$i$Default
=
min (2000,n)
$=\mathrm{min}\phantom{\rule{0.125em}{0ex}}(2000,n)$This specifies that an i$i$ by i$i$ triangular matrix R$R$ (to define the reduced Hessian according to R^{T} R = Z^{T} HZ ${R}^{\mathrm{T}}R={Z}^{\mathrm{T}}HZ$) is to be available for use by the Cholesky QP solver.
Scale Option i$i$Default = 0$\text{}=0$Scale Tolerance r$r$Default = 0.9$\text{}=0.9$Scale Print Three scale options are available as follows:
i$i$ 
Meaning 
0 
No scaling. This is recommended if it is known that x $x$ and the constraint matrix never have very large elements (say, larger than 100$100$). 
1 
The constraints and variables are scaled by an iterative procedure that attempts to make the matrix coefficients as close as possible to 1.0$1.0$ (see Fourer (1982)). This will sometimes improve the performance of the solution procedures. 
2 
The constraints and variables are scaled by the iterative procedure. Also, a certain additional scaling is performed that may be helpful if the righthand side b $b$ or the solution x $x$ is large. This takes into account columns of $\left(\begin{array}{cc}A& I\end{array}\right)$ that are fixed or have positive lower bounds or negative upper bounds. 
Optional parameter
Scale Tolerance affects how many passes might be needed through the constraint matrix. On each pass, the scaling procedure computes the ratio of the largest and smallest nonzero coefficients in each column:
If
max_{j} ρ_{j}$\underset{j}{\mathrm{max}}}\phantom{\rule{0.25em}{0ex}}{\rho}_{j$ is less than
r $r$ times its previous value, another scaling pass is performed to adjust the row and column scales. Raising
r $r$ from
0.9$0.9$ to
0.99$0.99$ (say) usually increases the number of scaling passes through
A $A$. At most
10$10$ passes are made. The value of
r$r$ should lie in the range
0 < r < 1$0<r<1$.
Scale Print causes the row scales
r(i)$r\left(i\right)$ and column scales
c(j)$c\left(j\right)$ to be printed to
Print File, if
System Information Yes has been specified. The scaled matrix coefficients are
a_{ij}
=
a_{ij}
c(j)
/
r(i)${\stackrel{}{a}}_{ij}={a}_{ij}c\left(j\right)/r\left(i\right)$, and the scaled bounds on the variables and slacks are
l_{j}
=
l_{j}
/
c(j)
${\stackrel{}{l}}_{j}={l}_{j}/c\left(j\right)$,
u_{j}
=
u_{j}
/
c(j)
${\stackrel{}{u}}_{j}={u}_{j}/c\left(j\right)$, where
c(j)
=
r(j − n)
$c\left(j\right)=r(jn)$ if
j > n$j>n$.
Solution File i$i$Default = 0$\text{}=0$If i > 0 $i>0$, the final solution will be output to file i $i$ (whether optimal or not). All numbers are printed in 1pe16.6 format.
To see more significant digits in the printed solution, it will sometimes be useful to
make
i $i$ refer to
Print File.
Start Objective Check At Variable i$i$Default = 1$\text{}=1$Stop Objective Check At Variable i$i$Default = n$\text{}=n$Start Constraint Check At Variable i$i$Default = 1$\text{}=1$Stop Constraint Check At Variable i$i$Default = n$\text{}=n$These keywords take effect only if
Verify Level > 0${\mathbf{Verify\; Level}}>0$. They may be used to contol the verification of gradient elements computed by function
objfun and/or Jacobian elements computed by function
confun. For eample, if the first
30$30$ elements of the objective gradient appeared to be correct in an earlier run, so that only element
31$31$ remains questionable, it is reasonable to specify
Start Objective Check At Variable = 31${\mathbf{Start\; Objective\; Check\; At\; Variable}}=31$. If the first
30$30$ variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.
Summary File i_{1}${i}_{1}$Default = 0$\text{}=0$Summary Frequency i_{2}${i}_{2}$Default = 100$\text{}=100$
If
i_{1} > 0 ${i}_{1}>0$, a brief log will be output to the file associated with unit
i_{1} ${i}_{1}$,
including one line of information every
i_{2} ${i}_{2}$th iteration. In an interactive environment, it is useful to direct this output to the terminal, to allow a run to be monitored online. (If something looks wrong, the run can be manually terminated.) Further details are given in
Section [The Summary File].
Superbasics Limit i$i$Default
=
n
$\text{}=n$This option places a limit on the storage allocated for superbasic variables. Ideally, i $i$ should be set slightly larger than the ‘number of degrees of freedom’ expected at an optimal solution.
For nonlinear problems, the number of degrees of freedom is often called the ‘number of independent variables’. Normally, i $i$ need not be greater than n_{N} + 1 ${n}_{N}+1$, where n_{N} ${n}_{N}$ is the number of nonlinear variables. For many problems, i $i$ may be considerably smaller than n_{N}${n}_{N}$. This will save storage if n_{N}${n}_{N}$ is very large.
Suppress Parameters Normally
nag_opt_nlp2_solve (e04wd) prints the options file as it is being read, and then prints a complete list of the available keywords and their final values. The optional parameter
Suppress Parameters tells
nag_opt_nlp2_solve (e04wd) not to print the full list.
System Information No DefaultSystem Information Yes This option prints additional information on the progress of major and minor iterations, and Crash statistics. See
Section [Description of Monitoring Information].
Timing Level i$i$Default = 0$\text{}=0$If
i > 0 $i>0$, some timing information will be output to the Print file, if
Print File > 0${\mathbf{Print\; File}}>0$.
Unbounded Objective r_{1}${r}_{1}$Default = 1.0e+15$\text{}=\text{1.0e+15}$Unbounded Step Size r_{2}${r}_{2}$Default = bigbnd$\text{}=\mathit{bigbnd}$These parameters are intended to detect unboundedness in nonlinear problems. During a linesearch,
F $F$ is evaluated at points of the form
x + αp $x+\alpha p$, where
x $x$ and
p $p$ are fixed and
α $\alpha $ varies. If
F $\leftF\right$ exceeds
r_{1} ${r}_{1}$ or
α $\alpha $ exceeds
r_{2} ${r}_{2}$, iterations are terminated with the exit message
ifail = 5${\mathbf{ifail}}={\mathbf{5}}$.
If singularities are present, unboundedness in F(x) $F\left(x\right)$ may be manifested by a floating point overflow (during the evaluation of F(x + αp) $F(x+\alpha p)$), before the test against r_{1} ${r}_{1}$ can be made.
Unboundedness in x $x$ is best avoided by placing finite upper and lower bounds on the variables.
Verify Level i$i$Default = 0$\text{}=0$This option refers to finite difference checks on the derivatives computed by the usersupplied functions. Derivatives are checked at the first point that satisfies all bounds and linear constraints.
i$i$ 
Meaning 
0$0$ 
Only a ‘cheap’ test will be performed, requiring two calls to confun. 
1$1$ 
Individual gradients will be checked (with a more reliable test). A key of the form OK or Bad? indicates whether or not each component appears to be correct. 
2$2$ 
Individual columns of the problem Jacobian will be checked. 
3$3$ 
Options 2 and 1 will both occur (in that order). 
− 1$1$ 
Derivative checking is disabled. 
Verify Level = 3${\mathbf{Verify\; Level}}=3$ should be specified whenever a new
function
function is being developed. Missing derivatives are not checked, so they result in no overhead.
Violation Limit r$r$Default = 1.0e+6$\text{}=\text{1.0e+6}$This keyword defines an absolute limit on the magnitude of the maximum constraint violation,
r $r$, after the linesearch. On completion of the linesearch, the new iterate
x_{k + 1} ${x}_{k+1}$ satisfies the condition
where
x_{0} ${x}_{0}$ is the point at which the nonlinear constraints are first evaluated and
v_{i}(x) ${v}_{i}\left(x\right)$ is the
i $i$th nonlinear constraint violation
v_{i}(x)
=
max (0,
l_{i}
−
c_{i}(x)
,
c_{i}(x)
−
u_{i}
)
${v}_{i}\left(x\right)=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(0,{l}_{i}{c}_{i}\left(x\right),{c}_{i}\left(x\right){u}_{i})$.
The effect of this violation limit is to restrict the iterates to lie in an expanded feasible region whose size depends on the magnitude of r $r$. This makes it possible to keep the iterates within a region where the objective is expected to be well defined and bounded below. If the obective is bounded below for all values of the variables, then r $r$ may be any large positive value.
Description of Monitoring Information
nag_opt_nlp2_solve (e04wd) produces monitoring information, statistical information and information about the solution.
Section [The Final Output] contains the final output information sent to unit
Print File. This section contains other output information.
Major Iteration Log
This section describes the output to unit
Print File if
Major Print Level
>
0
${\mathbf{Major\; Print\; Level}}>0$. One line of information is output every
k
$k$th major iteration, where
k
$k$ is
Print Frequency.
Label 
Description 
Itns 
is the cumulative number of minor iterations. 
Major 
is the current major iteration number. 
Minors 
is the number of iterations required by both the feasibility and optimality phases of the QP subproblem. Generally, Minors will be 1$1$ in the later iterations, since theoretical analysis predicts that the correct active set will be identified near the solution (see Section [Algorithmic Details]). 
Step 
is the step length
α
$\alpha $ taken along the current search direction
p
$p$. The variables
x
$x$ have just been changed to
x
+
α
p
$x+\alpha p$. On reasonably wellbehaved problems, the unit step will be taken as the solution is approached. 
nCon or nObj 
nCon is the number of times confun has been called to evaluate the nonlinear problem functions. Evaluations needed for the estimation of the derivatives by finite differences are not included. nCon is printed as a guide to the amount of work required for the linesearch. If
n_{N}
${n}_{N}$, the number of nonlinear constraints, is zero, nCon does not appear, but is replaced by nObj. This quantity is the number of calls made to objfun. 
Feasible 
is the value of
v_{max}
${v}_{\mathrm{max}}$ (see (12)), the maximum component of the scaled nonlinear constraint residual (see the description of the optional parameter Major Feasibility Tolerance). The solution is regarded as acceptably feasible if Feasible is less than the Major Feasibility Tolerance. In this case, the entry is contained in parentheses.
If the constraints are linear, all iterates are feasible and this entry is not printed. 
Optimal 
is the value of
c_{max}
${c}_{\mathrm{max}}$ (see (13)), the maximum complementary gap (see the description of the optional parameter Major Optimality Tolerance). It is an estimate of the degree of nonoptimality of the reduced costs. Both Feasible and Optimal are small in the neighbourhood of a solution. 
MeritFunction or Objective 
is the value of the augmented Lagrangian merit function (see (8)). This function will decrease at each iteration unless it was necessary to increase the penalty parameters (see Section [The Merit Function]). As the solution is approached, MeritFunction will converge to the value of the objective at the solution.
In elastic mode, the merit function is a composite function involving the constraint violations weighted by the elastic weight.
If the constraints are linear, this item is labelled Objective, the value of the objective function. It will decrease monotonically to its optimal value. 
L+U 
is the number of nonzeros representing the basis factors
L
$L$ and
U
$U$ on completion of the QP subproblem.
If nonlinear constraints are present, the basis factorization
B
=
LU
$B=LU$ is computed at the start of the first minor iteration. At this stage,
L+U
=
lenL
+
lenU
$\mathtt{L+U}=\mathtt{lenL}+\mathtt{lenU}$, where lenL (see Section [Basis Factorization Statistics]) is the number of subdiagonal elements in the columns of a lower triangular matrix and lenU (see Section [Basis Factorization Statistics]) is the number of diagonal and superdiagonal elements in the rows of an uppertriangular matrix.
As columns of
B
$B$ are replaced during the minor iterations, L+U may fluctuate up or down but, in general, will tend to increase. As the solution is approached and the minor iterations decrease towards zero, L+U will reflect the number of nonzeros in the
LU
$LU$ factors at the start of the QP subproblem.
If the constraints are linear, refactorization is subject only to the Factorization Frequency, and L+U will tend to increase between factorizations. 
BSwap 
is the number of columns of the basis matrix
B
$B$ that were swapped with columns of
S
$S$ to improve the condition of
B
$B$. The swaps are determined by an
LU
$LU$ factorization of the rectangular matrix
BS
=
(BS)
${B}_{S}={\left(\begin{array}{cc}B& S\end{array}\right)}^{\mathrm{T}}$ with stability being favoured more than sparsity. 
nS 
is the current number of superbasic variables. 
condHz 
is an estimate of the condition number of
R^{T}R
${R}^{\mathrm{T}}R$, itself an estimate of
Z^{T}HZ
${Z}^{\mathrm{T}}HZ$, the reduced Hessian of the Lagrangian. The condition number is the square of the ratio of the largest and smallest diagonals of the upper triangular matrix
R
$R$, this being a lower bound on the condition number of
R^{T}R
${R}^{\mathrm{T}}R$. condHz gives a rough indication of whether or not the optimization procedure is having difficulty. If
ε
$\epsilon $ is the relative machine precision being used, the SQP algorithm will make slow progress if condHz becomes as large as
ε^{ − 1 / 2}
≈
10^{8}
${\epsilon}^{1/2}\approx {10}^{8}$, and will probably fail to find a better solution if condHz reaches
ε^{ − 3 / 4}
≈
10^{12}
${\epsilon}^{3/4}\approx {10}^{12}$.
To guard against high values of condHz, attention should be given to the scaling of the variables and the constraints. In some cases it may be necessary to add upper or lower bounds to certain variables to keep them a reasonable distance from singularities in the nonlinear functions or their derivatives. 
Penalty 
is the Euclidean norm of the vector of penalty parameters used in the augmented Lagrangian merit function (not printed if there are no nonlinear constraints). 
The summary line may include additional code characters that indicate what happened during the course of the major iteration. These will follow the separator ‘_’ in the output.
Label 
Description 
c 
central differences have been used to compute the unknown components of the objective and constraint gradients. A switch to central differences is made if either the linesearch gives a small step, or
x
$x$ is close to being optimal. In some cases, it may be necessary to resolve the QP subproblem with the central difference gradient and Jacobian. 
d 
during the linesearch it was necessary to decrease the step in order to obtain a maximum constraint violation conforming to the value of Violation Limit. 
D 
you set mode = − 1${\mathbf{mode}}=1$ on exit from objfun, indicating that the linesearch needed to be done with a smaller value of the step length α$\alpha $. 
l 
the norm wise change in the variables was limited by the value of the Major Step Limit. If this output occurs repeatedly during later iterations, it may be worthwhile increasing the value of Major Step Limit. 
i 
if nag_opt_nlp2_solve (e04wd) is not in elastic mode, an i signifies that the QP subproblem is infeasible. This event triggers the start of nonlinear elastic mode, which remains in effect for all subsequent iterations. Once in elastic mode, the QP subproblems are associated with the elastic problem (11) (see Section [Treatment of Constraint Infeasibilities]).
If nag_opt_nlp2_solve (e04wd) is already in elastic mode, an i indicates that the minimizer of the elastic subproblem does not satisfy the linearized constraints. (In this case, a feasible point for the usual QP subproblem may or may not exist.) 
M 
an extra evaluation of the problem functions was needed to define an acceptable positive definite quasiNewton update to the Lagrangian Hessian. This modification is only done when there are nonlinear constraints. 
m 
this is the same as M except that it was also necessary to modify the update to include an augmented Lagrangian term. 
n 
no positive definite BFGS update could be found. The approximate Hessian is unchanged from the previous iteration. 
R 
the approximate Hessian has been reset by discarding all but the diagonal elements. This reset will be forced periodically by the Hessian Frequency and Hessian Updates keywords. However, it may also be necessary to reset an illconditioned Hessian from time to time. 
r 
the approximate Hessian was reset after ten consecutive major iterations in which no BFGS update could be made. The diagonals of the approximate Hessian are retained if at least one update has been done since the last reset. Otherwise, the approximate Hessian is reset to the identity matrix. 
s 
a selfscaled BFGS update was performed. This update is used when the Hessian approximation is diagonal, and hence always follows a Hessian reset. 
t 
the minor iterations were terminated because of the Minor Iterations Limit. 
T 
the minor iterations were terminated because of the New Superbasics Limit. 
u 
the QP subproblem was unbounded. 
w 
a weak solution of the QP subproblem was found. 
z 
the Superbasics Limit was reached. 
Minor Iteration Log
If
Minor Print Level
>
0
${\mathbf{Minor\; Print\; Level}}>0$, one line of information is output to the Print file every
k
$k$th minor iteration, where
k
$k$ is the specified
Print Frequency. A heading is printed before the first such line following a basis factorization. The heading contains the items described below. In this description, a pricing operation is the process by which a nonbasic variable is selected to become superbasic (in addition to those already in the superbasic set). The selected variable is denoted by
jq. Variable
jq often becomes basic immediately. Otherwise it remains superbasic, unless it reaches its opposite bound and returns to the nonbasic set.
If
Partial Price is in effect, variable
jq is selected from
A_{pp}
${A}_{\mathtt{pp}}$ or
I_{pp}
${I}_{\mathtt{pp}}$, the
pp
$\mathtt{pp}$th segments of the constraint matrix
$\left(\begin{array}{cc}A& I\end{array}\right)$.
Label 
Description 
Itn 
the current iteration number. 
LPmult or QPmult 
is the reduced cost (or reduced gradient) of the variable jq selected by the pricing procedure at the start of the present iteration. Algebraically, the reduced gradient is
d_{j}
=
g_{j}
−
π^{T}
a_{j}
${d}_{j}={g}_{j}{\pi}^{\mathrm{T}}{a}_{j}$ for
j
=
jq
$j=\mathtt{jq}$, where
g_{j}
${g}_{j}$ is the gradient of the current objective function,
π
$\pi $ is the vector of dual variables for the QP subproblem, and
a_{j}
${a}_{j}$ is the
j
$j$th column of
$\left(\begin{array}{cc}A& I\end{array}\right)$.
Note that the reduced cost is the 1$1$norm of the reducedgradient vector at the start of the iteration, just after the pricing procedure. 
LPstep or QPstep 
is the step length
α
$\alpha $ taken along the current search direction
p
$p$. The variables
x
$x$ have just been changed to
x
+
α
p
$x+\alpha p$. Write Step to stand for LPStep or QPStep, depending on the problem. If a variable is made superbasic during the current iteration (
+SBS > 0
$\mathtt{+SBS}>0$), Step will be the step to the nearest bound. During the solution of (11), the step can be greater than one only if the reduced Hessian is not positive definite. 
nInf 
is the number of infeasibilities after the present iteration. This number will not increase unless the iterations are in elastic mode. 
SumInf 
is the sum of infeasibilities after the present iteration, if
nInf > 0
$\mathtt{nInf}>0$. The value usually decreases at each nonzero Step, but if it decreases by 2$2$ or more, SumInf may occasionally increase. 
rgNorm 
is the norm of the reducedgradient vector at the start of the iteration. (It is the norm of the vector with elements
d_{j}
${d}_{j}$ for variables
j
$j$ in the superbasic set.) During the solution of subproblem (11) this norm will be approximately zero after a unit step. (The heading is not printed if the problem is linear.) 
LPobjective, QPobjective or Elastic QPobj 
the QP objective function after the present iteration. In elastic mode, the heading is changed to Elastic QPobj. In either case, the value printed decreases monotonically. 
+SBS 
is the variable jq selected by the pricing operation to be added to the superbasic set. 
SBS 
is the superbasic variable chosen to become nonbasic. 
BS 
is the basis variable removed (if any) to become nonbasic. 
Pivot 
if column
a_{q}
${a}_{q}$ replaces the
r
$r$th column of the basis
B
$B$, Pivot is the
r
$r$th element of a vector
y
$y$ satisfying
By = a_{q}
$By={a}_{q}$. Wherever possible, Step is chosen to avoid extremely small values of Pivot (since they cause the basis to be nearly singular). In rare cases, it may be necessary to increase the Pivot Tolerance to exclude very small elements of
y
$y$ from consideration during the computation of Step. 
L+U 
is the number of nonzeros representing the basis factors
L
$L$ and
U
$U$. Immediately after a basis factorization
B = LU
$B=LU$, L+U is lenL+lenU, the number of subdiagonal elements in the columns of a lower triangular matrix and the number of diagonal and superdiagonal elements in the rows of an uppertriangular matrix. Further nonzeros are added to L when various columns of
B
$B$ are later replaced. As columns of
B
$B$ are replaced, the matrix
U
$U$ is maintained explicitly (in sparse form). The value of L will steadily increase, whereas the value of U may fluctuate up or down. Thus the value of L+U may fluctuate up or down (in general, it will tend to increase). 
ncp 
is the number of compressions required to recover storage in the data structure for
U
$U$. This includes the number of compressions needed during the previous basis factorization. 
nS 
is the current number of superbasic variables. (The heading is not printed if the problem is linear.) 
condHz 
see Section [Major Iteration Log]. (The heading is not printed if the problem is linear.) 
Crash Statistics
If
Major Print Level
≥
10
${\mathbf{Major\; Print\; Level}}\ge 10$ and
System Information Yes has been specified, the following items are output to the Print file when
Cold Start and no Backup Basis file is loaded. They refer to the number of columns that the Crash procedure selects during selected passes through
A
$A$ while searching for a triangular basis matrix.
Label 
Description 
Slacks 
is the number of slacks selected initially. 
Free cols 
is the number of free columns in the basis. 
Preferred 
is the number of ‘preferred’ columns in the basis (i.e.,
istate(j) = 3
${\mathbf{istate}}\left(j\right)=3$ for some
j ≤ n
$j\le n$). 
Unit 
is the number of unit columns in the basis. 
Double 
is the number of columns in the basis containing 2$2$ nonzeros. 
Triangle 
is the number of triangular columns in the basis. 
Pad 
is the number of slacks used to pad the basis (to make it a nonsingular triangle). 
Basis Factorization Statistics
If
Major Print Level
≥
10
${\mathbf{Major\; Print\; Level}}\ge 10$, the first seven items in the list below are output to the Print file whenever the basis
B
$B$ or the rectangular matrix
BS
=
(BS)
${B}_{S}={\left(\begin{array}{cc}B& S\end{array}\right)}^{\mathrm{T}}$ is factorized before solution of the next QP subproblem. See
Section [Description of the optional parameters] for a full description of an optional parameter.
Gaussian elimination is used to compute a sparse
LU
$LU$ factorization of
B
$B$ or
B_{S}
${B}_{S}$, where
PLP^{T}
$PL{P}^{\mathrm{T}}$ and
PUQ
$PUQ$ are lower and upper triangular matrices for some permutation matrices
P
$P$ and
Q
$Q$. Stability is ensured as described under the optional parameter
LU Factor Tolerance.
If
Minor Print Level
≥
10
${\mathbf{Minor\; Print\; Level}}\ge 10$, the same items are printed during the QP solution whenever the current
B
$B$ is factorized. In addition, if
System Information Yes has been specified, the entries from
Elems onwards are also printed.
Label 
Description 
Factor 
the number of factorizations since the start of the run. 
Demand 
a code giving the reason for the present factorization, as follows:
Code 
Meaning 
0 
First
LU
$LU$ factorization. 
1 
The number of updates reached the Factorization Frequency. 
2 
The nonzeros in the updated factors have increased significantly. 
7 
Not enough storage to update factors. 
10 
Row residuals too large (see the description of the optional parameter Check Frequency). 
11 
Illconditioning has caused inconsistent results. 

Itn 
is the current minor iteration number. 
Nonlin 
is the number of nonlinear variables in the current basis
B
$B$. 
Linear 
is the number of linear variables in
B
$B$. 
Slacks 
is the number of slack variables in
B
$B$. 
B BR BS or BT factorize 
is the type of
LU
$LU$ factorization.
B 
periodic factorization of the basis
B
$B$. 
BR 
more careful rankrevealing factorization of
B
$B$ using threshold rook pivoting. This occurs mainly at the start, if the first basis factors seem singular or illconditioned. Followed by a normal B factorize. 
BS 
B_{S}
${B}_{S}$ is factorized to choose a wellconditioned
B
$B$ from the current
(B S)
$\left(B\text{}S\right)$. Followed by a normal B factorize. 
BT 
same as BS except the current
B
$B$ is tried first and accepted if it appears to be not much more illconditioned than after the previous BS factorize. 

m 
is the number of rows in
B
$B$ or
B_{S}
${B}_{S}$. 
n 
is the number of columns in
B
$B$ or
B_{S}
${B}_{S}$. Preceded by ‘=’ or ‘>’ respectively. 
Elems 
is the number of nonzero elements in
B
$B$ or
B_{S}
${B}_{S}$. 
Amax 
is the largest nonzero in
B
$B$ or
B_{S}
${B}_{S}$. 
Density 
is the percentage nonzero density of
B
$B$ or
B_{S}
${B}_{S}$. 
Merit/MerRP/MerCP 
is the average Markowitz merit count for the elements chosen to be the diagonals of
PUQ
$PUQ$. Each merit count is defined to be
(c − 1)
(r − 1)
$(c1)(r1)$ where
c
$c$ and
r
$r$ are the number of nonzeros in the column and row containing the element at the time it is selected to be the next diagonal. Merit is the average of n such quantities. It gives an indication of how much work was required to preserve sparsity during the factorization. If LU Complete Pivoting or LU Rook Pivoting has been selected, this heading is changed to MerCP, respectively MerRP. 
lenL 
is the number of nonzeros in
L
$L$. 
L+U 
is the number of nonzeros representing the basis factors
L
$L$ and
U
$U$. Immediately after a basis factorization
B = LU
$B=LU$, L+U is lenL+lenU, the number of subdiagonal elements in the columns of a lower triangular matrix and the number of diagonal and superdiagonal elements in the rows of an uppertriangular matrix. Further nonzeros are added to L when various columns of
B
$B$ are later replaced. As columns of
B
$B$ are replaced, the matrix
U
$U$ is maintained explicitly (in sparse form). The value of L will steadily increase, whereas the value of U may fluctuate up or down. Thus the value of L+U may fluctuate up or down (in general, it will tend to increase). 
Cmpressns 
is the number of times the data structure holding the partially factored matrix needed to be compressed to recover unused storage. Ideally this number should be zero. If it is more than 3$3$ or 4$4$, the amount of workspace available to nag_opt_nlp2_solve (e04wd) should be increased for efficiency. 
Incres 
is the percentage increase in the number of nonzeros in
L
$L$ and
U
$U$ relative to the number of nonzeros in
B
$B$ or
B_{S}
${B}_{S}$. 
Utri 
is the number of triangular rows of
B
$B$ or
B_{S}
${B}_{S}$ at the top of
U
$U$. 
lenU 
the number of nonzeros in
U
$U$, including its diagonals. 
Ltol 
is the largest subdiagonal element allowed in
L
$L$. This is the specified LU Factor Tolerance or a smaller value that is currently being used for greater stability. 
Umax 
the maximum nonzero element in
U
$U$. 
Ugrwth 
is the ratio
Umax / Amax
$\mathtt{Umax}/\mathtt{Amax}$, which ideally should not be substantially larger than 10.0$10.0$ or 100.0$100.0$. If it is orders of magnitude larger, it may be advisable to reduce the LU Factor Tolerance to 5.0$5.0$, 4.0$4.0$, 3.0$3.0$ or 2.0$2.0$, say (but bigger than 1.0$1.0$).
As long as Lmax is not large (say 5.0$5.0$ or less),
max (Amax,Umax)
/
DUmin
$\mathrm{max}\phantom{\rule{0.125em}{0ex}}(\mathtt{Amax},\mathtt{Umax})/\mathtt{DUmin}$ gives an estimate of the condition number
B
$B$. If this is extremely large, the basis is nearly singular. Slacks are used to replace suspect columns of
B
$B$ and the modified basis is refactored. 
Ltri 
is the number of triangular columns of
B
$B$ or
B_{S}
${B}_{S}$ at the left of
L
$L$. 
dense1 
is the number of columns remaining when the density of the basis matrix being factorized reached 0.3$0.3$. 
Lmax 
is the actual maximum subdiagonal element in
L
$L$ (bounded by Ltol). 
Akmax 
is the largest nonzero generated at any stage of the
LU
$LU$ factorization. (Values much larger than Amax indicate instability.) Akmax is not printed if LU Partial Pivoting is selected. 
Agrwth 
is the ratio
Akmax / Amax
$\mathtt{Akmax}/\mathtt{Amax}$. Values much larger than 100$100$ (say) indicate instability. Growth is not printed if LU Partial Pivoting is selected. 
bump 
is the size of the block to be factorized nontrivially after the triangular rows and columns of
B
$B$ or
B_{S}
${B}_{S}$ have been removed. 
dense2 
is the number of columns remaining when the density of the basis matrix being factorized reached 0.6$0.6$. (The Markowitz pivot strategy searches fewer columns at that stage.) 
DUmax 
is the largest diagonal of
PUQ
$PUQ$. 
DUmin 
is the smallest diagonal of
PUQ
$PUQ$. 
condU 
the ratio
DUmax / DUmin
$\mathtt{DUmax}/\mathtt{DUmin}$, which estimates the condition number of
U
$U$ (and of
B
$B$ if Ltol is less than 5.0$5.0$, say). 
The Solution File
At the end of a run, the final solution may be output as a Solution file, according to
Solution File. Some header information appears first to identify the problem and the final state of the optimization procedure. A ROWS section and a COLUMNS section then follow, giving one line of information for each row and column. The format used is similar to certain commercial systems, though there is no industry standard.
In general, numerical values are output with format f16.5.
The maximum record length is 111$111$ characters, including the first (carriagecontrol) character.
To reduce clutter, a full stop (.) is printed for any numerical value that is exactly zero. The values
± 1
$\pm 1$ are also printed specially as
1.0
$1.0$ and
− 1.0
$1.0$. Infinite bounds (
±
10^{20}
$\pm {10}^{20}$ or larger) are printed as None.
A Solution file is intended to be read from disk by a selfcontained program that extracts and saves certain values as required for possible further computation. Typically, the first 14$14$ records would be ignored. Each subsequent record may be read
. The end of the ROWS section is marked by a record that starts with a 1$1$ and is otherwise blank. If this and the next 4$4$ records are skipped, the COLUMNS section can then be read under the same format.
The ROWS section
General linear constraints take the form
l
≤
Ax
≤
u
$l\le Ax\le u$. The
i
$i$th constraint is therefore of the form
where
ν_{i}
${\nu}_{i}$ is the
i
$i$th row of
A
$A$.
Internally, the constraints take the form
Ax
−
s
=
0
$Axs=0$, where
s
$s$ is the set of slack variables (which happen to satisfy the bounds
l
≤
s
≤
u
$l\le s\le u$). For the
i
$i$th constraint it is the slack variable
s_{i}
${s}_{i}$ that is directly available, and it is sometimes convenient to refer to its state. Nonlinear constraints
α ≤
c_{i}(x) +
v_{i}x ≤
β
$\alpha \le {c}_{i}\left(x\right)+{v}_{i}x\le \beta $ are treated similarly, except that the row activity and degree of infeasibility are computed directly from
c_{i}(x)
+
v_{i}x
${c}_{i}\left(x\right)+{v}_{i}x$ rather than
s_{i}
${s}_{i}$. A fullstop (.) is printed for any numerical value that is exactly zero.
Label 
Description 
Number 
is the value of n + i$n+i$. (This is used internally to refer to s_{i}${s}_{i}$ in the intermediate output.)

Row 
gives the name of the i$i$th row.

State 
the state of the i$i$th row relative to the bounds
α
$\alpha $ and
β
$\beta $. The various states possible are as follows:
LL 
the row is at its lower limit,
α
$\alpha $. 
UL 
the row is at its upper limit,
β
$\beta $. 
EQ 
the limits are the same (
α = β
$\alpha =\beta $). 
FR 
s_{i}
${s}_{i}$ is nonbasic and currently zero, even though it is free to take any value between its bounds
α
$\alpha $ and
β
$\beta $. 
BS 
s_{i}
${s}_{i}$ is basic. 
SBS 
s_{i}
${s}_{i}$ is superbasic. 
A key is sometimes printed before State.
Note that unless the optional parameter Scale Option = 0${\mathbf{Scale\; Option}}=0$ is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A 
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.

D 
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.

I 
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.

N 
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Major Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible. 

Activity 
is the value of v_{i}x${v}_{i}x$ (or
c_{i}(x)
+
v_{i}x
${c}_{i}\left(x\right)+{v}_{i}x$ for nonlinear rows) at the final iterate. 
Slack Activity 
is the value by which the row differs from its nearest bound. (For the free row (if any), it is set to Activity.)

Lower Limit 
is α$\alpha $, the lower bound on the row. 
Upper Limit 
is β$\beta $, the upper bound on the row. 
Dual Activity 
is the value of the dual variable π_{i}${\pi}_{i}$ (the Lagrange multiplier for the
i
$i$th constraint). The full vector
π
$\pi $ always satisfies
B^{T}π
=
g_{B}
${B}^{\mathrm{T}}\pi ={g}_{B}$, where
B
$B$ is the current basis matrix and
g_{B}
${g}_{B}$ contains the associated gradients for the current objective function. For FP problems, π_{i}${\pi}_{i}$ is set to zero. 
i 
gives the index i$i$ of the i$i$th row.

The COLUMNS section
Let the
j
$j$th component of
x
$x$ be the variable
x_{j}
${x}_{j}$ and assume that it satisfies the bounds
α
≤
x_{j}
≤
β
$\alpha \le {x}_{j}\le \beta $. A fullstop (.) is printed for any numerical value that is exactly zero.
Label 
Description 
Number 
is the column number j$j$. (This is used internally to refer to x_{j}${x}_{j}$ in the intermediate output.)

Column 
gives the name of x_{j}${x}_{j}$.

State 
the state of
x_{j}
${x}_{j}$ relative to the bounds
α
$\alpha $ and
β
$\beta $. The various states possible are as follows:
LL 
x_{j}
${x}_{j}$ is nonbasic at its lower limit,
α
$\alpha $. 
UL 
x_{j}
${x}_{j}$ is nonbasic at its upper limit,
β
$\beta $. 
EQ 
x_{j}
${x}_{j}$ is nonbasic and fixed at the value
α
=
β
$\alpha =\beta $. 
FR 
x_{j}
${x}_{j}$ is nonbasic at some value strictly between its bounds:
α < x_{j} < β
$\alpha <{x}_{j}<\beta $. 
BS 
x_{j}
${x}_{j}$ is basic. Usually
α < x_{j} < β
$\alpha <{x}_{j}<\beta $. 
SBS 
x_{j}
${x}_{j}$ is superbasic. Usually
α < x_{j} < β
$\alpha <{x}_{j}<\beta $. 
A key is sometimes printed before State.
Note that unless the optional parameter Scale Option = 0${\mathbf{Scale\; Option}}=0$ is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A 
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.

D 
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.

I 
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.

N 
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Major Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible. 

Activity 
is the value of x_{j}${x}_{j}$ at the final iterate.

Obj Gradient 
is the value of g_{j}${g}_{j}$ at the final iterate. For FP problems, g_{j}${g}_{j}$ is set to zero.

Lower Limit 
is the lower bound specified for the variable. None indicates that bl(j) ≤ − bigbnd${\mathbf{bl}}\left(j\right)\le \mathit{bigbnd}$. 
Upper Limit 
is the upper bound specified for the variable. None indicates that bu(j) ≥ bigbnd${\mathbf{bu}}\left(j\right)\ge \mathit{bigbnd}$. 
Reduced Gradnt 
is the value of the reduced gradient
d_{j}
=
g_{j}
−
π^{T}
a_{j}
${d}_{j}={g}_{j}{\pi}^{\mathrm{T}}{a}_{j}$ where
a_{j}
${a}_{j}$ is the
j
$j$th column of the constraint matrix. For FP problems, d_{j}${d}_{j}$ is set to zero. 
m + j 
is the value of m + j$m+j$.

Note that movement off a constraint (as opposed to a variable moving away from its bound) can be interpreted as allowing the entry in the Slack Activity column to become positive.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
The Summary File
If
Summary File
>
0
${\mathbf{Summary\; File}}>0$,
the following information is output to the
unit number associated with
Summary File. (It is a brief summary of the output directed to unit
Print File):
PDF version (NAG web site
, 64bit version, 64bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013