|
NAG[e04ucc] NAG[nag_opt_nlp] - Minimization with nonlinear constraints using a sequential QP method
|
|
Calling Sequence
e04ucc(ncnlin, a, bl, bu, objfun, confun, x, objf, g, 'n'=n, 'nclin'=nclin, 'tda'=tda, 'optional_settings'=optional_settings, 'comm'=comm, 'fail'=fail)
nag_opt_nlp(. . .)
Parameters
|
ncnlin - integer;
|
|
|
On entry: , the number of nonlinear constraints.
|
|
Constraint: . .
|
|
|
a - Matrix(1..nclin, 1..tda, datatype=float[8], order=C_order);
|
|
|
If then the array a is not referenced.
|
|
|
bl - Vector(1.. , datatype=float[8]);
bu - Vector(1.. , datatype=float[8]);
|
|
|
On entry: bl must contain the lower bounds and bu the upper bounds, for all the constraints in the following order. The first elements of each array must contain the bounds on the variables, the next elements the bounds for the general linear constraints (if any), and the next elements the bounds for the nonlinear constraints (if any). To specify a non-existent lower bound (i.e., ), set , and to specify a non-existent upper bound (i.e., ), set , where optional_settings[inf_bound] is one of the optional arguments (default value , see Section [The optional-settings Parameter]). To specify the th constraint as an equality, set , say, where .
|
|
, for ;
|
|
if , .
|
|
|
objfun - procedure;
|
|
|
objfun(n, x, objf, g, comm)
|
|
n - integer;
|
|
|
On entry: , the number of variables.
|
|
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On entry: , the vector of variables at which the value of and/or all available elements of its gradient are to be evaluated.
|
|
|
objf - assignable;
|
|
|
Note: On exit the variable objf will have a value of type float.
|
|
|
g - Vector(1..n, datatype=float[8]);
|
|
|
On exit: if , g must contain the elements of the vector given by
|
|
|
comm - table;
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
On entry: objfun is called with set to 0 or 2.
|
|
If then only objf is referenced.
|
|
If then both objf and g are referenced.
|
|
On exit: if objfun resets to some negative number then nag_opt_nlp (e04ucc) will terminate immediately with the error indicator NE_USER_STOP.
|
|
On entry: will be set to true on the first call to objfun and false for all subsequent calls.
|
|
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.
|
|
Before calling nag_opt_nlp (e04ucc) this field may be initialized for use by objfun when called from nag_opt_nlp (e04ucc).
|
|
|
Note: objfun should be tested separately before being used in conjunction with nag_opt_nlp (e04ucc). The optional arguments optional_settings[verify_grad] and optional_settings[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 gradient elements then the optional argument optional_settings[obj_deriv] should be set to false.
|
|
|
confun - procedure;
|
|
|
confun(n, ncnlin, needc, x, conf, conjac, comm)
|
|
n - integer;
|
|
|
On entry: , the number of variables.
|
|
|
ncnlin - integer;
|
|
|
On entry: , the number of nonlinear constraints.
|
|
|
needc - Vector(1..ncnlin, datatype=integer[kernelopts('wordsize')/8]);
|
|
|
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On entry: the vector of variables at which the constraint functions and/or all available elements of the constraint Jacobian are to be evaluated.
|
|
|
conf - Vector(1..ncnlin, datatype=float[8]);
|
|
|
|
conjac - Vector(1.. , datatype=float[8]);
|
|
|
If all elements of the constraint Jacobian are known (i.e., ; see Section [The optional-settings Parameter]), 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 .
|
|
It must be emphasized that, if , unassigned elements of conjac are not treated as constant; they are estimated by finite differences, at non-trivial expense. If the user does not supply a value for the optional argument optional_settings[f_diff_int] (the default; see Section [The optional-settings Parameter]), an interval for each element of 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.
|
|
|
comm - table;
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
On entry: confun is called with set to 0 or 2.
|
|
If then only conf is referenced.
|
|
If then both conf and conjac are referenced.
|
|
On exit: if confun resets to some negative number then nag_opt_nlp (e04ucc) will terminate immediately with the error indicator NE_USER_STOP.
|
|
On entry: will be set to true on the first call to confun and false for all subsequent calls.
|
|
Before calling nag_opt_nlp (e04ucc) this field may be initialized for use by confun when called from nag_opt_nlp (e04ucc).
|
|
|
Note: confun should be tested separately before being used in conjunction with nag_opt_nlp (e04ucc). The optional arguments optional_settings[verify_grad] and optional_settings[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 elements of the constraint gradients then the optional argument optional_settings[con_deriv] should be set to false.
|
|
|
x - Vector(1..n, datatype=float[8]);
|
|
|
On entry: an initial estimate of the solution.
|
|
On exit: the final estimate of the solution.
|
|
|
objf - assignable;
|
|
|
Note: On exit the variable objf will have a value of type float.
|
|
On exit: the value of the objective function at the final iterate.
|
|
|
g - Vector(1..n, datatype=float[8]);
|
|
|
On exit: the gradient of the objective function at the final iterate (or its finite difference approximation).
|
|
|
'n'=n - integer; (optional)
|
|
|
Default value: the first dimension of the arrays x, g.
|
|
On entry: , the number of variables.
|
|
Constraint: . .
|
|
|
'nclin'=nclin - integer; (optional)
|
|
|
Default value: the first dimension of the array a.
|
|
On entry: , the number of general linear constraints.
|
|
Constraint: . .
|
|
|
'tda'=tda - integer; (optional)
|
|
|
On entry: the second dimension of the array a as declared in the function from which nag_opt_nlp (e04ucc) is called.
|
|
Constraint: if , . .
|
|
|
'optional_settings'=optional_settings - Vector; (optional)
|
|
|
|
'comm'=comm - table; (optional)
|
|
|
A Maple table, which should be generated using NAG[Nag_Comm], corresponding to the Nag_Comm structure.
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_opt_nlp (e04ucc) is designed to minimize an arbitrary smooth function subject to constraints (which may include simple bounds on the variables, linear constraints and smooth nonlinear constraints) using a sequential quadratic programming (SQP) method. As many first derivatives as possible should be supplied by the user; any unspecified derivatives are approximated by finite differences. It is not intended for large sparse problems.
nag_opt_nlp (e04ucc) may also be used for unconstrained, bound-constrained and linearly constrained optimization.
|
|
Description
|
|
nag_opt_nlp (e04ucc) is designed to solve the nonlinear programming problem – the minimization of a smooth nonlinear function subject to a set of constraints on the variables. The problem is assumed to be stated in the following form:
(1)
where (the objective function) is a nonlinear function, is an by constant matrix, and is an element vector of nonlinear constraint functions. (The matrix and the vector 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 nag_opt_nlp (e04ucc) 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 . If certain bounds are not present, the associated elements of or can be set to special values that will be treated as or . (See the description of the optional argument optional_settings[inf_bound] in Section [The optional-settings Parameter].)
If there are no nonlinear constraints in (1) and is linear or quadratic, then one of e04mfc (nag_opt_lp), e04ncc (nag_opt_lin_lsq) or e04nfc (nag_opt_qp) will generally be more efficient.
The user must supply an initial estimate of the solution to (1), together with functions that define and as many first partial derivatives as possible; unspecified derivatives are approximated by finite differences.
The objective function is defined by function objfun, and the nonlinear constraints are defined by function confun. On every call, these functions must return appropriate values of the objective and nonlinear constraints. The user should also provide the available partial derivatives. Any unspecified derivatives are approximated by finite differences; see Section [The optional-settings Parameter] for a discussion of the optional arguments optional_settings[obj_deriv] and optional_settings[con_deriv]. Just before either objfun or confun is called, each element of the current gradient array g 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 the user 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 argument optional_settings[verify_grad] (see Section [The optional-settings Parameter]) should be used to check the calculation of any known gradients.
The method used by nag_opt_nlp (e04ucc) is described in detail in Section [Further Description ].
|
|
Error Indicators and Warnings
|
|
"NE_2_INT_OPT_ARG_CONS"
On entry, while . Constraint: .
"NE_ALLOC_FAIL"
Dynamic memory allocation failed.
"NE_BAD_PARAM"
On entry, argument optional_settings[print_level] had an illegal value.
"NE_BOUND"
The lower bound for variable (array element ) is greater than the upper bound.
"NE_BOUND_EQ"
The lower bound and upper bound for variable (array elements and ) are equal but they are greater than or equal to optional_settings[inf_bound].
"NE_BOUND_EQ_LCON"
The lower bound and upper bound for linear constraint (array elements and ) are equal but they are greater than or equal to optional_settings[inf_bound].
"NE_BOUND_EQ_NLCON"
The lower bound and upper bound for nonlinear constraint (array elements and ) are equal but they are greater than or equal to optional_settings[inf_bound].
"NE_BOUND_LCON"
The lower bound for linear constraint (array element ) is greater than the upper bound.
"NE_BOUND_NLCON"
The lower bound for nonlinear constraint (array element ) 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. The user should refer to the printed output to determine which elements are suspected to be in error. As a first-step, the user 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 or are used to test function evaluation procedures, and how often the special properties of these numbers make the test meaningless. Gradient checking will be ineffective if the objective function uses information computed by the constraints, since they are not necessarily computed prior to each function evaluation. 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, n must not be less than 1: .
"NE_INT_OPT_ARG_GT"
On entry, . Constraint: .
"NE_INT_OPT_ARG_LT"
On entry, . Constraint: .
"NE_INVALID_INT_RANGE_1"
Value given to optional_settings[max_iter] not valid. Correct range is .
"NE_INVALID_REAL_RANGE_EF"
Value given to optional_settings[f_prec] not valid. Correct range is .
"NE_INVALID_REAL_RANGE_F"
Value given to optional_settings[step_limit] not valid. Correct range is .
"NE_INVALID_REAL_RANGE_FF"
Value given to optional_settings[linesearch_tol] not valid. Correct range is .
"NE_NOT_APPEND_FILE"
Cannot open file for appending.
"NE_NOT_CLOSE_FILE"
Cannot close file .
"NE_OPT_NOT_INIT"
Options structure not initialized.
"NE_STATE_VAL"
is out of range. .
"NW_LIN_NOT_FEASIBLE"
No feasible point was found for the linear constraints and bounds. nag_opt_nlp (e04ucc) 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 argument optional_settings[lin_feas_tol] (default value , where is the machine precision; see Section [The optional-settings Parameter]), or no feasible point could be found in the number of iterations specified by the optional argument optional_settings[minor_max_iter] (default value ; see Section [The optional-settings Parameter]). The user should check that there are no constraint redundancies. If the data for the constraints are accurate only to an absolute precision , the user should ensure that the value of the optional argument optional_settings[lin_feas_tol] is greater than . For example, if all elements of are of order unity and are accurate to only three decimal places, optional_settings[lin_feas_tol] should be at least .
"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 [Description of Printed Output ]). 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. The user should check the validity of constraints with negative values of the optional argument optional_settings[state]. If the user is convinced that a feasible point does exist, nag_opt_nlp (e04ucc) should be restarted at a different starting point.
"NW_OVERFLOW_WARN"
Serious ill conditioning in the working set after adding constraint . 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 argument optional_settings[lin_feas_tol] (default value , where is the machine precision; see Section [The optional-settings Parameter]) and/or the optional argument optional_settings[nonlin_feas_tol] (default value or ; see Section [The optional-settings Parameter]), and rerunning the program. If the message recurs even after this change, the offending linearly dependent constraint 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 and ).
|
|
Accuracy
|
|
If no error is raised on exit, then the vector returned in the array x is an estimate of the solution to an accuracy of approximately optional_settings[optim_tol] (default value , where is the relative precision of ; see Section [The optional-settings Parameter]).
|
|
Further Comments
|
|
|
Termination Criteria
|
|
The function exits with no error is raised if iterates have converged to a point that satisfies the Kuhn–Tucker conditions (see Section [Overview ]) to the accuracy requested by the optional argument optional_settings[optim_tol] (default value , see Section [The optional-settings Parameter]).
The user should also examine the printout from nag_opt_nlp (e04ucc) (see Section [Description of Printed Output ] or Section [Description of Printed Output ]) to check whether the following four conditions are satisfied:
|
the final value of Norm Gz is significantly less than at the starting point;
|
|
during the final major iterations, the values of Step and Mnr are both one;
|
|
the last few values of both Violtn and Norm Gz become small at a fast linear rate; and
|
If all these conditions hold, is almost certainly a local minimum.
|
|
|
Further Description
|
|
This section gives a detailed description of the algorithm used in nag_opt_nlp (e04ucc). This, and possibly the next section, Section [Optional Arguments ], may be omitted if the more sophisticated features of the algorithm and software are not currently of interest.
|
Overview
|
|
nag_opt_nlp (e04ucc) is based on the same algorithm as used in subroutine NPSOL described in Gill et al. (1986c).
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 denote the by matrix of gradients of the active general linear and nonlinear constraints. The number of fixed variables will be denoted by , with 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 is a first-order Kuhn–Tucker point for (1) (see, e.g., Powell (1974)) if the following conditions hold:
|
is feasible;
|
|
there exist vectors and (the Lagrange multiplier vectors for the bound and general constraints) such that
|
|
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 denote a matrix whose columns form a basis for the set of vectors orthogonal to the rows of ; i.e., . An equivalent statement of the condition (2) in terms of is
The vector is termed the projected gradient of at . 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)). nag_opt_nlp (e04ucc) 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 nag_opt_nlp (e04ucc) involves major and minor iterations. The major iterations generate a sequence of iterates that converge to , a first-order Kuhn–Tucker point of (1). At a typical major iteration, the new iterate is defined by
(3)
where is the current iterate, the non-negative scalar is the step length, and 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 in (3) is the solution of a quadratic programming subproblem of the form
(4)
where is the gradient of at , the matrix is a positive-definite quasi-Newton approximation to the Hessian of the Lagrangian function (see Section [The Quasi-Newton Update ]), and is the Jacobian matrix of evaluated at . (Finite difference estimates may be used for and ; see the optional arguments optional_settings[obj_deriv] and optional_settings[con_deriv] in Section [The optional-settings Parameter].) Let in (1) be partitioned into three sections: , and , corresponding to the bound, linear and nonlinear constraints. The vector in (4) is similarly partitioned, and is defined as
where is the vector of nonlinear constraints evaluated at . The vector 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 nag_opt_nlp (e04ucc); see Section [Description of Printed Output ].) In nag_opt_nlp (e04ucc), (4) is solved using the same algorithm as used in function e04ncc (nag_opt_lin_lsq). Since solving a quadratic program is an iterative procedure, the minor iterations of nag_opt_nlp (e04ucc) are the iterations of e04ncc (nag_opt_lin_lsq). (More details about solving the subproblem are given in Section [Solution of the Quadratic Programming Subproblem ].)
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 denote the by matrix of gradients of the general linear and nonlinear constraints in the predicted active set. First, we have available the factorization of :
(5)
where is a non-singular by reverse-triangular matrix (i.e., if , and the non-singular by matrix is the product of orthogonal transformations (see Gill et al. (1984a)). Second, we have the upper triangular Cholesky factor of the transformed and re-ordered Hessian matrix
(6)
where is the Hessian with rows and columns permuted so that the free variables are first, and is the by matrix
(7)
with the identity matrix of order . If the columns of are partitioned so that
the columns of form a basis for the null space of . The matrix is used to compute the projected gradient at the current iterate. (The values Nz, Norm Gf and Norm Gz printed by nag_opt_nlp (e04ucc) give and the norms of and ; see Section [Description of Printed Output ].)
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 . In nag_opt_nlp (e04ucc), 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 nag_opt_nlp (e04ucc) also saves computation in factorizing and .
Once has been computed, the major iteration proceeds by determining a step length that produces a "sufficient decrease" in an augmented Lagrangian merit function (see Section [The Merit Function ]). Finally, the approximation to the transformed Hessian matrix is updated using a modified BFGS quasi-Newton update (see Section [The Quasi-Newton Update ]) to incorporate new curvature information obtained in the move from to .
On entry to nag_opt_nlp (e04ucc), an iterative procedure from e04ncc (nag_opt_lin_lsq) 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 optional_settings[lin_feas_tol]; see Section [The optional-settings Parameter]). If no feasible point exists for the bound and linear constraints, (1) has no solution and nag_opt_nlp (e04ucc) 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 optional_settings[f_diff_int] in Section [The optional-settings Parameter]). 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 argument optional_settings[verify_grad] in Section [The optional-settings Parameter]). In general, the check is provided at the first point that is feasible with respect to the linear constraints and bounds. However, the user may request that the check be performed at the initial point.
In summary, the method of nag_opt_nlp (e04ucc) first determines a point that satisfies the bound and linear constraints. Thereafter, each iteration includes:
|
b. a linesearch with an augmented Lagrangian merit function (see Section [The Merit Function ]); and
|
|
c. a quasi-Newton update of the approximate Hessian of the Lagrangian function (Section [The Quasi-Newton Update ]).
|
|
|
Solution of the Quadratic Programming Subproblem
|
|
The search direction is obtained by solving (4) using the algorithm of e04ncc (nag_opt_lin_lsq) (see Gill et al. (1986a)), which was specifically designed to be used within an SQP algorithm for nonlinear programming.
The method of e04ncc (nag_opt_lin_lsq) 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 denote the current estimate of the solution of 4; the new iterate is defined by
(8)
where, as in (3), is a non-negative step length and is a search direction.
At the beginning of each iteration of e04ncc (nag_opt_lin_lsq), a working set is defined of constraints (general and bound) that are satisfied exactly. The vector is then constructed so that the values of constraints in the working set remain unaltered for any move along . For a bound constraint in the working set, this property is achieved by setting the corresponding element of 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.
Let denote the sub-matrix of rows of
corresponding to general constraints in the working set. The general constraints in the working set will remain unaltered if
(9)
which is equivalent to defining as
(10)
for some vector , where is the matrix associated with the factorization (5) of .
The definition of in (10) depends on whether the current is feasible. If not, is zero except for a element in the th position, where and are chosen so that the sum of infeasibilities is decreasing along . (For further details, see Gill et al. (1986a).) In the feasible case, satisfies the equations
(11)
where is the Cholesky factor of and is the gradient of the quadratic objective function . (The vector is the projected gradient of the QP.) With (11), 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 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 of the order of the machine precision, the Lagrange multiplier corresponding to an inequality constraint in the working set at its upper bound is said to be optimal if when the th constraint is at its upper bound, or if 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 non-zero, no feasible point exists. The QP algorithm will then continue iterating to determine the minimum sum of infeasibilities. At this point, the Lagrange multiplier will satisfy for an inequality constraint at its upper bound, and for an inequality at its lower bound. The Lagrange multiplier for an equality constraint will satisfy .
The choice of step length in the QP iteration (8) is based on remaining feasible with respect to the satisfied constraints. During the optimality phase, if is feasible, will be taken as unity. (In this case, the projected gradient at will be zero.) Otherwise, is set to , 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 : if the status of a general constraint changes, a row of is altered; if a bound constraint enters or leaves the working set, a column of changes. Explicit representations are recurred of the matrices , and , and of the vectors and .
|
|
The Quasi-Newton Update
|
|
The matrix 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 is defined as a rank-two modification of . In nag_opt_nlp (e04ucc), the BFGS quasi-Newton update is used:
(13)
where (the change in ).
In nag_opt_nlp (e04ucc), is required to be positive-definite. If is positive-definite, defined by (13) will be positive-definite if and only if is positive (see, e.g., Dennis and Moré (1977)). Ideally, in (13) would be taken as , the change in gradient of the Lagrangian function
(14)
where denotes the QP multipliers associated with the nonlinear constraints of the original problem. If is not sufficiently positive, an attempt is made to perform the update with a vector of the form
where . If no such vector can be found, the update is performed with a scaled ; in this case, M is printed to indicate that the update was modified.
Rather than modifying itself, the Cholesky factor of the transformed Hessian (6) is updated, where is the matrix from (5) associated with the active set of the QP subproblem. The update (12) is equivalent to the following update to :
(15)
where , and . This update may be expressed as a rank-one update to (see Dennis and Schnabel (1981)).
|
|
|
The optional_settings Parameter
|
|
Further information and examples on setting and using vectors of this type are available, see the documentation for NAG[SetOptions], NAG[GetOptions], NAG[FreeOptions] and NAG[Nag_E04_Opt].
|
start - String;
|
|
Default
|
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 , nag_opt_nlp (e04ucc) 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 optional argument optional_settings[crash_tol]; see below).
|
|
Constraint: "Nag_Cold" or "Nag_Warm". .
|
|
|
list - boolean;
|
|
Default
|
On entry: if the argument settings in the call to nag_opt_nlp (e04ucc) will be printed.
|
|
|
print_level - String;
|
|
Default
|
On entry: the level of results printout produced by nag_opt_nlp (e04ucc) at each major iteration. The following values are available:
|
|
"Nag_Soln" The final solution only.
|
|
"Nag_Iter" One line of output for each iteration.
|
|
"Nag_Iter_Long" A longer line of output for each iteration with more information (line exceeds 80 characters).
|
|
"Nag_Soln_Iter" The final solution and one line of output for each iteration.
|
|
"Nag_Soln_Iter_Long" The final solution and one long line of output for each iteration (line exceeds 80 characters).
|
|
"Nag_Soln_Iter_Const" As "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, , and the linear constraint values also printed at each iteration.
|
|
Constraint: "Nag_NoPrint", "Nag_Soln", "Nag_Iter", "Nag_Soln_Iter", "Nag_Iter_Long", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full". .
|
|
|
minor_print_level - String;
|
|
Default
|
On entry: the level of results printout produced by the minor iterations of nag_opt_nlp (e04ucc) (i.e., the iterations of the QP subproblem). The following values are available:
|
|
"Nag_Soln" The final solution only.
|
|
"Nag_Iter" One line of output for each iteration.
|
|
"Nag_Iter_Long" A longer line of output for each iteration with more information (line exceeds 80 characters).
|
|
"Nag_Soln_Iter" The final solution and one line of output for each iteration.
|
|
"Nag_Soln_Iter_Long" The final solution and one long line of output for each iteration (line exceeds 80 characters).
|
|
"Nag_Soln_Iter_Const" As "Nag_Soln_Iter_Long" with the Lagrange multipliers, the variables , the constraint values and the constraint status also printed at each iteration.
|
|
Details of each level of results printout are described in Section [Optional Arguments] of the document for e04ncc (nag_opt_lin_lsq). (minor_print_level in the present function is equivalent to optional_settings[print_level].)
|
|
Constraint: "Nag_NoPrint", "Nag_Soln", "Nag_Iter", "Nag_Soln_Iter", "Nag_Iter_Long", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full". .
|
|
|
outfile - Vector(datatype=string);
|
|
|
On entry: The name of a file to which intermediate or diagnostic output should be appended. If a value is not provided for this parameter then the behaviour of this routine is platform dependent. Usually all output will be suppressed, however on some platforms output will be produced and will be displayed in the Maple session.
|
|
|
obj_deriv - boolean;
|
|
Default
|
On entry: this argument indicates whether all the derivatives of the objective function are provided by the user in function objfun. If none or only some of the derivatives are being supplied by objfun then obj_deriv should be set to false.
|
|
Whenever possible all derivatives should be supplied, since nag_opt_nlp (e04ucc) is more reliable and will usually be more efficient when all derivatives are exact.
|
|
If , nag_opt_nlp (e04ucc) will approximate the unspecified components of the objective gradient, 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 Chapter 8 of Gill et al. (1986c), 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 the user's control.)
|
|
|
con_deriv - boolean;
|
|
Default
|
On entry: this argument indicates whether all derivatives for the constraint Jacobian are provided by the user in function confun. If none or only some of the derivatives are being supplied by confun then con_deriv should be set to false.
|
|
Whenever possible all derivatives should be supplied, since nag_opt_nlp (e04ucc) is more reliable and will usually be more efficient when all derivatives are exact.
|
|
If , nag_opt_nlp (e04ucc) will approximate unspecified elements of the 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 "*" indicates an element provided by the user and "?" indicates an unspecified element, nag_opt_nlp (e04ucc) 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 the user's control.)
|
|
|
verify_grad - String;
|
|
Default
|
On entry: specifies the level of derivative checking to be performed by nag_opt_nlp (e04ucc) on the gradient elements computed by the user supplied functions objfun and confun.
|
|
The following values are available:
|
|
"Nag_NoCheck" No derivative checking is performed.
|
|
"Nag_SimpleCheck" Perform a simple check of both the objective and constraint gradients.
|
|
"Nag_CheckObj" Perform a component check of the objective gradient elements.
|
|
"Nag_CheckCon" Perform a component check of the constraint gradient elements.
|
|
"Nag_CheckObjCon" Perform a component check of both the objective and constraint gradient elements.
|
|
"Nag_XSimpleCheck" Perform a simple check of both the objective and constraint gradients at the initial value of specified in x.
|
|
"Nag_XCheckObj" Perform a component check of the objective gradient elements at the initial value of specified in x.
|
|
"Nag_XCheckCon" Perform a component check of the constraint gradient elements at the initial value of specified in x.
|
|
"Nag_XCheckObjCon" Perform a component check of both the objective and constraint gradient elements at the initial value of specified in x.
|
|
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. (1983a).) The result of the test is printed out by nag_opt_nlp (e04ucc) if optional argument .
|
|
Constraint: "Nag_NoCheck", "Nag_SimpleCheck", "Nag_CheckObj", "Nag_CheckCon", "Nag_CheckObjCon", "Nag_XSimpleCheck", "Nag_XCheckObj", "Nag_XCheckCon" or "Nag_XCheckObjCon". .
|
|
|
print_deriv - String;
|
|
Default
|
On entry: controls whether the results of any derivative checking are printed out (see optional argument optional_settings[verify_grad]).
|
|
Constraint: "Nag_D_NoPrint", "Nag_D_Sum" or "Nag_D_Full". .
|
|
|
obj_check_start - integer;
obj_check_stop - integer;
|
|
Default
Default
|
These options take effect only when "Nag_CheckObj", "Nag_CheckObjCon", "Nag_XCheckObj" or "Nag_XCheckObjCon".
|
|
On entry: they may be used to control the verification of gradient elements computed by the function objfun. For example, if the first 30 elements appeared to be correct in an earlier run, so that only element 31 remains questionable, it is reasonable to specify . If the first 30 variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.
|
|
Constraint: . .
|
|
|
con_check_start - integer;
con_check_stop - integer;
|
|
Default
Default
|
These options take effect only when "Nag_CheckCon", "Nag_CheckObjCon", "Nag_XCheckCon" or "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 .
|
|
Constraint: . .
|
|
|
f_diff_int - float;
|
|
Default
|
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 argument optional_settings[verify_grad]).
|
|
b. For estimating unspecified elements of the objective and/or constraint Jacobian matrix.
|
|
If a difference interval is not specified by the user, 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 the user wishes to have nag_opt_nlp (e04ucc) determine constant elements in the objective and constraint gradients (see the descriptions of confun and objfun in Section [Parameters]).
|
|
Constraint: . .
|
|
|
c_diff_int - float;
|
|
Default
|
On entry: if the algorithm switches to central differences because the forward-difference approximation is not sufficiently accurate the value of c_diff_int is used as the difference interval for every element of . 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 [Description of Printed Output ]). The use of finite-differences is discussed under the option optional_settings[f_diff_int].
|
|
Constraint: . .
|
|
|
max_iter - integer;
|
|
Default
|
On entry: the maximum number of major iterations allowed before termination.
|
|
Constraint: . .
|
|
|
minor_max_iter - integer;
|
|
Default
|
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.
|
|
Constraint: . .
|
|
|
f_prec - float;
|
|
Default
|
Constraint: . .
|
|
|
optim_tol - float;
|
|
Default
|
On entry: specifies the accuracy to which the user wishes the final iterate to approximate a solution of the problem. Broadly speaking, optim_tol indicates the number of correct figures desired in the objective function at the solution. For example, if optim_tol is and nag_opt_nlp (e04ucc) terminates successfully, the final value of should have approximately six correct figures.
|
|
nag_opt_nlp (e04ucc) will terminate successfully if the iterative sequence of -values is judged to have converged and the final point satisfies the first-order Kuhn–Tucker conditions (see Section [Overview ]). The sequence of iterates is considered to have converged at if
|
|
Constraint: . .
|
|
|
lin_feas_tol - float;
|
|
Default
|
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 lin_feas_tol.
|
|
On entry to nag_opt_nlp (e04ucc), 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 lin_feas_tol. All subsequent iterates will satisfy the constraints to within the same tolerance (unless 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 lin_feas_tol as .
|
|
Constraint: . .
|
|
|
nonlin_feas_tol - float;
|
|
Default
|
On entry: defines the maximum acceptable violations in the nonlinear constraints at a "feasible" point; i.e., a nonlinear constraint is considered satisfied if its violation does not exceed nonlin_feas_tol.
|
|
The 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 nonlin_feas_tol acts as a partial termination criteria for the iterative sequence generated by nag_opt_nlp (e04ucc) (see the discussion of optional_settings[optim_tol] ).
|
|
This tolerance should reflect the precision of the nonlinear constraint functions calculated by confun.
|
|
Constraint: . .
|
|
|
linesearch_tol - float;
|
|
Default
|
On entry: controls the accuracy with which the step taken during each iteration approximates a minimum of the merit function along the search direction (the smaller the value of 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.
|
|
Constraint: . .
|
|
|
step_limit - float;
|
|
Default
|
where is the value of step_limit.
|
|
Wherever possible, upper and lower bounds on should be used to prevent evaluation of nonlinear functions at wild values. The default value of 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 step_limit is selected, a good starting point may be required. An important application is to the class of nonlinear least-squares problems.
|
|
Constraint: . .
|
|
|
crash_tol - float;
|
|
Default
|
Constraint: . .
|
|
|
inf_bound - float;
|
|
Default
|
On entry: inf_bound defines the "infinite" bound in the definition of the problem constraints. Any upper bound greater than or equal to inf_bound will be regarded as plus infinity (and similarly any lower bound less than or equal to will be regarded as minus infinity).
|
|
Constraint: . .
|
|
|
inf_step - float;
|
|
Default
|
On entry: inf_step specifies the magnitude of the change in variables that will be considered a step to an unbounded solution. If the change in during an iteration would exceed the value of inf_step, the objective function is considered to be unbounded below in the feasible region.
|
|
Constraint: . .
|
|
|
conf - assignable;
|
|
Default
|
Note: On exit the variable conf will have a value of type float.
|
|
On entry: ncnlin values of memory will be automatically allocated by nag_opt_nlp (e04ucc) and this is the recommended method of use of conf. However a user may supply memory from the calling program.
|
|
If then conf will not be referenced.
|
|
|
conjac - assignable;
|
|
Default
|
Note: On exit the variable conjac will have a value of type float.
|
|
On entry: ncnlin*n values of memory will be automatically allocated by nag_opt_nlp (e04ucc) and this is the recommended method of use of conjac. However a user may supply memory from the calling program.
|
|
If then conjac will not be referenced.
|
|
|
state - assignable;
|
|
Default
|
Note: On exit the variable state will have a value of type integer.
|
|
On entry: state need not be set if the default option of is used as values of memory will be automatically allocated by nag_opt_nlp (e04ucc).
|
|
When a "warm start" is chosen 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 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 are as follows:
|
|
|
|
|
The corresponding constraint is not in the initial QP working set.
|
|
|
|
This inequality constraint should be in the initial working set at its lower bound.
|
|
|
|
This inequality constraint should be in the initial working set at its upper bound.
|
|
|
|
This equality constraint should be in the initial working set. This value must only be specified if .
|
|
|
|
|
The values , 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 nag_opt_nlp (e04ucc) has been called previously with the same values of n, nclin and ncnlin, then state already contains satisfactory information. (See also the description of the optional argument optional_settings[start].) The function also adjusts (if necessary) the values supplied in x to be consistent with the values supplied in state.
|
|
Constraint: , for . .
|
|
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 is as follows:
|
|
|
|
|
The constraint violates its lower bound by more than the appropriate feasibility tolerance (see the options optional_settings[lin_feas_tol] and optional_settings[nonlin_feas_tol]). This value can occur only when no feasible point can be found for a QP subproblem.
|
|
|
|
The constraint violates its upper bound by more than the appropriate feasibility tolerance (see the options optional_settings[lin_feas_tol] and optional_settings[nonlin_feas_tol]). This value can occur only when no feasible point can be found for a QP subproblem.
|
|
|
|
The constraint is satisfied to within the feasibility tolerance, but is not in the QP working set.
|
|
|
|
This inequality constraint is included in the QP working set at its lower bound.
|
|
|
|
This inequality constraint is included in the QP working set at its upper bound.
|
|
|
|
This constraint is included in the working set as an equality. This value of state can occur only when .
|
|
|
|
|
|
lambda - assignable;
|
|
Default
|
Note: On exit the variable lambda will have a value of type float.
|
|
On entry: lambda need not be set if the default option of is used as values of memory will be automatically allocated by nag_opt_nlp (e04ucc).
|
|
|
h - assignable;
|
|
Default
|
Note: On exit the variable h will have a value of type float.
|
|
On entry: h need not be set if the default option of is used, as values of memory will be automatically allocated by nag_opt_nlp (e04ucc).
|
|
|
hessian - boolean;
|
|
Default
|
|
iter - assignable;
|
|
|
Note: On exit the variable iter will have a value of type integer.
|
|
On exit: the number of major iterations which have been performed in nag_opt_nlp (e04ucc).
|
|
|
nf - assignable;
|
|
|
Note: On exit the variable nf will have a value of type 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.
|
|
|
Description of Printed Output
|
|
The level of printed output can be controlled by the user with the structure members optional_settings[list], optional_settings[print_deriv], optional_settings[print_level] and optional_settings[minor_print_level] (see Section [The optional-settings Parameter]). If then the argument values to nag_opt_nlp (e04ucc) are listed, followed by the result of any derivative check if "Nag_D_Sum" or "Nag_D_Full". The printout of results is governed by the values of optional_settings[print_level] and optional_settings[minor_print_level]. The default of and 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 nag_opt_nlp (e04ucc).
If a simple derivative check, , is requested then a statement indicating success or failure is given. The largest error found in the constraint Jacobian is output together with the directional derivative, , of the objective gradient and its finite difference approximation, where is a random vector of unit length.
When a component derivative check (see optional_settings[verify_grad] in Section [The optional-settings Parameter]) is selected the element with the largest relative error is identified for the objective gradient and the constraint Jacobian.
If the value of then the following results are printed for each component:
|
x[i] the element of .
|
|
dx[i] the optimal finite difference interval.
|
|
g[i] or Jacobian value the gradient/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 gradient/Jacobian element and finite difference approximation are in agreement. If the derivatives are believed to be in error nag_opt_nlp (e04ucc) will exit with the error "NE_DERIV_ERRORS" is raised.
When "Nag_Iter" or "Nag_Soln_Iter" the following line of output is produced at every 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 [Further Description ]).
|
|
Note that Mnr may be greater than the optional argument optional_settings[minor_max_iter] (default value ; see Section [The optional-settings Parameter]) 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 (12) at the current iterate. This function will decrease at each iteration unless it was necessary to increase the penalty arguments (see Section [The Merit Function ]). 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 arguments. 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 nag_opt_nlp (e04ucc) terminates with the error "NW_NONLIN_NOT_FEASIBLE" is raised (no feasible point could be found for the nonlinear constraints).
|
|
If no nonlinear constraints are present (i.e., ), this entry contains Objective, the value of the objective function . 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 , the Euclidean norm of the projected gradient (see Section [Overview ]). Norm Gz will be approximately zero in the neighbourhood of a solution.
|
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 [The Quasi-Newton Update ]).
|
|
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 non-zero, central differences were computed because Norm Gz and Violtn imply that is close to a Kuhn–Tucker point (see Section [Overview ]).
|
|
L is printed if the line search has produced a relative change in greater than the value defined by the optional argument optional_settings[step_limit] (default value ; see Section [The optional-settings Parameter]). If this output occurs frequently during later iterations of the run, optional_settings[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 indicates that the approximate Hessian is badly conditioned, the approximate Hessian is refactorized using column interchanges. If necessary, is modified so that its diagonal condition estimator is bounded.
|
If "Nag_Iter_Long", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "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 (see Section [Overview ]). The value of Nz is the number of variables minus the number of constraints in the predicted active set; i.e., .
|
|
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 arguments used in the augmented Lagrangian merit function (not printed if ncnlin is zero).
|
|
Norm Gf is the Euclidean norm of , 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 .
|
|
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 argument optional_settings[optim_tol] in Section [The optional-settings Parameter]. 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 nag_opt_nlp (e04ucc) terminates with the error indicator no error raised , the user should check the solution carefully.
|
When "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full" more detailed results are given at each iteration. If these additional values are: the value of 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 ); and the values of the linear constraints, (the vector ).
If then the diagonal elements of the matrix associated with the factorization (5) of the QP working set and the diagonal elements of , the triangular factor of the transformed and re-ordered Hessian (6) (see Section [Overview ]) are also output at each iteration.
When "Nag_Soln", "Nag_Soln_Iter", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "Nag_Soln_Iter_Full" the final printout from nag_opt_nlp (e04ucc) 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 , for 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 arguments optional_settings[lin_feas_tol] and optional_settings[nonlin_feas_tol] (see Section [The optional-settings Parameter]), 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 optional_settings[lin_feas_tol].
|
|
Value is the value of the variable at the final iteration.
|
|
Lower bound is the lower bound specified for the variable . (None indicates that , where optional_settings[inf_bound] is the optional argument.)
|
|
Upper bound is the upper bound specified for the variable . (None indicates that , where optional_settings[inf_bound] is the optional argument.)
|
The meaning of the printout for linear and nonlinear constraints is the same as that given above for variables, with "variable" replaced by "constraint", and are replaced by and respectively, and with the following changes in the heading:
|
L Con gives the name (L) and index , for of the linear constraint.
|
|
N Con gives the name (N) and index , for 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 optional_settings[lin_feas_tol] and for nonlinear constraints which violate one of their bounds by more than optional_settings[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 optional_settings[minor_print_level], the user is referred to the documentation for e04ncc (nag_opt_lin_lsq). This option is equivalent to optional_settings[print_level].
If then printout will be suppressed; the user can print the final solution when nag_opt_nlp (e04ucc) returns to the calling program.
|
Output of results via a user-defined printing function
|
|
This section may be skipped by a user who only wishes to use the default printing facilities.
When a user-defined function is assigned to optional_settings[print_fun] this will be called in preference to the internal print function of nag_opt_nlp (e04ucc). Calls to the user-defined function are again controlled by means of the optional_settings[print_level], optional_settings[minor_print_level] and optional_settings[print_deriv] members. Information is provided through st and comm, the two structure arguments to optional_settings[print_fun].
If then results from the last major iteration of nag_opt_nlp (e04ucc) are provided through st. Note that optional_settings[print_fun] will be called with only if "Nag_Iter", "Nag_Soln_Iter", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "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 - float
The step taken along the computed search direction.
nfun - integer
The cumulative number of objective function evaluations needed for the line search.
merit - float
The value of the augmented Lagrangian merit function at the current iterate.
objf - float
The current value of the objective function.
norm_nlnviol - float
The Euclidean norm of nonlinear constraint violations (only available if ).
violtn - float
The Euclidean norm of the residuals of constraints that are violated or in the predicted active set (only available if ).
norm_gz - float
, the Euclidean norm of the projected gradient.
nz - integer
The number of columns of (see Section [Overview ]).
bnd - integer
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 ).
penalty - float
The Euclidean norm of the vector of penalty arguments used in the augmented Lagrangian merit function (only available if ).
norm_gf - float
The Euclidean norm of , the gradient of the objective function with respect to the free variables.
cond_h - float
A lower bound on the condition number of the Hessian approximation .
cond_hz - float
A lower bound on the condition number of the projected Hessian approximation .
cond_t - float
A lower bound on the condition number of the matrix of predicted active constraints.
iter_conv - boolean
true if the sequence of iterates has converged, i.e., convergence condition (16) (see description of optional_settings[optim_tol] Section [The optional-settings Parameter]) is satisfied.
norm_gz_small - boolean
true if the projected gradient is sufficiently small, i.e., convergence condition (17) (see description of optional_settings[optim_tol] Section [The optional-settings Parameter]) is satisfied.
violtn_small - boolean
true if the violations of the nonlinear constraints are sufficiently small, i.e., convergence condition (18) (see description of optional_settings[optim_tol] Section [The optional-settings Parameter]) is satisfied.
update_modified - boolean
true if the quasi-Newton update was modified to ensure that the Hessian is positive-definite.
qp_not_feasible - boolean
true if the QP subproblem has no feasible point.
c_diff - boolean
true if central differences were used to compute the unspecified objective and constraint gradients.
step_limit_exceeded - boolean
true if the line search produced a relative change in greater than the value defined by the optional argument optional_settings[step_limit].
refactor - boolean
true if the approximate Hessian has been refactorized.
x - float
Contains the components of the current point , for .
state - integer
Contains the status of the variables, linear, and nonlinear constraints (if any). See Section [The optional-settings Parameter] for a description of the possible status values.
ax - float
If , contains the current value of the th linear constraint, for .
cx - float
If , contains the current value of nonlinear constraint , for .
diagt - float
If , the elements of the diagonal of the matrix .
diagr - float
Contains the elements of the diagonal of the upper triangular matrix .
If then the final result from nag_opt_nlp (e04ucc) is provided through st. Note that optional_settings[print_fun] will be called with only if "Nag_Soln", "Nag_Soln_Iter", "Nag_Soln_Iter_Long", "Nag_Soln_Iter_Const" or "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 - float
Contains the components of the final point , for .
state - integer
Contains the status of the variables, linear, and nonlinear constraints (if any). See Section [The optional-settings Parameter] for a description of the possible status values.
ax - float
If , contains the final value of the th linear constraint, for .
cx - float
If , contains the final value of nonlinear constraint , for .
bl - float
Contains the lower bounds on the variables.
bu - float
Contains the upper bounds on the variables.
lambda - float
Contains the final values of the Lagrange multipliers.
If then the results from derivative checking are provided through st. Note that optional_settings[print_fun] will be called with only if "Nag_D_Sum" or "Nag_D_Full". The following members of st are set:
n - integer
The number of variables.
ncnlin - integer
The number of nonlinear constraints.
x - float
Contains the components of the initial point , for .
g - float
Contains the components of the gradient vector at the initial point , for .
conjac - float
Contains the elements of the Jacobian matrix of nonlinear constraints at the initial point ( is held at location , , ).
In this case details of the derivative check performed by nag_opt_nlp (e04ucc) are held in the following substructure of st:
gprint - table
Which in turn contains three substructures g_chk, f_sim, c_sim and two pointers to arrays of substructures, f_comp and c_comp.
g_chk - table
The substructure g_chk contains the members:
type - table
The type of derivative check performed by nag_opt_nlp (e04ucc). This will be the same value as in optional_settings[verify_grad].
g_error - integer
This member will be equal to one of the error codes no error raised or NE_DERIV_ERRORS according to whether the derivatives were found to be correct or not.
obj_start - integer
Specifies the gradient element at which any component check started. This value will be equal to optional_settings[obj_check_start].
obj_stop - integer
Specifies the gradient element at which any component check ended. This value specifies the element at which any component check of the constraint gradient ended. This value will be equal to optional_settings[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 optional_settings[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 optional_settings[con_check_stop].
f_sim - table
The result of a simple derivative check of the objective gradient, , will be held in this substructure in members:
correct - boolean
If true then the objective gradient is consistent with the finite difference approximation according to a simple check.
dir_deriv - float
The directional derivative where is a random vector of unit length with elements of approximately equal magnitude.
fd_approx - float
The finite difference approximation, , to the directional derivative.
c_sim - table
The result of a simple derivative check of the constraint Jacobian, , 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 - boolean
If true then the Jacobian is consistent with the finite difference approximation according to a simple check.
max_error - float
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 - table
The results of a requested component derivative check of the objective gradient, , will be held in the array of substructures of type pointed to by f_comp. 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. (1983a).)
correct - boolean
If true then this gradient element is consistent with its finite difference approximation.
hopt - float
The optimal finite difference interval.
gdiff - float
The finite difference approximation for this gradient component.
iter - integer
The number of trials performed to find a suitable difference interval.
comment - character
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 - table
The results of a requested component derivative check of the Jacobian of nonlinear constraint functions, , will be held in the array of substructures of type pointed to by c_comp. The element will hold the details of the component derivative check for Jacobian element , for ; . 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. (1983a).)
The members of c_comp are as for f_comp where gdiff gives the difference approximation for the Jacobian element.
The relevant members of the structure comm are:
g_prt - boolean
Will be true only when the print function is called with the result of the derivative check of objfun and confun.
it_maj_prt - boolean
Will be true when the print function is called with information about the current major iteration.
sol_sqp_prt - boolean
Will be true when the print function is called with the details of the final solution.
it_prt - boolean
Will be 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 (nag_opt_lin_lsq) for details of which members of st are set.
new_lm - boolean
Will be true when the Lagrange multipliers have been updated in a QP subproblem. See the documentation for e04ncc (nag_opt_lin_lsq) for details of which members of st are set.
sol_prt - boolean
Will be 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 (nag_opt_lin_lsq) for details of which members of st are set.
|
Before calling nag_opt_nlp (e04ucc) this field may be initialized for use by when called from nag_opt_nlp (e04ucc).
|
|
|
|
|
|
Examples
|
|
>
|
ncnlin := 2:
objfun := proc(n,x,objf::evaln,objgrd,comm)
local result:
result := x[1]*x[4]*(x[1]+x[2]+x[3]) + x[3]:
assign(objf,result):
objgrd[1] := x[4]*(2*x[1]+x[2]+x[3]):
objgrd[2] := x[1]*x[4]:
objgrd[3] := x[1]*x[4] + 1.0:
objgrd[4] := x[1]*(x[1]+x[2]+x[3]):
NULL:
end proc:
confun := proc(n,nclin,needc,x,conf,cjac,comm)
if needc[1] > 0.0 then
conf[1] := x[1]^2+x[2]^2+x[3]^2+x[4]^2:
end if:
if needc[2] > 0.0 then
conf[2] := x[1]*x[2]*x[3]*x[4]:
end if:
if needc[1] > 0.0 then
cjac[1] := 2*x[1]:
cjac[2] := 2*x[2]:
cjac[3] := 2*x[3]:
cjac[4] := 2*x[4]:
end if:
if needc[2] > 0.0 then
cjac[5] := x[2]*x[3]*x[4]:
cjac[6] := x[1]*x[3]*x[4]:
cjac[7] := x[1]*x[2]*x[4]:
cjac[8] := x[1]*x[2]*x[3]:
end if:
NULL:
end proc:
a := Matrix([[1, 1, 1, 1]], datatype=float[8], order='C_order'):
bl := Vector([1, 1, 1, 1, -1e+25, -1e+25, 25], datatype=float[8]):
bu := Vector([5, 5, 5, 5, 20, 40, 1e+25], datatype=float[8]):
x := Vector([1, 5, 5, 1], datatype=float[8]):
g := Vector(4, datatype=float[8]):
NAG:-e04ucc(ncnlin, a, bl, bu, objfun, confun, x, objf, g):
|
|
|
See Also
|
|
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 (ed 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 (1986a) 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 (1983a) Documentation for FDCALC and FDCORE Technical Report SOL 83–6 Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1984a) 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 (1984b) Procedures for optimization problems with a mixture of bounds and general linear constraints ACM Trans. Math. Software 10 282–298
Gill P E, Murray W, Saunders M A and Wright M H (1986b) 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 (1986c) 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 Systems 187 Springer–Verlag
Murtagh B A and Saunders M A (1983) MINOS 5.0 user's guide Report SOL 83-20 Department of Operations Research, Stanford University
Powell M J D (1974) Introduction to constrained optimization Numerical Methods for Constrained Optimization (ed 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 (ed A Bachem, M Grötschel and B Korte) 288–311 Springer–Verlag
e04 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|