e04unc is designed to minimize an arbitrary smooth sum of squares 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.
e04unc may also be used for unconstrained, bound-constrained and linearly constrained optimization.
The function may be called by the names: e04unc or nag_opt_nlin_lsq.
3Description
e04unc is designed to solve the nonlinear least squares programming problem – the minimization of a smooth nonlinear sum of squares function subject to a set of constraints on the variables. The problem is assumed to be stated in the following form:
where $F\left(x\right)$ (the objective function) is a nonlinear function which can be represented as the sum of squares of $m$ subfunctions $({y}_{1}-{f}_{1}\left(x\right)),({y}_{2}-{f}_{2}\left(x\right)),\dots ,({y}_{m}-{f}_{m}\left(x\right))$, the ${y}_{i}$ are constant, ${A}_{L}$ is an ${n}_{L}\times n$ constant matrix, and $c\left(x\right)$ is an ${n}_{N}$ element vector of nonlinear constraint functions. (The matrix ${A}_{L}$ and the vector $c\left(x\right)$ may be empty.) The objective function and the constraint functions are assumed to be smooth, i.e., at least twice-continuously differentiable. (The method of e04unc will usually solve (1) if there are only isolated discontinuities away from the solution.)
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 can be specified by setting ${l}_{i}={u}_{i}$. If certain bounds are not present, the associated elements of $l$ or $u$ can be set to special values that will be treated as $-\infty $ or $+\infty $. (See the description of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ in Section 12.2.)
If there are no nonlinear constraints in (1) and $F$ is linear or quadratic, then one of e04mfc, e04ncc or e04nfc will generally be more efficient.
You must supply an initial estimate of the solution to (1), together with functions that define $f\left(x\right)={({f}_{1}\left(x\right),{f}_{2}\left(x\right),\dots ,{f}_{m}\left(x\right))}^{\mathrm{T}},c\left(x\right)$ and as many first partial derivatives as possible; unspecified derivatives are approximated by finite differences.
The subfunctions are defined by the array y and function objfun, and the nonlinear constraints are defined by the function confun. On every call, these functions must return appropriate values of $f\left(x\right)$ and $c\left(x\right)$. You should also provide the available partial derivatives. Any unspecified derivatives are approximated by finite differences; see Section 12.2 for a discussion of the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}$. Just before either objfun or confun is called, each element of the current gradient array fjac or conjac is initialized to a special value. On exit, any element that retains the value is estimated by finite differences. 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 the functions objfun and confun, the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ (see Section 12.2) should be used to check the calculation of any known gradients.
4References
Dennis J E Jr and Moré J J (1977) Quasi-Newton methods, motivation and theory SIAM Rev.19 46–89
Dennis J E Jr and Schnabel R B (1981) A new derivation of symmetric positive-definite secant updates nonlinear programming (eds O L Mangasarian, R R Meyer and S M Robinson) 4 167–199 Academic Press
Dennis J E Jr and Schnabel R B (1983) Numerical Methods for Unconstrained Optimization and Nonlinear Equations Prentice–Hall
Fletcher R (1987) Practical Methods of Optimization (2nd Edition) Wiley
Gill P E, Hammarling S, Murray W, Saunders M A and Wright M H (1986) Users' guide for LSSOL (Version 1.0) Report SOL 86-1 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1983) Documentation for FDCALC and FDCORE Technical Report SOL 83–6 Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1984) Users' Guide for SOL/QPSOL Version 3.2 Report SOL 84–5 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1986a) Some theoretical properties of an augmented Lagrangian merit function Report SOL 86–6R Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1986b) Users' guide for NPSOL (Version 4.0): a Fortran package for nonlinear programming Report SOL 86-2 Department of Operations Research, Stanford University
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 Systems187 Springer–Verlag
Powell M J D (1974) Introduction to constrained optimization Numerical Methods for Constrained Optimization (eds P E Gill and W Murray) 1–28 Academic Press
Powell M J D (1983) Variable metric methods in constrained optimization Mathematical Programming: the State of the Art (eds A Bachem, M Grötschel and B Korte) 288–311 Springer–Verlag
5Arguments
1: $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of subfunctions associated with $F\left(x\right)$.
Constraint:
${\mathbf{m}}>0$.
2: $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of variables.
Constraint:
${\mathbf{n}}>0$.
3: $\mathbf{nclin}$ – IntegerInput
On entry: ${n}_{L}$, the number of general linear constraints.
Constraint:
${\mathbf{nclin}}\ge 0$.
4: $\mathbf{ncnlin}$ – IntegerInput
On entry: ${n}_{N}$, the number of nonlinear constraints.
Note: the $(i,j)$th element of the matrix $A$ is stored in ${\mathbf{a}}\left[(i-1)\times {\mathbf{tda}}+j-1\right]$.
On entry: the $\mathit{i}$th row of a must contain the coefficients of the $\mathit{i}$th general linear constraint (the $\mathit{i}$th row of the matrix ${A}_{L}$ in (1)), for $\mathit{i}=1,2,\dots ,{n}_{L}$.
If ${\mathbf{nclin}}=0$ then the array a is not referenced.
6: $\mathbf{tda}$ – IntegerInput
On entry: the stride separating matrix column elements in the array a.
Constraint:
if ${\mathbf{nclin}}>0$, ${\mathbf{tda}}\ge {\mathbf{n}}$
On entry: bl must contain the lower bounds and bu the upper bounds, for all the constraints in the following order. The first $n$ elements of each array must contain the bounds on the variables, the next ${n}_{L}$ elements the bounds for the general linear constraints (if any), and the next ${n}_{N}$ elements the bounds for the nonlinear constraints (if any). To specify a nonexistent lower bound (i.e., ${l}_{j}=-\infty $), set ${\mathbf{bl}}\left[j-1\right]\le -{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, and to specify a nonexistent upper bound (i.e., ${u}_{j}=+\infty $), set ${\mathbf{bu}}\left[j-1\right]\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, where ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is one of the optional parameters (default value ${10}^{20}$, see Section 12.2). To specify the $j$th constraint as an equality, set ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta $, say, where $\left|\beta \right|<{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
Constraints:
${\mathbf{bl}}\left[\mathit{j}-1\right]\le {\mathbf{bu}}\left[\mathit{j}-1\right]$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$;
if ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]=\beta $, $\left|\beta \right|<{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
On entry: the coefficients of the constant vector $y$ in the objective function.
10: $\mathbf{objfun}$ – function, supplied by the userExternal Function
objfun must calculate the vector $f\left(x\right)$ of subfunctions and (optionally) its Jacobian ($\text{}=\frac{\partial f}{\partial x}$) for a specified $n$ element vector $x$.
On exit: if $\mathbf{comm}\mathbf{\to}\mathbf{flag}=0$ or $2$, objfun must set ${\mathbf{f}}\left[i-1\right]$ to the value of the $i$th subfunction ${f}_{i}$ at the current point $x$, for some or all $i=1,2,\dots ,m$ (see the description of the argument $\mathbf{comm}\mathbf{\to}\mathbf{needf}$ below).
On exit: if $\mathbf{comm}\mathbf{\to}\mathbf{flag}=2$, objfun must contain the available elements of the subfunction Jacobian matrix. ${\mathbf{fjac}}\left[(\mathit{i}-1)\times {\mathbf{tdfjac}}+\mathit{j}-1\right]$ must be set to the value of the first derivative $\frac{\partial {f}_{\mathit{i}}}{\partial {x}_{\mathit{j}}}$ at the current point $x$, for $\mathit{i}=1,2,\dots ,m$ and $\mathit{j}=1,2,\dots ,n$.
If the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}=\mathrm{Nag\_TRUE}$ (the default), all elements of fjac must be set; if ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}=\mathrm{Nag\_FALSE}$, any available elements of the Jacobian matrix must be assigned to the elements of fjac; the remaining elements must remain unchanged.
Any constant elements of fjac may be assigned once only at the first call to objfun, i.e., when $\mathbf{comm}\mathbf{\to}\mathbf{first}=\mathrm{Nag\_TRUE}$. This is only effective if the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}=\mathrm{Nag\_TRUE}$.
6: $\mathbf{tdfjac}$ – IntegerInput
On entry: the stride separating matrix column elements in the array fjac.
7: $\mathbf{comm}$ – Nag_Comm*
Pointer to structure of type Nag_Comm; the following members are relevant to objfun.
flag – IntegerInput/Output
On entry: objfun is called with $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ set to 0 or 2.
If $\mathbf{comm}\mathbf{\to}\mathbf{flag}=0$, then only f is referenced.
If $\mathbf{comm}\mathbf{\to}\mathbf{flag}=2$, then both f and fjac are referenced.
On exit: if objfun resets $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ to some negative number then e04unc will terminate immediately with the error indicator NE_USER_STOP. If fail is supplied to e04unc, ${\mathbf{fail}}\mathbf{.}\mathbf{errnum}$ will be set to your setting of $\mathbf{comm}\mathbf{\to}\mathbf{flag}$.
first – Nag_BooleanInput
On entry: will be set to Nag_TRUE on the first call to objfun and Nag_FALSE for all subsequent calls.
nf – IntegerInput
On entry: the number of evaluations of the objective function; this value will be equal to the number of calls made to objfun including the current one.
needf – IntegerInput
On entry: if $\mathbf{comm}\mathbf{\to}\mathbf{needf}=0$, objfun must set, for all $i=1,2,\dots ,m$, ${\mathbf{f}}\left[\mathit{i}-1\right]$ to the value of the $\mathit{i}$th subfunction ${f}_{\mathit{i}}$ at the current point $x$. If $\mathbf{comm}\mathbf{\to}\mathbf{needf}=\mathit{i}$, for $\mathit{i}=1,2,\dots ,m$, then it is sufficient to set ${\mathbf{f}}\left[i-1\right]$ to the value of the $i$th subfunction ${f}_{i}$. Appropriate use of $\mathbf{comm}\mathbf{\to}\mathbf{needf}$ can save a lot of computational work in some cases. Note that when $\mathbf{comm}\mathbf{\to}\mathbf{needf}\ne 0$, $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ will always be $0$, hence this does not apply to the Jacobian matrix.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void * with a C compiler that defines void * and char * otherwise.
Before calling e04unc these pointers may be allocated memory and initialized with various quantities for use by objfun when called from e04unc.
Note:objfun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by e04unc. If your code inadvertently does return any NaNs or infinities, e04unc is likely to produce unexpected results.
Note:objfun should be tested separately before being used in conjunction with e04unc. The optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ can be used to assist this process. The array x must not be changed by objfun.
If the function objfun does not calculate all of the Jacobian elements then the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}$ should be set to Nag_FALSE.
11: $\mathbf{confun}$ – function, supplied by the userExternal Function
confun must calculate the vector $c\left(x\right)$ of nonlinear constraint functions and (optionally) its Jacobian ($\text{}=\frac{\partial c}{\partial x}$) for a specified $n$ element vector $x$. If there are no nonlinear constraints (i.e., ${\mathbf{ncnlin}}=0$), confun will never be called and the NAG defined null void function pointer, NULLFN, can be supplied in the call to e04unc. If there are nonlinear constraints the first call to confun will occur before the first call to objfun.
On entry: the indices of the elements of conf and/or conjac that must be evaluated by confun. If ${\mathbf{needc}}\left[i-1\right]>0$ then the $i$th element of conf and/or the available elements of the $i$th row of conjac (see argument $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ below) must be evaluated at $x$.
On exit: if ${\mathbf{needc}}\left[i-1\right]>0$ and $\mathbf{comm}\mathbf{\to}\mathbf{flag}=0$ or $2$, ${\mathbf{conf}}\left[i-1\right]$ must contain the value of the $i$th constraint at $x$. The remaining elements of conf, corresponding to the non-positive elements of needc, are ignored.
On exit: if ${\mathbf{needc}}\left[i-1\right]>0$ and $\mathbf{comm}\mathbf{\to}\mathbf{flag}=2$, the $i$th row of conjac (i.e., the elements ${\mathbf{conjac}}\left[(i-1)\times {\mathbf{n}}+\mathit{j}-1\right]$, for $\mathit{j}=1,2,\dots ,n$) must contain the available elements of the vector $\nabla {c}_{i}$ given by
where $\frac{\partial {c}_{i}}{\partial {x}_{j}}$ is the partial derivative of the $i$th constraint with respect to the $j$th variable, evaluated at the point $x$. The remaining rows of conjac, corresponding to non-positive elements of needc, are ignored.
If the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_TRUE}$ (the default), all elements of conjac must be set; if ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_FALSE}$, then any available partial derivatives of ${c}_{i}\left(x\right)$ must be assigned to the elements of conjac; the remaining elements must remain unchanged.
If all elements of the constraint Jacobian are known (i.e., ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_TRUE}$; see Section 12.2), any constant elements may be assigned to conjac one time only at the start of the optimization. An element of conjac that is not subsequently assigned in confun will retain its initial value throughout. Constant elements may be loaded into conjac during the first call to confun. The ability to preload constants is useful when many Jacobian elements are identically zero, in which case conjac may be initialized to zero at the first call when $\mathbf{comm}\mathbf{\to}\mathbf{first}=\mathrm{Nag\_TRUE}$.
It must be emphasized that, if ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_FALSE}$, unassigned elements of conjac are not treated as constant; they are estimated by finite differences, at non-trivial expense. If you do not supply a value for the optional argument ${\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}$ (the default; see Section 12.2), an interval for each element of $x$ is computed automatically at the start of the optimization. The automatic procedure can usually identify constant elements of conjac, which are then computed once only by finite differences.
7: $\mathbf{comm}$ – Nag_Comm*
Pointer to structure of type Nag_Comm; the following members are relevant to confun.
flag – IntegerInput/Output
On entry: confun is called with $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ set to 0 or 2.
If $\mathbf{comm}\mathbf{\to}\mathbf{flag}=0$, only conf is referenced.
If $\mathbf{comm}\mathbf{\to}\mathbf{flag}=2$, both conf and conjac are referenced.
On exit: if confun resets $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ to some negative number then e04unc will terminate immediately with the error indicator NE_USER_STOP. If fail is supplied to e04unc, ${\mathbf{fail}}\mathbf{.}\mathbf{errnum}$ will be set to your setting of $\mathbf{comm}\mathbf{\to}\mathbf{flag}$.
first – Nag_BooleanInput
On entry: will be set to Nag_TRUE on the first call to confun and Nag_FALSE for all subsequent calls.
user – double *
iuser – Integer *
p – Pointer
The type Pointer will be void * with a C compiler that defines void * and char * otherwise.
Before calling e04unc these pointers may be allocated memory and initialized with various quantities for use by confun when called from e04unc.
Note:confun should not return floating-point NaN (Not a Number) or infinity values, since these are not handled by e04unc. If your code inadvertently does return any NaNs or infinities, e04unc is likely to produce unexpected results.
Note:confun should be tested separately before being used in conjunction with e04unc. The optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ can be used to assist this process. The array x must not be changed by confun.
If confun does not calculate all of the Jacobian constraint elements then the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}$ should be set to Nag_FALSE.
On exit: the Jacobian matrix of the functions ${f}_{1},{f}_{2},\dots ,{f}_{m}$ at the final iterate, i.e., ${\mathbf{fjac}}\left[\left(\mathit{i}-1\right)\times {\mathbf{tdfjac}}+\mathit{j}-1\right]$ contains the partial derivative of the $\mathit{i}$th subfunction with respect to the $\mathit{j}$th variable, for $\mathit{i}=1,2,\dots ,{\mathbf{m}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{n}}$. (See also the discussion of argument fjac under objfun.)
16: $\mathbf{tdfjac}$ – IntegerInput
On entry: the stride separating matrix column elements in the array fjac.
On entry/exit: a pointer to a structure of type Nag_E04_Opt whose members are optional parameters for e04unc. These structure members offer the means of adjusting some of the argument values of the algorithm and on output will supply further details of the results. A description of the members of options is given below in Section 12. Some of the results returned in options can be used by e04unc to perform a ‘warm start’ (see the member ${\mathbf{options}}\mathbf{.}{\mathbf{start}}$ in Section 12.2).
If any of these optional parameters are required then the structure options should be declared and initialized by a call to e04xxc and supplied as an argument to e04unc. However, if the optional parameters are not required the NAG defined null pointer, E04_DEFAULT, can be used in the function call.
Note:comm is a NAG defined type (see Section 3.1.1 in the Introduction to the NAG Library CL Interface).
On entry/exit: structure containing pointers for communication to the user-supplied functions objfun and confun, and the optional user-defined printing function; see the description of objfun and confun and Section 12.3.1 for details. If you do not need to make use of this communication feature the null pointer NAGCOMM_NULL may be used in the call to e04unc; comm will then be declared internally for use in calls to user-supplied functions.
19: $\mathbf{fail}$ – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
NE_2_INT_ARG_LT
On entry, ${\mathbf{tda}}=\u27e8\mathit{\text{value}}\u27e9$ while ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$. These arguments must satisfy ${\mathbf{tda}}\ge {\mathbf{n}}$.
This error message is output only if ${\mathbf{nclin}}>0$.
NE_2_INT_OPT_ARG_CONS
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$ while ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}\le {\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$ while ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}\le {\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}$.
NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{start}}$ had an illegal value.
On entry, argument ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ had an illegal value.
NE_BOUND
The lower bound for variable $\u27e8\mathit{\text{value}}\u27e9$ (array element ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) is greater than the upper bound.
NE_BOUND_EQ
The lower bound and upper bound for variable $\u27e8\mathit{\text{value}}\u27e9$ (array elements ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$ and ${\mathbf{bu}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) are equal but they are greater than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
NE_BOUND_EQ_LCON
The lower bound and upper bound for linear constraint $\u27e8\mathit{\text{value}}\u27e9$ (array elements ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$ and ${\mathbf{bu}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) are equal but they are greater than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
NE_BOUND_EQ_NLCON
The lower bound and upper bound for nonlinear constraint $\u27e8\mathit{\text{value}}\u27e9$ (array elements ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$ and ${\mathbf{bu}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) are equal but they are greater than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$.
NE_BOUND_LCON
The lower bound for linear constraint $\u27e8\mathit{\text{value}}\u27e9$ (array element ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) is greater than the upper bound.
NE_BOUND_NLCON
The lower bound for nonlinear constraint $\u27e8\mathit{\text{value}}\u27e9$ (array element ${\mathbf{bl}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$) is greater than the upper bound.
NE_DERIV_ERRORS
Large errors were found in the derivatives of the objective function and/or nonlinear constraints.
This failure will occur if the verification process indicated that at least one gradient or Jacobian element had no correct figures. You should refer to the printed output to determine which elements are suspected to be in error.
As a first-step, you should check that the code for the objective and constraint values is correct – for example, by computing the function at a point where the correct value is known. However, care should be taken that the chosen point fully tests the evaluation of the function. It is remarkable how often the values $x=0$ or $x=1$ are used to test function evaluation procedures, and how often the special properties of these numbers make the test meaningless.
Errors in programming the function may be quite subtle in that the function value is ‘almost’ correct. For example, the function may not be accurate to full precision because of the inaccurate calculation of a subsidiary quantity, or the limited accuracy of data upon which the function depends. A common error on machines where numerical calculations are usually performed in double precision is to include even one single precision constant in the calculation of the function; since some compilers do not convert such constants to double precision, half the correct figures may be lost by such a seemingly trivial error.
NE_INT_ARG_LT
On entry, ${\mathbf{m}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{m}}\ge 1$.
On entry, ${\mathbf{n}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{n}}\ge 1$.
On entry, ${\mathbf{nclin}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{nclin}}\ge 0$.
On entry, ${\mathbf{ncnlin}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{ncnlin}}\ge 0$.
NE_INT_OPT_ARG_GT
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}\le {\mathbf{n}}$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}\le {\mathbf{n}}$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}\le {\mathbf{n}}$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}\le {\mathbf{n}}$.
NE_INT_OPT_ARG_LT
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}\ge 1$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}\ge 1$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}\ge 1$.
On entry, ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}=\u27e8\mathit{\text{value}}\u27e9$.
Constraint: ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}\ge 1$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
NE_INVALID_INT_RANGE_1
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{h\_reset\_freq}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{h\_reset\_freq}}>0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}\ge 0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_max\_iter}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_max\_iter}}\ge 0$.
NE_INVALID_REAL_RANGE_EF
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{c\_diff\_int}}$ not valid. Correct range is $\epsilon \le {\mathbf{options}}\mathbf{.}{\mathbf{c\_diff\_int}}<1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}$ not valid. Correct range is $\epsilon \le {\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}<1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{f\_prec}}$ not valid. Correct range is $\epsilon \le {\mathbf{options}}\mathbf{.}{\mathbf{f\_prec}}<1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ not valid. Correct range is $\epsilon \le {\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}<1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$ not valid. Correct range is $\epsilon \le {\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}<1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{f\_prec}}\le {\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}<1.0$.
NE_INVALID_REAL_RANGE_F
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}>0.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_step}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_step}}>0.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ not valid. Correct range is ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}>0.0$.
NE_INVALID_REAL_RANGE_FF
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}$ not valid. Correct range is $0.0\le {\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}\le 1.0$.
Value $\u27e8\mathit{\text{value}}\u27e9$ given to ${\mathbf{options}}\mathbf{.}{\mathbf{linesearch\_tol}}$ not valid. Correct range is $0.0\le {\mathbf{options}}\mathbf{.}{\mathbf{linesearch\_tol}}<1.0$.
NE_NOT_APPEND_FILE
Cannot open file $\u27e8\mathit{string}\u27e9$ for appending.
NE_NOT_CLOSE_FILE
Cannot close file $\u27e8\mathit{string}\u27e9$.
NE_OPT_NOT_INIT
Options structure not initialized.
NE_STATE_VAL
${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[\u27e8\mathit{\text{value}}\u27e9\right]$ is out of range. ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[\u27e8\mathit{\text{value}}\u27e9\right]=\u27e8\mathit{\text{value}}\u27e9$.
NE_USER_STOP
This exit occurs if you set $\mathbf{comm}\mathbf{\to}\mathbf{flag}$ to a negative value in objfun or confun. If fail is supplied, the value of ${\mathbf{fail}}\mathbf{.}\mathbf{errnum}$ will be the same as your setting of $\mathbf{comm}\mathbf{\to}\mathbf{flag}$.
User requested termination, user flag value $\text{}=\u27e8\mathit{\text{value}}\u27e9$.
NW_KT_CONDITIONS
The current point cannot be improved upon. The final point does not satisfy the first-order Kuhn–Tucker conditions and no improved point for the merit function could be found during the final line search.
The Kuhn–Tucker conditions are specified and the merit function described in Sections 11.1 and 11.3.
This sometimes occurs because an overly stringent accuracy has been requested, i.e., the value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ (default value $\text{}={\epsilon}_{r}^{0.8}$, where ${\epsilon}_{r}$ is the relative precision of $F\left(x\right)$; see Section 12.2) is too small. In this case you should apply the four tests described in Section 9.1 to determine whether or not the final solution is acceptable (see Gill et al. (1981)), for a discussion of the attainable accuracy).
If many iterations have occurred in which essentially no progress has been made and e04unc has failed completely to move from the initial point then functions objfun and/or confun may be incorrect. You should refer to comments below under ${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NE\_DERIV\_ERRORS}}$ and check the gradients using the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ (default value ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_SimpleCheck}$; see Section 12.2). Unfortunately, there may be small errors in the objective and constraint gradients that cannot be detected by the verification process. Finite difference approximations to first derivatives are catastrophically affected by even small inaccuracies. An indication of this situation is a dramatic alteration in the iterates if the finite difference interval is altered. One might also suspect this type of error if a switch is made to central differences even when Norm Gz and Violtn (see Section 12.3) are large.
Another possibility is that the search direction has become inaccurate because of ill conditioning in the Hessian approximation or the matrix of constraints in the working set; either form of ill conditioning tends to be reflected in large values of Mnr (the number of iterations required to solve each QP subproblem; see Section 12.3).
If the condition estimate of the projected Hessian (Cond Hz; see Section 12.3) is extremely large, it may be worthwhile rerunning e04unc from the final point with the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ (see Section 12.2). In this situation, the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$ should be left unaltered and $R$ (in optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$) should be reset to the identity matrix.
If the matrix of constraints in the working set is ill conditioned (i.e., Cond T is extremely large; see Section 12.3), it may be helpful to run e04unc with a relaxed value of the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$ (default values $\sqrt{\epsilon}$, and ${\epsilon}^{0.33}$ or $\sqrt{\epsilon}$, respectively, where $\epsilon $ is the machine precision; see Section 12.2). (Constraint dependencies are often indicated by wide variations in size in the diagonal elements of the matrix $T$, whose diagonals will be printed if the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter\_Full}$ (default value ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter}$; see Section 12.2).)
NW_LIN_NOT_FEASIBLE
No feasible point was found for the linear constraints and bounds.
e04unc has terminated without finding a feasible point for the linear constraints and bounds, which means that either no feasible point exists for the given value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ (default value $\text{}=\sqrt{\epsilon}$, where $\epsilon $ is the machine precision; see Section 12.2), or no feasible point could be found in the number of iterations specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_max\_iter}}$ (default value $\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(50,3(n+{n}_{L}+{n}_{N}))$; see Section 12.2). You should check that there are no constraint redundancies. If the data for the constraints are accurate only to an absolute precision $\sigma $, you should ensure that the value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ is greater than $\sigma $. For example, if all elements of ${A}_{L}$ are of order unity and are accurate to only three decimal places, ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ should be at least ${10}^{\mathrm{-3}}$.
NW_NONLIN_NOT_FEASIBLE
No feasible point could be found for the nonlinear constraints.
The problem may have no feasible solution. This means that there has been a sequence of QP subproblems for which no feasible point could be found (indicated by I at the end of each terse line of output; see Section 12.3). This behaviour will occur if there is no feasible point for the nonlinear constraints. (However, there is no general test that can determine whether a feasible point exists for a set of nonlinear constraints.) If the infeasible subproblems occur from the very first major iteration, it is highly likely that no feasible point exists. If infeasibilities occur when earlier subproblems have been feasible, small constraint inconsistencies may be present. You should check the validity of constraints with negative values of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$. If you are convinced that a feasible point does exist, e04unc should be restarted at a different starting point.
NW_NOT_CONVERGED
Optimal solution found, but the sequence of iterates has not converged with the requested accuracy.
The final iterate $x$ satisfies the first-order Kuhn–Tucker conditions to the accuracy requested, but the sequence of iterates has not yet converged. e04unc was terminated because no further improvement could be made in the merit function (see Section 11).
This value of fail may occur in several circumstances. The most common situation is that you ask for a solution with accuracy that is not attainable with the given precision of the problem (as specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{f\_prec}}$ (default value $\text{}={\epsilon}^{0.9}$, where $\epsilon $ is the machine precision; see Section 12.2). This condition will also occur if, by chance, an iterate is an ‘exact’ Kuhn–Tucker point, but the change in the variables was significant at the previous iteration. (This situation often happens when minimizing very simple functions, such as quadratics.)
If the four conditions listed in Section 9.1 are satisfied then $x$ is likely to be a solution of (1) even if ${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NW\_NOT\_CONVERGED}}$.
NW_OVERFLOW_WARN
Serious ill conditioning in the working set after adding constraint $\u27e8\mathit{\text{value}}\u27e9$. Overflow may occur in subsequent iterations.
If overflow occurs preceded by this warning then serious ill conditioning has probably occurred in the working set when adding a constraint. It may be possible to avoid the difficulty by increasing the magnitude of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ (default value $\text{}=\sqrt{\epsilon}$, where $\epsilon $ is the machine precision; see Section 12.2) and/or the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$ (default value ${\epsilon}^{0.33}$ or $\sqrt{\epsilon}$; see Section 12.2), and rerunning the program. If the message recurs even after this change, the offending linearly dependent constraint $j$ must be removed from the problem. If overflow occurs in one of the user-supplied functions (e.g., if the nonlinear functions involve exponentials or singularities), it may help to specify tighter bounds for some of the variables (i.e., reduce the gap between the appropriate ${l}_{j}$ and ${u}_{j}$).
NW_TOO_MANY_ITER
The maximum number of iterations, $\u27e8\mathit{\text{value}}\u27e9$, have been performed.
The value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ may be too small. If the method appears to be making progress (e.g., the objective function is being satisfactorily reduced), increase the value of ${\mathbf{options}}\mathbf{.}{\mathbf{max\_iter}}$ and rerun e04unc; alternatively, rerun e04unc, setting the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ to specify the initial working set. If the algorithm seems to be making little or no progress, however, then you should check for incorrect gradients or ill conditioning as described below under ${\mathbf{fail}}\mathbf{.}\mathbf{code}={\mathbf{NW\_KT\_CONDITIONS}}$.
Note that ill conditioning in the working set is sometimes resolved automatically by the algorithm, in which case performing additional iterations may be helpful. However, ill conditioning in the Hessian approximation tends to persist once it has begun, so that allowing additional iterations without altering $R$ is usually inadvisable. If the quasi-Newton update of the Hessian approximation was reset during the latter iterations (i.e., an R occurs at the end of each terse line; see Section 12.3), it may be worthwhile setting ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ and calling e04unc from the final point.
7Accuracy
If ${\mathbf{fail}}\mathbf{.}\mathbf{code}=\mathrm{NE\_NOERROR}$ on exit, then the vector returned in the array x is an estimate of the solution to an accuracy of approximately ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ (default value $\text{}={\epsilon}_{r}^{0.8}$, where ${\epsilon}_{r}$ is the relative precision of $F\left(x\right)$; see Section 12.2).
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e04unc is not threaded in any implementation.
9Further Comments
9.1Termination Criteria
The function exits with ${\mathbf{fail}}\mathbf{.}\mathbf{code}=\mathrm{NE\_NOERROR}$ if iterates have converged to a point $x$ that satisfies the Kuhn–Tucker conditions (see Section 11.1) to the accuracy requested by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ (default value $\text{}={\epsilon}_{r}^{0.8}$, see Section 12.2).
You should also examine the printout from e04unc (see Section 12.3) to check whether the following four conditions are satisfied:
(i)the final value of Norm Gz is significantly less than at the starting point;
(ii)during the final major iterations, the values of Step and Mnr are both one;
(iii)the last few values of both Violtn and Norm Gz become small at a fast linear rate; and
(iv)Cond Hz is small.
If all these conditions hold, $x$ is almost certainly a local minimum.
10Example
This example is based on Problem 57 in Hock and Schittkowski (1981) and involves the minimization of the sum of squares function
and $F\left({x}^{*}\right)=0.01423$. The nonlinear constraint is active at the solution.
The options structure is declared and initialized by e04xxc. On return from e04unc, the memory freeing function e04xzc is used to free the memory assigned to the pointers in the options structure. You must not use the standard C function free() for this purpose.
This section gives a detailed description of the algorithm used in e04unc. This, and possibly the next section, Section 12, may be omitted if the more sophisticated features of the algorithm and software are not currently of interest.
11.1Overview
e04unc is based on the same algorithm as used in subroutine NPSOL described in Gill et al. (1986b).
At a solution of (1), some of the constraints will be active, i.e., satisfied exactly. An active simple bound constraint implies that the corresponding variable is fixed at its bound, and hence the variables are partitioned into fixed and free variables. Let $C$ denote the $m\times n$ matrix of gradients of the active general linear and nonlinear constraints. The number of fixed variables will be denoted by ${n}_{\mathrm{FX}}$, with ${n}_{\mathrm{FR}}$$({n}_{\mathrm{FR}}=n-{n}_{\mathrm{FX}})$ the number of free variables. The subscripts ‘FX’ and ‘FR’ on a vector or matrix will denote the vector or matrix composed of the elements corresponding to fixed or free variables.
A point $x$ is a first-order Kuhn–Tucker point for (1) (see, e.g., Powell (1974)) if the following conditions hold:
(i)$x$ is feasible;
(ii)there exist vectors $\xi $ and $\lambda $ (the Lagrange multiplier vectors for the bound and general constraints) such that
$$g={C}^{\mathrm{T}}\lambda +\xi $$
(2)
where $g$ is the gradient of $F$ evaluated at $x$, and ${\xi}_{j}=0$ if the $j$th variable is free.
(iii)The Lagrange multiplier corresponding to an inequality constraint active at its lower bound must be non-negative, and it must be non-positive for an inequality constraint active at its upper bound.
Let $Z$ denote a matrix whose columns form a basis for the set of vectors orthogonal to the rows of ${C}_{\mathrm{FR}}$; i.e., ${C}_{\mathrm{FR}}Z=0$. An equivalent statement of the condition (2) in terms of $Z$ is
$${Z}^{\mathrm{T}}{g}_{\mathrm{FR}}=0\text{.}$$
The vector ${Z}^{\mathrm{T}}{g}_{\mathrm{FR}}$ is termed the projected gradient of $F$ at $x$. Certain additional conditions must be satisfied in order for a first-order Kuhn–Tucker point to be a solution of (1) (see, e.g., Powell (1974)). e04unc implements a Sequential Quadratic Programming (SQP) method. For an overview of SQP methods, see, for example, Fletcher (1987), Gill et al. (1981) and Powell (1983).
The basic structure of e04unc involves major and minor iterations. The major iterations generate a sequence of iterates $\left\{{x}_{k}\right\}$ that converge to ${x}^{*}$, a first-order Kuhn–Tucker point of (1). At a typical major iteration, the new iterate $\overline{x}$ is defined by
$$\overline{x}=x+\alpha p$$
(3)
where $x$ is the current iterate, the non-negative scalar $\alpha $ is the step length, and $p$ is the search direction. (For simplicity, we shall always consider a typical iteration and avoid reference to the index of the iteration.) Also associated with each major iteration are estimates of the Lagrange multipliers and a prediction of the active set.
The search direction $p$ in (3) is the solution of a quadratic programming subproblem of the form
$$\underset{p}{\text{Minimize}}\phantom{\rule{0.25em}{0ex}}\text{\hspace{1em}}{g}^{\mathrm{T}}p+\frac{1}{2}{p}^{\mathrm{T}}Hp\text{\hspace{1em} subject to \hspace{1em}}\overline{l}\le \left\{\begin{array}{c}p\\ {A}_{L}p\\ {A}_{N}p\end{array}\right\}\le \overline{u}\text{,}$$
(4)
where $g$ is the gradient of $F$ at $x$, the matrix $H$ is a positive definite quasi-Newton approximation to the Hessian of the Lagrangian function (see Section 11.4), and ${A}_{N}$ is the Jacobian matrix of $c$ evaluated at $x$. (Finite difference estimates may be used for $g$ and ${A}_{N}$; see the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}$ in Section 12.2.) Let $l$ in (1) be partitioned into three sections: ${l}_{B}$, ${l}_{L}$ and ${l}_{N}$, corresponding to the bound, linear and nonlinear constraints. The vector $\overline{l}$ in (4) is similarly partitioned, and is defined as
where $c$ is the vector of nonlinear constraints evaluated at $x$. The vector $\overline{u}$ is defined in an analogous fashion.
The estimated Lagrange multipliers at each major iteration are the Lagrange multipliers from the subproblem (4) (and similarly for the predicted active set). (The numbers of bounds, general linear and nonlinear constraints in the QP active set are the quantities Bnd, Lin and Nln in the output of e04unc; see Section 12.3.) In e04unc, (4) is solved using the same algorithm as used in function e04ncc. Since solving a quadratic program is an iterative procedure, the minor iterations of e04unc are the iterations of e04ncc. (More details about solving the subproblem are given in Section 11.2.)
Certain matrices associated with the QP subproblem are relevant in the major iterations. Let the subscripts ‘FX’ and ‘FR’ refer to the predicted fixed and free variables, and let $C$ denote the $m\times n$ matrix of gradients of the general linear and nonlinear constraints in the predicted active set. First, we have available the $TQ$ factorization of ${C}_{\mathrm{FR}}$:
where $T$ is a nonsingular $m\times m$ reverse-triangular matrix (i.e., ${t}_{ij}=0$ if $i+j<m$, and the nonsingular ${n}_{\mathrm{FR}}\times {n}_{\mathrm{FR}}$ matrix ${Q}_{\mathrm{FR}}$ is the product of orthogonal transformations (see Gill et al. (1984)). Second, we have the upper triangular Cholesky factor $R$ of the transformed and re-ordered Hessian matrix
the ${n}_{Z}$$({n}_{Z}\equiv {n}_{\mathrm{FR}}-m)$ columns of $Z$ form a basis for the null space of ${C}_{\mathrm{FR}}$. The matrix $Z$ is used to compute the projected gradient ${Z}^{\mathrm{T}}{g}_{\mathrm{FR}}$ at the current iterate. (The values Nz, Norm Gf and Norm Gz printed by e04unc give ${n}_{Z}$ and the norms of ${g}_{\mathrm{FR}}$ and ${Z}^{\mathrm{T}}{g}_{\mathrm{FR}}$; see Section 12.3.)
A theoretical characteristic of SQP methods is that the predicted active set from the QP subproblem (4) is identical to the correct active set in a neighbourhood of ${x}^{*}$. In e04unc, this feature is exploited by using the QP active set from the previous iteration as a prediction of the active set for the next QP subproblem, which leads in practice to optimality of the subproblems in only one iteration as the solution is approached. Separate treatment of bound and linear constraints in e04unc also saves computation in factorizing ${C}_{\mathrm{FR}}$ and ${H}_{Q}$.
Once $p$ has been computed, the major iteration proceeds by determining a step length $\alpha $ that produces a ‘sufficient decrease’ in an augmented Lagrangian merit function (see Section 11.3). Finally, the approximation to the transformed Hessian matrix ${H}_{Q}$ is updated using a modified BFGS quasi-Newton update (see Section 11.4) to incorporate new curvature information obtained in the move from $x$ to $\overline{x}$.
On entry to e04unc, an iterative procedure from e04ncc is executed, starting with the user-provided initial point, to find a point that is feasible with respect to the bounds and linear constraints (using the tolerance specified by ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$; see Section 12.2). If no feasible point exists for the bound and linear constraints, (1) has no solution and e04unc terminates. Otherwise, the problem functions will thereafter be evaluated only at points that are feasible with respect to the bounds and linear constraints. The only exception involves variables whose bounds differ by an amount comparable to the finite difference interval (see the discussion of ${\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}$ in Section 12.2). In contrast to the bounds and linear constraints, it must be emphasized that the nonlinear constraints will not generally be satisfied until an optimal point is reached.
Facilities are provided to check whether the user-provided gradients appear to be correct (see the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ in Section 12.2). In general, the check is provided at the first point that is feasible with respect to the linear constraints and bounds. However, you may request that the check be performed at the initial point.
In summary, the method of e04unc first determines a point that satisfies the bound and linear constraints. Thereafter, each iteration includes:
(a)the solution of a quadratic programming subproblem (see Section 11.2);
(b)a linesearch with an augmented Lagrangian merit function (see Section 11.3); and
(c)a quasi-Newton update of the approximate Hessian of the Lagrangian function (Section 11.4).
11.2Solution of the Quadratic Programming Subproblem
The search direction $p$ is obtained by solving (4) using the algorithm of e04ncc (see Gill et al. (1986)), which was specifically designed to be used within an SQP algorithm for nonlinear programming.
The method of e04ncc is a two-phase (primal) quadratic programming method. The two phases of the method are: finding an initial feasible point by minimizing the sum of infeasibilities (the feasibility phase), and minimizing the quadratic objective function within the feasible region (the optimality phase). The computations in both phases are performed by the same segments of code. The two-phase nature of the algorithm is reflected by changing the function being minimized from the sum of infeasibilities to the quadratic objective function.
In general, a quadratic program must be solved by iteration. Let $p$ denote the current estimate of the solution of 4; the new iterate $\overline{p}$ is defined by
$$\overline{p}=p+\sigma d$$
(8)
where, as in (3), $\sigma $ is a non-negative step length and $d$ is a search direction.
At the beginning of each iteration of e04ncc, a working set is defined of constraints (general and bound) that are satisfied exactly. The vector $d$ is then constructed so that the values of constraints in the working set remain unaltered for any move along $d$. For a bound constraint in the working set, this property is achieved by setting the corresponding element of $d$ to zero, i.e., by fixing the variable at its bound. As before, the subscripts ‘FX’ and ‘FR’ denote selection of the elements associated with the fixed and free variables.
corresponding to general constraints in the working set. The general constraints in the working set will remain unaltered if
$${C}_{\mathrm{FR}}{d}_{\mathrm{FR}}=0$$
(9)
which is equivalent to defining ${d}_{\mathrm{FR}}$ as
$${d}_{\mathrm{FR}}={Zd}_{Z}$$
(10)
for some vector ${d}_{Z}$, where $Z$ is the matrix associated with the $TQ$ factorization (5) of ${C}_{\mathrm{FR}}$.
The definition of ${d}_{Z}$ in (10) depends on whether the current $p$ is feasible. If not, ${d}_{Z}$ is zero except for an element $\gamma $ in the $j$th position, where $j$ and $\gamma $ are chosen so that the sum of infeasibilities is decreasing along $d$. (For further details, see Gill et al. (1986).) In the feasible case, ${d}_{Z}$ satisfies the equations
where ${R}_{Z}$ is the Cholesky factor of ${Z}^{\mathrm{T}}{H}_{\mathrm{FR}}Z$ and $q$ is the gradient of the quadratic objective function $(q=g+Hp)$. (The vector ${Z}^{\mathrm{T}}{q}_{\mathrm{FR}}$ is the projected gradient of the QP.) With (11), $p+d$ is the minimizer of the quadratic objective function subject to treating the constraints in the working set as equalities.
If the QP projected gradient is zero, the current point is a constrained stationary point in the subspace defined by the working set. During the feasibility phase, the projected gradient will usually be zero only at a vertex (although it may vanish at non-vertices in the presence of constraint dependencies). During the optimality phase, a zero projected gradient implies that $p$ minimizes the quadratic objective function when the constraints in the working set are treated as equalities. In either case, Lagrange multipliers are computed. Given a positive constant $\delta $ of the order of the machine precision, the Lagrange multiplier ${\mu}_{j}$ corresponding to an inequality constraint in the working set at its upper bound is said to be optimal if ${\mu}_{j}\le \delta $ when the $j$th constraint is at its upper bound, or if ${\mu}_{j}\ge -\delta $ when the associated constraint is at its lower bound. If any multiplier is non-optimal, the current objective function (either the true objective or the sum of infeasibilities) can be reduced by deleting the corresponding constraint from the working set.
If optimal multipliers occur during the feasibility phase and the sum of infeasibilities is nonzero, no feasible point exists. The QP algorithm will then continue iterating to determine the minimum sum of infeasibilities. At this point, the Lagrange multiplier ${\mu}_{j}$ will satisfy $-(1+\delta )\le {\mu}_{j}\le \delta $ for an inequality constraint at its upper bound, and $-\delta \le {\mu}_{j}\le (1+\delta )$ for an inequality at its lower bound. The Lagrange multiplier for an equality constraint will satisfy $\left|{\mu}_{j}\right|\le 1+\delta $.
The choice of step length $\sigma $ in the QP iteration (8) is based on remaining feasible with respect to the satisfied constraints. During the optimality phase, if $p+d$ is feasible, $\sigma $ will be taken as unity. (In this case, the projected gradient at $\overline{p}$ will be zero.) Otherwise, $\sigma $ is set to ${\sigma}_{M}$, the step to the ‘nearest’ constraint, which is added to the working set at the next iteration.
Each change in the working set leads to a simple change to ${C}_{\mathrm{FR}}$: if the status of a general constraint changes, a row of ${C}_{\mathrm{FR}}$ is altered; if a bound constraint enters or leaves the working set, a column of ${C}_{\mathrm{FR}}$ changes. Explicit representations are recurred of the matrices $T$, ${Q}_{\mathrm{FR}}$ and $R$, and of the vectors ${Q}^{\mathrm{T}}q$ and ${Q}^{\mathrm{T}}g$.
11.3The Merit Function
After computing the search direction as described in Section 11.2, each major iteration proceeds by determining a step length $\alpha $ in (3) that produces a ‘sufficient decrease’ in the augmented Lagrangian merit function
where $x$, $\lambda $ and $s$ vary during the linesearch. The summation terms in (12) involve only the nonlinear constraints. The vector $\lambda $ is an estimate of the Lagrange multipliers for the nonlinear constraints of (1). The non-negative slack variables$\left\{{s}_{i}\right\}$ allow nonlinear inequality constraints to be treated without introducing discontinuities. The solution of the QP subproblem (4) provides a vector triple that serves as a direction of search for the three sets of variables. The non-negative vector $\rho $ of penalty parameters is initialized to zero at the beginning of the first major iteration. Thereafter, selected elements are increased whenever necessary to ensure descent for the merit function. Thus, the sequence of norms of $\rho $ (the printed quantity Penalty; see Section 12.3) is generally nondecreasing, although each ${\rho}_{i}$ may be reduced a limited number of times.
The merit function (12) and its global convergence properties are described in Gill et al. (1986a).
11.4The Quasi–Newton Update
The matrix $H$ in (4) is a positive definite quasi-Newton approximation to the Hessian of the Lagrangian function. (For a review of quasi-Newton methods, see Dennis and Schnabel (1983).) At the end of each major iteration, a new Hessian approximation $\overline{H}$ is defined as a rank-two modification of $H$. In e04unc, the BFGS quasi-Newton update is used:
In e04unc, $H$ is required to be positive definite. If $H$ is positive definite, $\overline{H}$ defined by (13) will be positive definite if and only if ${y}^{\mathrm{T}}s$ is positive (see, e.g., Dennis and Moré (1977)). Ideally, $y$ in (13) would be taken as ${y}_{L}$, the change in gradient of the Lagrangian function
where ${\mu}_{N}$ denotes the QP multipliers associated with the nonlinear constraints of the original problem. If ${y}_{L}^{\mathrm{T}}s$ is not sufficiently positive, an attempt is made to perform the update with a vector $y$ of the form
where ${\omega}_{i}\ge 0$. If no such vector can be found, the update is performed with a scaled ${y}_{L}$; in this case, M is printed to indicate that the update was modified.
Rather than modifying $H$ itself, the Cholesky factor of the transformed Hessian${H}_{Q}$(6) is updated, where $Q$ is the matrix from (5) associated with the active set of the QP subproblem. The update (12) is equivalent to the following update to ${H}_{Q}$:
where ${y}_{Q}={Q}^{\mathrm{T}}y$, and ${s}_{Q}={Q}^{\mathrm{T}}s$. This update may be expressed as a rank-one update to $R$ (see Dennis and Schnabel (1981)).
12Optional Parameters
A number of optional input and output arguments to e04unc are available through the structure argument options, type Nag_E04_Opt. An argument may be selected by assigning an appropriate value to the relevant structure member; those arguments not selected will be assigned default values. If no use is to be made of any of the optional parameters you should use the NAG defined null pointer, E04_DEFAULT, in place of options when calling e04unc; the default settings will then be used for all arguments.
Before assigning values to options directly the structure must be initialized by a call to the function e04xxc. Values may then be assigned to the structure members in the normal C manner.
After return from e04unc, the options structure may only be re-used for future calls of e04unc if the dimensions of the new problem are the same. Otherwise, the structure must be cleared by a call of e04xzc) and re-initialized by a call of e04xxc before future calls. Failure to do this will result in unpredictable behaviour.
Option settings may also be read from a text file using the function e04xyc in which case initialization of the options structure will be performed automatically if not already done. Any subsequent direct assignment to the options structure must not be preceded by initialization.
If assignment of functions and memory to pointers in the options structure is required, then this must be done directly in the calling program; they cannot be assigned using e04xyc.
12.1Optional Parameter Checklist and Default Values
For easy reference, the following list shows the members of options which are valid for e04unc together with their default values where relevant. The number $\epsilon $ is a generic notation for machine precision (see X02AJC).
On entry: specifies how the initial working set is chosen in both the procedure for finding a feasible point for the linear constraints and bounds, and in the first QP subproblem thereafter. With ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$, e04unc chooses the initial working set 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 the value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}$; see below).
With ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$, you must provide a valid definition of every array element of the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$, ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ (see below for their definitions). The ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ 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. The ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ values associated with nonlinear constraints determine the initial working set of the first QP subproblem after such a feasible point has been found. e04unc will override your specification of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ if necessary, so that a poor choice of the working set will not cause a fatal error. For instance, any elements of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ which are set to $\mathrm{-2},\mathrm{-1}$ or 4 will be reset to zero, as will any elements which are set to 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 e04unc is called repeatedly to solve related problems.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ or $\mathrm{Nag\_Warm}$.
list – Nag_Boolean
Default $\text{}=\mathrm{Nag\_TRUE}$
On entry: if ${\mathbf{options}}\mathbf{.}{\mathbf{list}}=\mathrm{Nag\_TRUE}$ the argument settings in the call to e04unc will be printed.
print_level – Nag_PrintType
Default $\text{}=\mathrm{Nag\_Soln\_Iter}$
On entry: the level of results printout produced by e04unc at each major iteration. The following values are available:
$\mathrm{Nag\_NoPrint}$
No output.
$\mathrm{Nag\_Soln}$
The final solution.
$\mathrm{Nag\_Iter}$
One line of output for each iteration.
$\mathrm{Nag\_Iter\_Long}$
A longer line of output for each iteration with more information (line exceeds 80 characters).
$\mathrm{Nag\_Soln\_Iter}$
The final solution and one line of output for each iteration.
$\mathrm{Nag\_Soln\_Iter\_Long}$
The final solution and one long line of output for each iteration (line exceeds 80 characters).
$\mathrm{Nag\_Soln\_Iter\_Const}$
As $\mathrm{Nag\_Soln\_Iter\_Long}$ with the objective function, the values of the variables, the Euclidean norm of the nonlinear constraint violations, the nonlinear constraint values, $c$, and the linear constraint values ${A}_{L}x$ also printed at each iteration.
$\mathrm{Nag\_Soln\_Iter\_Full}$
As $\mathrm{Nag\_Soln\_Iter\_Const}$ with the diagonal elements of the upper triangular matrix $T$ associated with the $TQ$ factorization (see (5)) of the QP working set, and the diagonal elements of $R$, the triangular factor of the transformed and re-ordered Hessian (see (6)).
Details of each level of results printout are described in Section 12.3.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_NoPrint}$, $\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Iter}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$.
minor_print_level – Nag_PrintType
Default $\text{}=\mathrm{Nag\_NoPrint}$
On entry: the level of results printout produced by the minor iterations of e04unc (i.e., the iterations of the QP subproblem). The following values are available:
$\mathrm{Nag\_NoPrint}$
No output.
$\mathrm{Nag\_Soln}$
The final solution.
$\mathrm{Nag\_Iter}$
One line of output for each iteration.
$\mathrm{Nag\_Iter\_Long}$
A longer line of output for each iteration with more information (line exceeds 80 characters).
$\mathrm{Nag\_Soln\_Iter}$
The final solution and one line of output for each iteration.
$\mathrm{Nag\_Soln\_Iter\_Long}$
The final solution and one long line of output for each iteration (line exceeds 80 characters).
$\mathrm{Nag\_Soln\_Iter\_Const}$
As $\mathrm{Nag\_Soln\_Iter\_Long}$ with the Lagrange multipliers, the variables $x$, the constraint values ${A}_{L}x$ and the constraint status also printed at each iteration.
$\mathrm{Nag\_Soln\_Iter\_Full}$
As $\mathrm{Nag\_Soln\_Iter\_Const}$ with the diagonal elements of the upper triangular matrix $T$ associated with the $TQ$ factorization (see (4) in e04ncc) of the working set, and the diagonal elements of the upper triangular matrix $R$ printed at each iteration.
Details of each level of results printout are described in Section 12.3 in e04ncc. (${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$ in the present function is equivalent to ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ in e04ncc.)
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}=\mathrm{Nag\_NoPrint}$, $\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Iter}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$.
outfile – const char[512]
Default $\text{}=\mathtt{stdout}$
On entry: the name of the file to which results should be printed. If ${\mathbf{options}}\mathbf{.}{\mathbf{outfile}}\left[0\right]=\text{'}\text{}\text{0}\text{}\text{'}$ then the stdout stream is used.
print_fun – pointer to function
Default $\text{}=\text{}$NULL
On entry: printing function defined by you; the prototype of ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ is
On entry: this argument indicates whether all elements of the objective Jacobian are provided in function objfun. If none or only some of the elements are being supplied by objfun then ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}$ should be set to Nag_FALSE.
Whenever possible all elements should be supplied, since e04unc is more reliable and will usually be more efficient when all derivatives are exact.
If ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_deriv}}=\mathrm{Nag\_FALSE}$, e04unc will approximate unspecified elements of the objective Jacobian, using finite differences. The computation of finite difference approximations usually increases the total run-time, since a call to objfun is required for each unspecified element. Furthermore, less accuracy can be attained in the solution (see Gill et al. (1981), for a discussion of limiting accuracy).
At times, central differences are used rather than forward differences, in which case twice as many calls to objfun are needed. (The switch to central differences is not under your control.)
con_deriv – Nag_Boolean
Default $\text{}=\mathrm{Nag\_TRUE}$
On entry: this argument indicates whether all elements of the constraint Jacobian are provided in function confun. If none or only some of the derivatives are being supplied by confun then ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}$ should be set to Nag_FALSE.
Whenever possible all elements should be supplied, since e04unc is more reliable and will usually be more efficient when all derivatives are exact.
If ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_FALSE}$, e04unc will approximate unspecified elements of the constraint Jacobian. One call to confun is needed for each variable for which partial derivatives are not available. For example, if the constraint Jacobian has the form
where $\text{'}*\text{'}$ indicates a provided element and ‘?’ indicates an unspecified element, e04unc will call confun twice: once to estimate the missing element in column $2$, and again to estimate the two missing elements in column $3$. (Since columns 1 and 4 are known, they require no calls to confun.)
At times, central differences are used rather than forward differences, in which case twice as many calls to confun are needed. (The switch to central differences is not under your control.)
verify_grad – Nag_GradChk
Default $\text{}=\mathrm{Nag\_SimpleCheck}$
On entry: specifies the level of derivative checking to be performed by e04unc on the gradient elements computed by the user-supplied functions objfun and confun.
The following values are available:
$\mathrm{Nag\_NoCheck}$
No derivative checking is performed.
$\mathrm{Nag\_SimpleCheck}$
Perform a simple check of both the objective and constraint gradients.
$\mathrm{Nag\_CheckObj}$
Perform a component check of the objective gradient elements.
$\mathrm{Nag\_CheckCon}$
Perform a component check of the constraint gradient elements.
$\mathrm{Nag\_CheckObjCon}$
Perform a component check of both the objective and constraint gradient elements.
$\mathrm{Nag\_XSimpleCheck}$
Perform a simple check of both the objective and constraint gradients at the initial value of $x$ specified in x.
$\mathrm{Nag\_XCheckObj}$
Perform a component check of the objective gradient elements at the initial value of $x$ specified in x.
$\mathrm{Nag\_XCheckCon}$
Perform a component check of the constraint gradient elements at the initial value of $x$ specified in x.
$\mathrm{Nag\_XCheckObjCon}$
Perform a component check of both the objective and constraint gradient elements at the initial value of $x$ specified in x.
If ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_SimpleCheck}$ or $\mathrm{Nag\_XSimpleCheck}$ then a simple ‘cheap’ test is performed, which requires only one call to objfun and one call to confun. If ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_CheckObj}$, $\mathrm{Nag\_CheckCon}$ or $\mathrm{Nag\_CheckObjCon}$ then a more reliable (but more expensive) test will be made on individual gradient components. This component check will be made in the range specified by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}$ for the objective gradient, with default values $1$ and n, respectively. For the constraint gradient the range is specified by ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}$, with default values $1$ and n.
The procedure for the derivative check is based on finding an interval that produces an acceptable estimate of the second derivative, and then using that estimate to compute an interval that should produce a reasonable forward-difference approximation. The gradient element is then compared with the difference approximation. (The method of finite difference interval estimation is based on Gill et al. (1983).) The result of the test is printed out by e04unc if the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}\ne \mathrm{Nag\_D\_NoPrint}$.
On entry: controls whether the results of any derivative checking are printed out (see optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$).
If a component derivative check has been carried out, then full details will be printed if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_Full}$. For a printout summarising the results of a component derivative check set ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_Sum}$. If only a simple derivative check is requested then $\mathrm{Nag\_D\_Sum}$ and $\mathrm{Nag\_D\_Full}$ will give the same level of output. To prevent any printout from a derivative check set ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_NoPrint}$.
Constraint:
${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_NoPrint}$, $\mathrm{Nag\_D\_Sum}$ or $\mathrm{Nag\_D\_Full}$.
obj_check_start – Integer
Default $\text{}=1$
obj_check_stop – Integer
Default $\text{}={\mathbf{n}}$
These options take effect only when ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_CheckObj}$, $\mathrm{Nag\_CheckObjCon}$, $\mathrm{Nag\_XCheckObj}$ or $\mathrm{Nag\_XCheckObjCon}$.
On entry: these arguments may be used to control the verification of Jacobian elements computed by the function objfun. For example, if the first 30 columns of the objective Jacobian appeared to be correct in an earlier run, so that only column 31 remains questionable, it is reasonable to specify ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}=31$. If the first 30 variables appear linearly in the subfunctions, so that the corresponding Jacobian elements are constant, the above choice would also be appropriate.
These options take effect only when ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_CheckCon}$, $\mathrm{Nag\_CheckObjCon}$, $\mathrm{Nag\_XCheckCon}$ or $\mathrm{Nag\_XCheckObjCon}$.
On entry: these arguments may be used to control the verification of the Jacobian elements computed by the function confun. For example, if the first 30 columns of the constraint Jacobian appeared to be correct in an earlier run, so that only column 31 remains questionable, it is reasonable to specify ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}=31$.
On entry: defines an interval used to estimate derivatives by finite differences in the following circumstances:
(a)For verifying the objective and/or constraint gradients (see the description of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$).
(b)For estimating unspecified elements of the objective and/or constraint Jacobian matrix.
In general, using the notation $r={\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}$, a derivative with respect to the $j$th variable is approximated using the interval ${\delta}_{j}$, where ${\delta}_{j}=r(1+\left|{\hat{x}}_{j}\right|)$, with $\hat{x}$ the first point feasible with respect to the bounds and linear constraints. If the functions are well scaled, the resulting derivative approximation should be accurate to O$\left(r\right)$. See Chapter 8 of Gill et al. (1981) for a discussion of the accuracy in finite difference approximations.
If a difference interval is not specified by you, a finite difference interval will be computed automatically for each variable by a procedure that requires up to six calls of confun and objfun for each element. This option is recommended if the function is badly scaled or you wish to have e04unc determine constant elements in the objective and constraint gradients (see the descriptions of confun and objfun in Section 5).
On entry: if the algorithm switches to central differences because the forward-difference approximation is not sufficiently accurate the value of ${\mathbf{options}}\mathbf{.}{\mathbf{c\_diff\_int}}$ is used as the difference interval for every element of $x$. The switch to central differences is indicated by C at the end of each line of intermediate printout produced by the major iterations (see Section 12.3). The use of finite differences is discussed under the option ${\mathbf{options}}\mathbf{.}{\mathbf{f\_diff\_int}}$.
On entry: the maximum number of iterations for finding a feasible point with respect to the bounds and linear constraints (if any). The value also specifies the maximum number of minor iterations for the optimality phase of each QP subproblem.
On entry: this argument defines ${\epsilon}_{r}$, which is intended to be a measure of the accuracy with which the problem functions $F\left(x\right)$ and $c\left(x\right)$ can be computed.
The value of ${\epsilon}_{r}$ should reflect the relative precision of $1+\left|F\left(x\right)\right|$; i.e., ${\epsilon}_{r}$ acts as a relative precision when $\left|F\right|$ is large, and as an absolute precision when $\left|F\right|$ is small. For example, if $F\left(x\right)$ is typically of order 1000 and the first six significant digits are known to be correct, an appropriate value for ${\epsilon}_{r}$ would be ${10}^{\mathrm{-6}}$. In contrast, if $F\left(x\right)$ is typically of order ${10}^{\mathrm{-4}}$ and the first six significant digits are known to be correct, an appropriate value for ${\epsilon}_{r}$ would be ${10}^{\mathrm{-10}}$. The choice of ${\epsilon}_{r}$ can be quite complicated for badly scaled problems; see Chapter 8 of Gill et al. (1981), for a discussion of scaling techniques. The default value is appropriate for most simple functions that are computed with full accuracy. However, when the accuracy of the computed function values is known to be significantly worse than full precision, the value of ${\epsilon}_{r}$ should be large enough so that e04unc will not attempt to distinguish between function values that differ by less than the error inherent in the calculation.
On entry: specifies the accuracy to which you wish the final iterate to approximate a solution of the problem. Broadly speaking, ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ indicates the number of correct figures desired in the objective function at the solution. For example, if ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ is ${10}^{\mathrm{-6}}$ and e04unc terminates successfully, the final value of $F$ should have approximately six correct figures.
e04unc will terminate successfully if the iterative sequence of $x$-values is judged to have converged and the final point satisfies the first-order Kuhn–Tucker conditions (see Section 11.1). The sequence of iterates is considered to have converged at $x$ if
where $p$ is the search direction, $\alpha $ the step length, and $r$ is the value of ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$. An iterate is considered to satisfy the first-order conditions for a minimum if
$$\left|{res}_{j}\right|\le \mathit{ftol}\text{ for all}j\text{,}$$
(18)
where ${Z}^{\mathrm{T}}{g}_{\mathrm{FR}}$ is the projected gradient (see Section 11.1), ${g}_{\mathrm{FR}}$ is the gradient of $F\left(x\right)$ with respect to the free variables, ${res}_{j}$ is the violation of the $j$th active nonlinear constraint, and $\mathit{ftol}$ is the value of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$.
On entry: defines the maximum acceptable absolute violations in the linear constraints at a ‘feasible’ point; i.e., a linear constraint is considered satisfied if its violation does not exceed ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$.
On entry to e04unc, an iterative procedure is executed in order to find a point that satisfies the linear constraints and bounds on the variables to within the tolerance specified by ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$. All subsequent iterates will satisfy the constraints to within the same tolerance (unless ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ is comparable to the finite difference interval).
This tolerance should reflect the precision of the linear constraints. For example, if the variables and the coefficients in the linear constraints are of order unity, and the latter are correct to about 6 decimal digits, it would be appropriate to specify ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ as ${10}^{\mathrm{-6}}$.
Default $\text{}={\epsilon}^{0.33}$ or $\sqrt{\epsilon}$
The default is ${\epsilon}^{0.33}$ if the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{con\_deriv}}=\mathrm{Nag\_FALSE}$, and $\sqrt{\epsilon}$ otherwise.
On entry: defines the maximum acceptable absolute violations in the nonlinear constraints at a ‘feasible’ point; i.e., a nonlinear constraint is considered satisfied if its violation does not exceed ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$.
This tolerance defines the largest constraint violation that is acceptable at an optimal point. Since nonlinear constraints are generally not satisfied until the final iterate, the value of ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$ acts as a partial termination criterion for the iterative sequence generated by e04unc (see also the discussion of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$).
This tolerance should reflect the precision of the nonlinear constraint functions calculated by confun.
On entry: controls the accuracy with which the step $\alpha $ taken during each iteration approximates a minimum of the merit function along the search direction (the smaller the value of ${\mathbf{options}}\mathbf{.}{\mathbf{linesearch\_tol}}$, the more accurate the line search). The default value requests an inaccurate search, and is appropriate for most problems, particularly those with any nonlinear constraints.
If there are no nonlinear constraints, a more accurate search may be appropriate when it is desirable to reduce the number of major iterations – for example, if the objective function is cheap to evaluate, or if a substantial number of derivatives are unspecified.
On entry: specifies the maximum change in the variables at the first step of the line search. In some cases, such as $F\left(x\right)={ae}^{bx}$ or $F\left(x\right)={ax}^{b}$, even a moderate change in the elements of $x$ can lead to floating-point overflow. The argument ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ is, therefore, used to encourage evaluation of the problem functions at meaningful points. Given any major iterate $x$, the first point $\stackrel{~}{x}$ at which $F$ and $c$ are evaluated during the line search is restricted so that
where $r$ is the value of ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$.
The line search may go on and evaluate $F$ and $c$ at points further from $x$ if this will result in a lower value of the merit function. In this case, the character L is printed at the end of each line of output produced by the major iterations (see Section 12.3). If L is printed for most of the iterations, ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ should be set to a larger value.
Wherever possible, upper and lower bounds on $x$ should be used to prevent evaluation of nonlinear functions at wild values. The default value of ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}=2.0$ should not affect progress on well-behaved functions, but values such as $0.1$ or $0.01$ may be helpful when rapidly varying functions are present. If a small value of ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ is selected, a good starting point may be required. An important application is to the class of nonlinear least squares problems.
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}$ is used during a ‘cold start’ when e04unc selects an initial working set (${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$). The initial working set will include (if possible) bounds or general inequality constraints that lie within ${\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}$ of their bounds. In particular, a constraint of the form ${a}_{j}^{\mathrm{T}}x\ge l$ will be included in the initial working set if $\left|{a}_{j}^{\mathrm{T}}x-l\right|\le {\mathbf{options}}\mathbf{.}{\mathbf{crash\_tol}}\times (1+\left|l\right|)$.
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ will be regarded as $+\infty $ (and similarly any lower bound less than or equal to $-{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ will be regarded as $-\infty $).
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_step}}$ specifies the magnitude of the change in variables that will be considered a step to an unbounded solution. If the change in $x$ during an iteration would exceed the value of ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_step}}$, the objective function is considered to be unbounded below in the feasible region.
On entry: ncnlin values of memory will be automatically allocated by e04unc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{conf}}$. However you may supply memory from the calling program.
On exit: if ${\mathbf{ncnlin}}>0$, ${\mathbf{options}}\mathbf{.}{\mathbf{conf}}\left[i-1\right]$ contains the value of the $i$th nonlinear constraint function ${c}_{i}$ at the final iterate.
If ${\mathbf{ncnlin}}=0$ then ${\mathbf{options}}\mathbf{.}{\mathbf{conf}}$ will not be referenced.
On entry: ${\mathbf{ncnlin}}\times {\mathbf{n}}$ values of memory will be automatically allocated by e04unc and this is the recommended method of use of ${\mathbf{options}}\mathbf{.}{\mathbf{conjac}}$. However you may supply memory from the calling program.
On exit: if ${\mathbf{ncnlin}}>0$, conjac contains the Jacobian matrix of the nonlinear constraint functions at the final iterate, i.e., ${\mathbf{conjac}}\left[(\mathit{i}-1)=*{\mathbf{n}}+\mathit{j}-1\right]$ contains the partial derivative of the $\mathit{i}$th constraint function with respect to the $\mathit{j}$th variable, for $\mathit{i}=1,2,\dots ,{\mathbf{ncnlin}}$ and $\mathit{j}=1,2,\dots ,{\mathbf{n}}$. (See the discussion of the argument conjac under confun.)
If ${\mathbf{ncnlin}}=0$ then conjac will not be referenced.
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ need not be set if the default option of ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ is used as ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$ values of memory will be automatically allocated by e04unc.
If the option ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ has been chosen, ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ must point to a minimum of ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$ elements of memory. This memory will already be available if the options structure has been used in a previous call to e04unc from the calling program, with ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ and the same values of n, nclin and ncnlin. If a previous call has not been made, sufficient memory must be allocated by you.
When a ‘warm start’ is chosen ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ should specify the status of the bounds and linear constraints at the start of the feasibility phase. More precisely, the first n elements of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ refer to the upper and lower bounds on the variables, the next nclin elements refer to the general linear constraints and the following ncnlin elements refer to the nonlinear constraints. Possible values for ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]$ are as follows:
The corresponding constraint is not in the initial QP working set.
1
This inequality constraint should be in the initial working set at its lower bound.
2
This inequality constraint should be in the initial working set at its upper bound.
3
This equality constraint should be in the initial working set. This value must only be specified if ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]$.
The values $\mathrm{-2}$, $\mathrm{-1}$ and 4 are also acceptable but will be reset to zero by the function, as will any elements which are set to 3 when the corresponding elements of bl and bu are not equal. If e04unc has been called previously with the same values of n, nclin and ncnlin, then ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ already contains satisfactory information. (See also the description of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{start}}$.) The function also adjusts (if necessary) the values supplied in x to be consistent with the values supplied in ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$.
Constraint:
$\mathrm{-2}\le {\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[\mathit{j}-1\right]\le 4$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$.
On exit: the status of the constraints in the QP working set at the point returned in x. The significance of each possible value of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]$ is as follows:
The constraint violates its lower bound by more than the appropriate feasibility tolerance (see the options ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$). This value can occur only when no feasible point can be found for a QP subproblem.
$\mathrm{-1}$
The constraint violates its upper bound by more than the appropriate feasibility tolerance (see the options ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$). This value can occur only when no feasible point can be found for a QP subproblem.
$\phantom{-}0$
The constraint is satisfied to within the feasibility tolerance, but is not in the QP working set.
$\phantom{-}1$
This inequality constraint is included in the QP working set at its lower bound.
$\phantom{-}2$
This inequality constraint is included in the QP working set at its upper bound.
$\phantom{-}3$
This constraint is included in the working set as an equality. This value of ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ can occur only when ${\mathbf{bl}}\left[j-1\right]={\mathbf{bu}}\left[j-1\right]$.
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$ need not be set if the default option ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ is used as ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$ values of memory will be automatically allocated by e04unc.
If the option ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ has been chosen, ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$ must point to a minimum of ${\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$ elements of memory. This memory will already be available if the options structure has been used in a previous call to e04unc from the calling program, with ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ and the same values of n, nclin and ncnlin. If a previous call has not been made, sufficient memory must be allocated by you.
When a ‘warm start’ is chosen ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[\mathit{j}-1\right]$ must contain a multiplier estimate for each nonlinear constraint with a sign that matches the status of the constraint specified by ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$, for $\mathit{j}={\mathbf{n}}+{\mathbf{nclin}}+1,\dots ,{\mathbf{n}}+{\mathbf{nclin}}+{\mathbf{ncnlin}}$. The remaining elements need not be set.
Note that if the $j$th constraint is defined as ‘inactive’ by the initial value of the ${\mathbf{options}}\mathbf{.}{\mathbf{state}}$ array (i.e., ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]=1$), ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j-1\right]$ should be zero; if the $j$th constraint is an inequality active at its lower bound (i.e., ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]=0$), ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j-1\right]$ should be non-negative; if the $j$th constraint is an inequality active at its upper bound (i.e., ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]=2$), ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j-1\right]$ should be non-positive. If necessary, the function will modify ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}$ to match these rules.
On exit: the values of the Lagrange multipliers from the last QP subproblem. ${\mathbf{options}}\mathbf{.}{\mathbf{lambda}}\left[j-1\right]$ should be non-negative if ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]=1$ and non-positive if ${\mathbf{options}}\mathbf{.}{\mathbf{state}}\left[j-1\right]=2$.
On entry: ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ need not be set if the default option of ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ is used as ${\mathbf{n}}\times {\mathbf{n}}$ values of memory will be automatically allocated by e04unc.
If the option ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ has been chosen, ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ must point to a minimum of ${\mathbf{n}}\times {\mathbf{n}}$ elements of memory. This memory will already be available if the calling program has used the options structure in a previous call to e04unc with ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Cold}$ and the same value of n. If a previous call has not been made sufficient memory must be allocated to by you.
When ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$ is chosen the memory pointed to by ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ must contain the upper triangular Cholesky factor $R$ of the initial approximation of the Hessian of the Lagrangian function, with the variables in the natural order. Elements not in the upper triangular part of $R$ are assumed to be zero and need not be assigned. If a previous call has been made, with ${\mathbf{options}}\mathbf{.}{\mathbf{hessian}}=\mathrm{Nag\_TRUE}$, then ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ will already have been set correctly.
On exit: if ${\mathbf{options}}\mathbf{.}{\mathbf{hessian}}=\mathrm{Nag\_FALSE}$, ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ contains the upper triangular Cholesky factor $R$ of ${Q}^{\mathrm{T}}\stackrel{~}{H}Q$, an estimate of the transformed and re-ordered Hessian of the Lagrangian at $x$ (see (6)).
If ${\mathbf{options}}\mathbf{.}{\mathbf{hessian}}=\mathrm{Nag\_TRUE}$, ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ contains the upper triangular Cholesky factor $R$ of $H$, the approximate (untransformed) Hessian of the Lagrangian, with the variables in the natural order.
hessian – Nag_Boolean
Default $\text{}=\mathrm{Nag\_FALSE}$
On entry: controls the contents of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ on return from e04unc. e04unc works exclusively with the transformed and
re-ordered Hessian ${H}_{Q}$, and hence extra computation is required to form the Hessian itself. If ${\mathbf{options}}\mathbf{.}{\mathbf{hessian}}=\mathrm{Nag\_FALSE}$, ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$ contains the Cholesky factor of the transformed and re-ordered Hessian. If ${\mathbf{options}}\mathbf{.}{\mathbf{hessian}}=\mathrm{Nag\_TRUE}$, the Cholesky factor of the approximate Hessian itself is formed and stored in ${\mathbf{options}}\mathbf{.}{\mathbf{h}}$. This information is required by e04unc if the next call to e04unc will be made with optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{start}}=\mathrm{Nag\_Warm}$.
h_unit_init – Nag_Boolean
Default $\text{}=\mathrm{Nag\_FALSE}$
On entry: if ${\mathbf{options}}\mathbf{.}{\mathbf{h\_unit\_init}}=\mathrm{Nag\_FALSE}$ the initial value of the upper triangular matrix $R$ is set to ${J}^{\mathrm{T}}J$, where $J$ denotes the objective Jacobian matrix $\nabla f\left(x\right)$. ${J}^{\mathrm{T}}J$ is often a good approximation to the objective Hessian matrix ${\nabla}^{2}F\left(x\right)$. If ${\mathbf{options}}\mathbf{.}{\mathbf{h\_unit\_init}}=\mathrm{Nag\_TRUE}$ then the initial value of $R$ is the unit matrix.
h_reset_freq – Integer
Default $\text{}=2$
On entry: this argument allows you to reset the approximate Hessian matrix to ${J}^{\mathrm{T}}J$ every ${\mathbf{options}}\mathbf{.}{\mathbf{h\_reset\_freq}}$ iterations, where $J$ is the objective Jacobian matrix $\nabla f\left(x\right)$.
At any point where there are no nonlinear constraints active and the values of $f$ are small in magnitude compared to the norm of $J$, ${J}^{\mathrm{T}}J$ will be a good approximation to the objective Hessian matrix ${\nabla}^{2}F\left(x\right)$. Under these circumstances, frequent resetting can significantly improve the convergence rate of e04unc.
Resetting is suppressed at any iteration during which there are nonlinear constraints active.
On exit: the number of major iterations which have been performed in e04unc.
nf – Integer
On exit: the number of times the objective function has been evaluated (i.e., number of calls of objfun). The total excludes any calls made to objfun for purposes of derivative checking.
12.3Description of Printed Output
The level of printed output can be controlled with the structure members ${\mathbf{options}}\mathbf{.}{\mathbf{list}}$, ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}$, ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$ (see Section 12.2). If ${\mathbf{options}}\mathbf{.}{\mathbf{list}}=\mathrm{Nag\_TRUE}$ then the argument values to e04unc are listed, followed by the result of any derivative check if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_Sum}$ or $\mathrm{Nag\_D\_Full}$. The printout of results is governed by the values of ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$. The default of ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}=\mathrm{Nag\_NoPrint}$ provides a single line of output at each iteration and the final result. This section describes all of the possible levels of results printout available from e04unc.
If a simple derivative check, ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}=\mathrm{Nag\_SimpleCheck}$, is requested then a statement indicating success or failure is given. The largest error found in the objective and the constraint Jacobian are also output.
When a component derivative check (see ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$ in Section 12.2) is selected the element with the largest relative error is identified for the objective and the constraint Jacobian.
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_Full}$ then the following results are printed for each component:
x[i]
the element of $x$.
dx[i]
the optimal finite difference interval.
Jacobian value
the Jacobian element.
Difference approxn.
the finite difference approximation.
Itns
the number of trials performed to find a suitable difference interval.
The indicator, OK or BAD?, states whether the Jacobian element and finite difference approximation are in agreement. If the derivatives are believed to be in error e04unc will exit with fail set to NE_DERIV_ERRORS.
When ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Iter}$ or $\mathrm{Nag\_Soln\_Iter}$ the following line of output is produced at every major iteration. In all cases, the values of the quantities printed are those in effect on completion of the given iteration.
Maj
is the major iteration count.
Mnr
is the number of minor iterations required by the feasibility and optimality phases of the QP subproblem. Generally, Mnr will be 1 in the later iterations, since theoretical analysis predicts that the correct active set will be identified near the solution (see Section 11). Note that Mnr may be greater than the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_max\_iter}}$ (default value $\text{}=\mathrm{max}\phantom{\rule{0.125em}{0ex}}(50,3(n+{n}_{L}+{n}_{N}))$; see Section 12.2) if some iterations are required for the feasibility phase.
Step
is the step taken along the computed search direction. On reasonably well-behaved problems, the unit step will be taken as the solution is approached.
Merit function
is the value of the augmented Lagrangian merit function at the current iterate. This function will decrease at each iteration unless it was necessary to increase the penalty parameters (see Section 11.3). As the solution is approached, Merit function will converge to the value of the objective function at the solution.
If the QP subproblem does not have a feasible point (signified by I at the end of the current output line), the merit function is a large multiple of the constraint violations, weighted by the penalty parameters. During a sequence of major iterations with infeasible subproblems, the sequence of Merit Function values will decrease monotonically until either a feasible subproblem is obtained or e04unc terminates with the error indicator NW_NONLIN_NOT_FEASIBLE (no feasible point could be found for the nonlinear constraints).
If no nonlinear constraints are present (i.e., ${\mathbf{ncnlin}}=0$), this entry contains Objective, the value of the objective function $F\left(x\right)$. The objective function will decrease monotonically to its optimal value when there are no nonlinear constraints.
Violtn
is the Euclidean norm of the residuals of constraints that are violated or in the predicted active set (not printed if ncnlin is zero). Violtn will be approximately zero in the neighbourhood of a solution.
Norm Gz
is $\Vert {Z}^{\mathrm{T}}{g}_{\mathrm{FR}}\Vert $, the Euclidean norm of the projected gradient (see Section 11.1). NormGz will be approximately zero in the neighbourhood of a solution.
Cond Hz
is a lower bound on the condition number of the projected Hessian approximation ${H}_{Z}$$({H}_{Z}={Z}^{\mathrm{T}}{H}_{\mathrm{FR}}Z={R}_{Z}^{\mathrm{T}}{R}_{Z})$; see (6) and (11), respectively). The larger this number, the more difficult the problem.
The line of output may be terminated by one of the following characters:
M
is printed if the quasi-Newton update was modified to ensure that the Hessian approximation is positive definite (see Section 11.4).
I
is printed if the QP subproblem has no feasible point.
C
is printed if central differences were used to compute the unspecified objective and constraint gradients. If the value of Step is zero, the switch to central differences was made because no lower point could be found in the line search. (In this case, the QP subproblem is re-solved with the central difference gradient and Jacobian.) If the value of Step is nonzero, central differences were computed because Norm Gz and Violtn imply that $x$ is close to a Kuhn–Tucker point (see Section 11.1).
L
is printed if the line search has produced a relative change in $x$ greater than the value defined by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ (default value $\text{}=2.0$; see Section 12.2). If this output occurs frequently during later iterations of the run, ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$ should be set to a larger value.
R
is printed if the approximate Hessian has been refactorized. If the diagonal condition estimator of $R$ indicates that the approximate Hessian is badly conditioned, the approximate Hessian is refactorized using column interchanges. If necessary, $R$ is modified so that its diagonal condition estimator is bounded.
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$ the line of printout at every iteration is extended to give the following additional information. (Note this longer line extends over more than 80 characters.)
Nfun
is the cumulative number of evaluations of the objective function needed for the line search. Evaluations needed for the estimation of the gradients by finite differences are not included. Nfun is printed as a guide to the amount of work required for the linesearch.
Nz
is the number of columns of $Z$ (see Section 11.1). The value of Nz is the number of variables minus the number of constraints in the predicted active set; i.e., $\mathtt{Nz}=n-(\mathtt{Bnd}+\mathtt{Lin}+\mathtt{Nln})$.
Bnd
is the number of simple bound constraints in the predicted active set.
Lin
is the number of general linear constraints in the predicted active set.
Nln
is the number of nonlinear constraints in the predicted active set (not printed if ncnlin is zero).
Penalty
is the Euclidean norm of the vector of penalty parameters used in the augmented Lagrangian merit function (not printed if ncnlin is zero).
Norm Gf
is the Euclidean norm of ${g}_{\mathrm{FR}}$, the gradient of the objective function with respect to the free variables.
Cond H
is a lower bound on the condition number of the Hessian approximation $H$.
Cond T
is a lower bound on the condition number of the matrix of predicted active constraints.
Conv
is a three-letter indication of the status of the three convergence tests (16)–(18) defined in the description of the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ in Section 12.2. Each letter is T if the test is satisfied, and F otherwise. The three tests indicate whether:
(a)the sequence of iterates has converged;
(b)the projected gradient (Norm Gz) is sufficiently small; and
(c)the norm of the residuals of constraints in the predicted active set (Violtn) is small enough.
If any of these indicators is F when e04unc terminates with the error indicator NE_NOERROR, you should check the solution carefully.
When ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$ more detailed results are given at each iteration. If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter\_Const}$ these additional values are: the value of $x$ currently held in x; the current value of the objective function; the Euclidean norm of nonlinear constraint violations; the values of the nonlinear constraints (the vector $c$); and the values of the linear constraints, (the vector ${A}_{L}x$).
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln\_Iter\_Full}$ then the diagonal elements of the matrix $T$ associated with the $TQ$ factorization (see (5)) of the QP working set and the diagonal elements of $R$, the triangular factor of the transformed and re-ordered Hessian (see (6)) are also output at each iteration.
When ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$ the final printout from e04unc includes a listing of the status of every variable and constraint. The following describes the printout for each variable.
Varbl
gives the name (V) and index $\mathit{j}$, for $\mathit{j}=1,2,\dots ,n$, of the variable.
State
gives the state of the variable (FR if neither bound is in the active set, EQ if a fixed variable, LL if on its lower bound, UL if on its upper bound). If Value lies outside the upper or lower bounds by more than the feasibility tolerances specified by the optional parameters ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$ (see Section 12.2), State will be ++ or -- respectively.
A key is sometimes printed before State to give some additional information about the state of a variable.
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, 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 ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$.
Value
is the value of the variable at the final iteration.
Lower bound
is the lower bound specified for the variable $j$. (None indicates that ${\mathbf{bl}}\left[j-1\right]\le {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, where ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is the optional parameter.)
Upper bound
is the upper bound specified for the variable $j$. (None indicates that ${\mathbf{bu}}\left[j-1\right]\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, where ${\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ is the optional parameter.)
Lagr Mult
is the value of the Lagrange multiplier for the associated bound constraint. This will be zero if State is FR unless ${\mathbf{bl}}\left[j-1\right]\le -{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ and ${\mathbf{bu}}\left[j-1\right]\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$, in which case the entry will be blank. If $x$ is optimal, the multiplier should be non-negative if State is LL, and non-positive if State is UL.
Residual
is the difference between the variable Value and the nearer of its (finite) bounds ${\mathbf{bl}}\left[j-1\right]$ and ${\mathbf{bu}}\left[j-1\right]$. A blank entry indicates that the associated variable is not bounded (i.e., ${\mathbf{bl}}\left[j-1\right]\le -{\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$ and ${\mathbf{bu}}\left[j-1\right]\ge {\mathbf{options}}\mathbf{.}{\mathbf{inf\_bound}}$).
The meaning of the printout for linear and nonlinear constraints is the same as that given above for variables, with ‘variable’ replaced by ‘constraint’, ${\mathbf{bl}}\left[j-1\right]$ and ${\mathbf{bu}}\left[j-1\right]$ are replaced by ${\mathbf{bl}}\left[n+j-1\right]$ and ${\mathbf{bu}}\left[n+j-1\right]$ respectively, and with the following changes in the heading:
L Con
gives the name (L) and index $\mathit{j}$, for $\mathit{j}=1,2,\dots ,{n}_{L}$, of the linear constraint.
N Con
gives the name (N) and index $\left({\mathit{j}-n}_{L}\right)$, for $\mathit{j}={n}_{L}+1,\dots ,{n}_{L}+{n}_{N}$, of the nonlinear constraint.
The I key in the State column is printed for general linear constraints which currently violate one of their bounds by more than ${\mathbf{options}}\mathbf{.}{\mathbf{lin\_feas\_tol}}$ and for nonlinear constraints which violate one of their bounds by more than ${\mathbf{options}}\mathbf{.}{\mathbf{nonlin\_feas\_tol}}$.
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 Residual column to become positive.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
For the output governed by ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$, you are referred to the documentation for e04ncc. The option ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$ in the current document is equivalent to ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$ in the documentation for e04ncc.
If ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_NoPrint}$ then printout will be suppressed; you can print the final solution when e04unc returns to the calling program.
12.3.1Output of results via a user-defined printing function
You may also specify your own print function for output of iteration results and the final solution by use of the ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ function pointer, which has prototype
This section may be skipped if you wish to use the default printing facilities.
When a user-defined function is assigned to ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ this will be called in preference to the internal print function of e04unc. Calls to the user-defined function are again controlled by means of the ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}$, ${\mathbf{options}}\mathbf{.}{\mathbf{minor\_print\_level}}$ and ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}$ members. Information is provided through st and comm, the two structure arguments to ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$.
If $\mathbf{comm}\mathbf{\to}\mathbf{it\_maj\_prt}=\mathrm{Nag\_TRUE}$ then results from the last major iteration of e04unc are provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{it\_maj\_prt}=\mathrm{Nag\_TRUE}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Iter}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$. The following members of st are set:
n – Integer
The number of variables.
nclin – Integer
The number of linear constraints.
ncnlin – Integer
The number of nonlinear constraints.
nactiv – Integer
The total number of active elements in the current set.
iter – Integer
The major iteration count.
minor_iter – Integer
The minor iteration count for the feasibility and the optimality phases of the QP subproblem.
step – double
The step taken along the computed search direction.
nfun – Integer
The cumulative number of objective function evaluations needed for the line search.
merit – double
The value of the augmented Lagrangian merit function at the current iterate.
objf – double
The current value of the objective function.
norm_nlnviol – double
The Euclidean norm of nonlinear constraint violations (only available if $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$).
violtn – double
The Euclidean norm of the residuals of constraints that are violated or in the predicted active set (only available if $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$).
norm_gz – double
$\Vert {Z}^{\mathrm{T}}{g}_{\mathrm{FR}}\Vert $, the Euclidean norm of the projected gradient.
The number of simple bound constraints in the predicted active set.
lin – Integer
The number of general linear constraints in the predicted active set.
nln – Integer
The number of nonlinear constraints in the predicted active set (only available if $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$).
penalty – double
The Euclidean norm of the vector of penalty parameters used in the augmented Lagrangian merit function (only available if $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$).
norm_gf – double
The Euclidean norm of ${g}_{\mathrm{FR}}$, the gradient of the objective function with respect to the free variables.
cond_h – double
A lower bound on the condition number of the Hessian approximation $H$.
cond_hz – double
A lower bound on the condition number of the projected Hessian approximation ${H}_{Z}$.
cond_t – double
A lower bound on the condition number of the matrix of predicted active constraints.
iter_conv – Nag_Boolean
Nag_TRUE if the sequence of iterates has converged, i.e., convergence condition (16) (see the description of ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ in Section 12.2) is satisfied.
norm_gz_small – Nag_Boolean
Nag_TRUE if the projected gradient is sufficiently small, i.e., convergence condition (17) (see the description of ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ in Section 12.2) is satisfied.
violtn_small – Nag_Boolean
Nag_TRUE if the violations of the nonlinear constraints are sufficiently small, i.e., convergence condition (18) (see the description of ${\mathbf{options}}\mathbf{.}{\mathbf{optim\_tol}}$ in Section 12.2) is satisfied.
update_modified – Nag_Boolean
Nag_TRUE if the quasi-Newton update was modified to ensure that the Hessian is positive definite.
qp_not_feasible – Nag_Boolean
Nag_TRUE if the QP subproblem has no feasible point.
c_diff – Nag_Boolean
Nag_TRUE if central differences were used to compute the unspecified objective and constraint gradients.
step_limit_exceeded – Nag_Boolean
Nag_TRUE if the line search produced a relative change in $x$ greater than the value defined by the optional parameter ${\mathbf{options}}\mathbf{.}{\mathbf{step\_limit}}$.
refactor – Nag_Boolean
Nag_TRUE if the approximate Hessian has been refactorized.
x – double *
Contains the components ${\mathbf{x}}\left[\mathit{j}-1\right]$ of the current point $x$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$.
state – Integer *
Contains the status of the $\mathbf{st}\mathbf{\to}\mathbf{n}$ variables, $\mathbf{st}\mathbf{\to}\mathbf{nclin}$ linear, and $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ nonlinear constraints (if any). See Section 12.2 for a description of the possible status values.
ax – double *
If $\mathbf{st}\mathbf{\to}\mathbf{nclin}>0$, $\mathbf{st}\mathbf{\to}\mathbf{ax}\left[\mathit{j}-1\right]$ contains the current value of the $\mathit{j}$th linear constraint, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{nclin}$.
cx – double *
If $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$, $\mathbf{st}\mathbf{\to}\mathbf{cx}\left[\mathit{j}-1\right]$ contains the current value of nonlinear constraint ${c}_{\mathit{j}}$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$.
diagt – double *
If $\mathbf{st}\mathbf{\to}\mathbf{nactiv}>0$, the $\mathbf{st}\mathbf{\to}\mathbf{nactiv}$ elements of the diagonal of the matrix $T$.
diagr – double *
Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}$ elements of the diagonal of the upper triangular matrix $R$.
If $\mathbf{comm}\mathbf{\to}\mathbf{sol\_sqp\_prt}=\mathrm{Nag\_TRUE}$ then the final result from e04unc is provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{sol\_sqp\_prt}=\mathrm{Nag\_TRUE}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_level}}=\mathrm{Nag\_Soln}$, $\mathrm{Nag\_Soln\_Iter}$, $\mathrm{Nag\_Soln\_Iter\_Long}$, $\mathrm{Nag\_Soln\_Iter\_Const}$ or $\mathrm{Nag\_Soln\_Iter\_Full}$. The following members of st are set:
iter – Integer
The number of iterations performed.
n – Integer
The number of variables.
nclin – Integer
The number of linear constraints.
ncnlin – Integer
The number of nonlinear constraints.
x – double *
Contains the components ${\mathbf{x}}\left[\mathit{j}-1\right]$ of the final point $x$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$.
state – Integer *
Contains the status of the $\mathbf{st}\mathbf{\to}\mathbf{n}$ variables, $\mathbf{st}\mathbf{\to}\mathbf{nclin}$ linear, and $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ nonlinear constraints (if any). See Section 12.2 for a description of the possible status values.
ax – double *
If $\mathbf{st}\mathbf{\to}\mathbf{nclin}>0$, $\mathbf{st}\mathbf{\to}\mathbf{ax}\left[\mathit{j}-1\right]$ contains the final value of the $\mathit{j}$th linear constraint, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{nclin}$.
cx – double *
If $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}>0$, $\mathbf{st}\mathbf{\to}\mathbf{cx}\left[\mathit{j}-1\right]$ contains the final value of nonlinear constraint ${c}_{\mathit{j}}$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$.
bl – double *
Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{nclin}+\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ lower bounds on the variables.
bu – double *
Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{nclin}+\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ upper bounds on the variables.
lambda – double *
Contains the $\mathbf{st}\mathbf{\to}\mathbf{n}+\mathbf{st}\mathbf{\to}\mathbf{nclin}+\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ final values of the Lagrange multipliers.
If $\mathbf{comm}\mathbf{\to}\mathbf{g\_prt}=\mathrm{Nag\_TRUE}$ then the results from derivative checking are provided through st. Note that ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$ will be called with $\mathbf{comm}\mathbf{\to}\mathbf{g\_prt}$ only if ${\mathbf{options}}\mathbf{.}{\mathbf{print\_deriv}}=\mathrm{Nag\_D\_Sum}$ or $\mathrm{Nag\_D\_Full}$. The following members of st are set:
m – Integer
The number of subfunctions.
n – Integer
The number of variables.
ncnlin – Integer
The number of nonlinear constraints.
x – double *
Contains the components ${\mathbf{x}}\left[\mathit{j}-1\right]$ of the initial point ${x}_{0}$, for $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$.
fjac – double *
Contains elements of the Jacobian of $F$ at the initial point ${x}_{0}$ ($\frac{\partial {f}_{\mathit{i}}}{\partial {x}_{\mathit{j}}}$ is held at location ${\mathbf{fjac}}[(\mathit{i}-1)\times \mathbf{st}\mathbf{\to}\mathbf{tdfjac}+\mathit{j}-1]$, for $\mathit{i}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{m}$ and $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$).
Contains the elements of the Jacobian matrix of nonlinear constraints at the initial point ${x}_{0}$ ($\frac{\partial {c}_{\mathit{i}}}{\partial {x}_{\mathit{j}}}$ is held at location ${\mathbf{options}}\mathbf{.}{\mathbf{conjac}}\left[(\mathit{i}-1)\times \mathbf{st}\mathbf{\to}\mathbf{n}+\mathit{j}-1\right]$, for $\mathit{i}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ and $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$).
In this case the details of any derivative check performed by e04unc are held in the following substructure of st:
gprint – Nag_GPrintSt **
Which in turn contains three substructures
$\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}$,
$\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{f\_sim}$,
$\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{c\_sim}$ and two pointers to arrays of substructures,
$\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{f\_comp}$ and
$\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{c\_comp}$.
g_chk – Nag_Grad_Chk_St *
The substructure $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}$ contains the members:
type – Nag_GradChk
The type of derivative check performed by e04unc. This will be the same value as in ${\mathbf{options}}\mathbf{.}{\mathbf{verify\_grad}}$.
g_error – Integer
This member will be equal to one of the error codes NE_NOERROR or NE_DERIV_ERRORS according to whether the derivatives were found to be correct or not.
obj_start – Integer
Specifies the column of the objective Jacobian at which any component check started. This value will be equal to ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_start}}$.
obj_stop – Integer
Specifies the column of the objective Jacobian at which any component check ended. This value will be equal to ${\mathbf{options}}\mathbf{.}{\mathbf{obj\_check\_stop}}$.
con_start – Integer
Specifies the element at which any component check of the constraint gradient started. This value will be equal to ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_start}}$.
con_stop – Integer
Specifies the element at which any component check of the constraint gradient ended. This value will be equal to ${\mathbf{options}}\mathbf{.}{\mathbf{con\_check\_stop}}$.
f_sim – Nag_SimSt *
The result of a simple derivative check of the objective gradient, $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}\mathbf{.}\mathbf{type}=\mathrm{Nag\_SimpleCheck}$, will be held in this substructure in members:
n_elements – Integer
The number of columns of the objective Jacobian for which a simple check has been carried out, i.e., those columns which do not contain unknown elements.
correct – Nag_Boolean
If Nag_TRUE then the objective Jacobian is consistent with the finite difference approximation according to a simple check.
max_error – double
The maximum error found between the norm of a subfunction gradient and its finite difference approximation.
max_subfunction – Integer
The subfunction which has the maximum error between its norm and its finite difference approximation.
c_sim – Nag_SimSt *
The result of a simple derivative check of the constraint Jacobian, $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}\mathbf{.}\mathbf{type}=\mathrm{Nag\_SimpleCheck}$, will be held in this substructure in members:
n_elements – Integer
The number of columns of the constraint Jacobian for which a simple check has been carried out, i.e., those columns which do not contain unknown elements.
correct – Nag_Boolean
If Nag_TRUE then the Jacobian is consistent with the finite difference approximation according to a simple check.
max_error – double
The maximum error found between the norm of a constraint gradient and its finite difference approximation.
max_constraint – Integer
The constraint gradient which has the maximum error between its norm and its finite difference approximation.
f_comp – Nag_CompSt **
The results of a requested component derivative check of the Jacobian of the objective function subfunctions, $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}\mathbf{.}\mathbf{type}=\mathrm{Nag\_CheckObj}\text{ or}\mathrm{Nag\_CheckObjCon}$, will be held in the array of $\mathbf{st}\mathbf{\to}\mathbf{m}\times \mathbf{st}\mathbf{\to}\mathbf{n}$ substructures of type Nag_CompSt pointed to by $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{f\_comp}$. The element $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{f\_comp}\left[(\mathit{i}-1)\times \mathbf{st}\mathbf{\to}\mathbf{n}+\mathit{j}-1\right]$ will hold the details of the component derivative check for Jacobian element $\mathit{i},\mathit{j}$, for $\mathit{i}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ and $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$. The procedure for the derivative check is based on finding an interval that produces an acceptable estimate of the second derivative, and then using that estimate to compute an interval that should produce a reasonable forward-difference approximation. The Jacobian element is then compared with the difference approximation. (The method of finite difference interval estimation is based on Gill et al. (1983).)
correct – Nag_Boolean
If Nag_TRUE then this gradient element is consistent with its finite difference approximation.
hopt – double
The optimal finite difference interval. This is dx[i] in the default derivative checking printout (see Section 12.3).
gdiff – double
The finite difference approximation for this component.
iter – Integer
The number of trials performed to find a suitable difference interval.
comment – char *
A character string which describes the possible nature of the reason for which an estimation of the finite difference interval failed to produce a satisfactory relative condition error of the second-order difference. Possible strings are: "Constant?", "Linear or odd?", "Too nonlinear?" and "Small derivative?".
c_comp – Nag_CompSt **
The results of a requested component derivative check of the Jacobian of nonlinear constraint functions, $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{g\_chk}\mathbf{.}\mathbf{type}=\mathrm{Nag\_CheckCon}\text{ or}\mathrm{Nag\_CheckObjCon}$, will be held in the array of $\mathbf{st}\mathbf{\to}\mathbf{ncnlin}\times \mathbf{st}\mathbf{\to}\mathbf{n}$ substructures of type Nag_CompSt pointed to by $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{c\_comp}$. The element $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{c\_comp}\left[(\mathit{i}-1)\times \mathbf{st}\mathbf{\to}\mathbf{n}+\mathit{j}-1\right]$ will hold the details of the component derivative check for Jacobian element $\mathit{i},\mathit{j}$, for $\mathit{i}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{ncnlin}$ and $\mathit{j}=1,2,\dots ,\mathbf{st}\mathbf{\to}\mathbf{n}$. The procedure for the derivative check is based on finding an interval that produces an acceptable estimate of the second derivative, and then using that estimate to compute an interval that should produce a reasonable forward-difference approximation. The Jacobian element is then compared with the difference approximation. (The method of finite difference interval estimation is based on Gill et al. (1983).)
The members of $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{c\_comp}$ are as for $\mathbf{st}\mathbf{\to}\mathbf{gprint}\mathbf{\to}\mathbf{f\_comp}$.
Will be Nag_TRUE only when the print function is called with the result of the derivative check of objfun and confun.
it_maj_prt – Nag_Boolean
Will be Nag_TRUE when the print function is called with information about the current major iteration.
sol_sqp_prt – Nag_Boolean
Will be Nag_TRUE when the print function is called with the details of the final solution.
it_prt – Nag_Boolean
Will be Nag_TRUE when the print function is called with information about the current minor iteration (i.e., an iteration of the current QP subproblem). See the documentation for e04ncc for details of which members of st are set.
new_lm – Nag_Boolean
Will be Nag_TRUE when the Lagrange multipliers have been updated in a QP subproblem. See the documentation for e04ncc for details of which members of st are set.
sol_prt – Nag_Boolean
Will be Nag_TRUE when the print function is called with the details of the solution of a QP subproblem, i.e., the solution at the end of a major iteration. See the documentation for e04ncc for details of which members of st are set.
user – double *
iuser – Integer *
p – Pointer
Pointers for communication of user information. If used they must be allocated memory either before entry to e04unc or during a call to objfun, confun or ${\mathbf{options}}\mathbf{.}{\mathbf{print\_fun}}$. The type Pointer will be void * with a C compiler that defines void * and char * otherwise.