NAG Library Routine Document
E04VHF
Note: this routine uses optional parameters to define choices in the problem specification and in the details of the algorithm. If you wish to use default
settings for all of the optional parameters, you need only read Sections 1 to 9 of this document. If, however, you wish to reset some or all of the settings please refer to Section 10 for a detailed description of the algorithm, to Section 11 for a detailed description of the specification of the optional parameters and to Section 12 for a detailed description of the monitoring information produced by the routine.
1 Purpose
E04VHF solves sparse linear and nonlinear programming problems.
2 Specification
SUBROUTINE E04VHF ( |
START, NF, N, NXNAME, NFNAME, OBJADD, OBJROW, PROB, USRFUN, IAFUN, JAVAR, A, LENA, NEA, IGFUN, JGVAR, LENG, NEG, XLOW, XUPP, XNAMES, FLOW, FUPP, FNAMES, X, XSTATE, XMUL, F, FSTATE, FMUL, NS, NINF, SINF, CW, LENCW, IW, LENIW, RW, LENRW, CUSER, IUSER, RUSER, IFAIL) |
INTEGER |
START, NF, N, NXNAME, NFNAME, OBJROW, IAFUN(LENA), JAVAR(LENA), LENA, NEA, IGFUN(LENG), JGVAR(LENG), LENG, NEG, XSTATE(N), FSTATE(NF), NS, NINF, LENCW, IW(LENIW), LENIW, LENRW, IUSER(*), IFAIL |
REAL (KIND=nag_wp) |
OBJADD, A(LENA), XLOW(N), XUPP(N), FLOW(NF), FUPP(NF), X(N), XMUL(N), F(NF), FMUL(NF), SINF, RW(LENRW), RUSER(*) |
CHARACTER(8) |
PROB, XNAMES(NXNAME), FNAMES(NFNAME), CW(LENCW), CUSER(*) |
EXTERNAL |
USRFUN |
|
Before calling E04VHF, or one of the option setting routines
E04VKF,
E04VLF,
E04VMF or
E04VNF,
routine
E04VGF must be called.
The specification for
E04VGF is:
INTEGER |
LENCW, IW(LENIW), LENIW, LENRW, IFAIL |
REAL (KIND=nag_wp) |
RW(LENRW) |
CHARACTER(8) |
CW(LENCW) |
|
E04VGF should be called with
LENCW,
LENIW and
LENRW, the declared lengths of
CW,
IW and
RW respectively, must satisfy:
The contents of
the arrays
CW,
IW and
RWmust not be altered between calling routines
E04VGF, E04VHF,
E04VJF,
E04VKF,
E04VLF,
E04VMF and
E04VNF.
3 Description
E04VHF is designed to minimize a linear or nonlinear function subject to bounds on the variables and sparse linear or nonlinear constraints. It is suitable for large-scale linear and quadratic programming and for linearly constrained optimization, as well as for general nonlinear programs of the form
where
is an
-vector of variables,
and
are constant lower and upper bounds,
is a smooth scalar objective function,
is a sparse matrix, and
is a vector of smooth nonlinear constraint functions
. The optional parameter
Maximize specifies that
should be maximized instead of minimized.
Ideally, the first derivatives (gradients) of and should be known and coded by you. If only some of the gradients are known, E04VHF estimates the missing ones by finite differences.
If
is linear and
is absent,
(1) is a linear program (LP) and E04VHF applies the primal simplex method (see
Dantzig (1963)). Sparse basis factors are maintained by LUSOL (see
Gill et al. (1987)) as in MINOS (see
Murtagh and Saunders (1995)).
If only the objective is nonlinear, the problem is linearly constrained (LC) and tends to solve more easily than the general case with nonlinear constraints (NC). For both nonlinear cases, E04VHF applies a sparse sequential quadratic programming (SQP) method (see
Gill et al. (2002)), using limited-memory quasi-Newton approximations to the Hessian of the Lagrangian. The merit function for step-length control is an augmented Lagrangian, as in the dense SQP solver
E04WDF (see
Gill et al. (1986) and
Gill et al. (1992)).
E04VHF is suitable for nonlinear problems with thousands of constraints and variables, and is most efficient if only some of the variables enter nonlinearly, or there are relatively few degrees of freedom at a solution (i.e., many constraints are active). However, there is no limit on the number of degrees of freedom.
E04VHF allows linear and nonlinear constraints and variables to be entered in an arbitrary order, and uses one subroutine to define all the nonlinear functions.
The optimization problem is assumed to be in the form
where the upper and lower bounds are constant,
is a vector of smooth linear and nonlinear constraint functions
, and
is one of the components of
to be minimized, as specified by the input parameter
OBJROW. E04VHF reorders the variables and constraints so that the problem is in the form
(1).
Upper and lower bounds are specified for all variables and functions. The th constraint may be defined as an equality by setting . If certain bounds are not present, the associated elements of or should be set to special values that are treated as or . Free variables and free constraints (‘free rows’) have both bounds infinite.
In general, the components of are structured in the sense that they are formed from sums of linear and nonlinear functions of just some of the variables. This structure can be exploited by E04VHF.
In many cases, the vector
is a sum of linear and nonlinear functions. E04VHF allows these terms to be specified separately, so that the linear part is defined just once by the input arguments
IAFUN,
JAVAR and
A. Only the nonlinear part is recomputed at each
.
Suppose that each component of
is of the form
where
is a nonlinear function (possibly zero) and the elements
are constant. The
by
Jacobian of
is the sum of two sparse matrices of the same size:
, where
and
is the matrix with elements
. The two matrices must be
non-overlapping in the sense that each element of the Jacobian
comes from
or
, but
not both. The element cannot be split between
and
.
For example, the function
can be written as
in which case
can be written as
, where
Note: the element of appears in and is not split between and although it contains a linear term.
The nonzero elements of
and
are provided to E04VHF in coordinate form. The elements of
are entered as triples
in the arrays
IAFUN,
JAVAR and
A. The sparsity pattern
is entered as pairs
in the arrays
IGFUN and
JGVAR. The corresponding entries
(any that are known) are assigned to appropriate array elements
in
USRFUN.
The elements of
and
may be stored in any order. Duplicate entries are ignored.
IGFUN and
JGVAR may be defined automatically by subroutine
E04VJF when
is specified and
USRFUN does not provide any gradients.
Throughout this document the symbol
is used to represent the
machine precision (see
X02AJF).
E04VHF is based on SNOPTA, which is part of the SNOPT package described in
Gill et al. (2005b).
4 References
Dantzig G B (1963) Linear Programming and Extensions Princeton University Press
Eldersveld S K (1991) Large-scale sequential quadratic programming algorithms PhD Thesis Department of Operations Research, Stanford University, Stanford
Fourer R (1982) Solving staircase linear programs by the simplex method Math. Programming 23 274–313
Gill P E, Murray W and Saunders M A (2002) SNOPT: An SQP Algorithm for Large-scale Constrained Optimization 12 979–1006 SIAM J. Optim.
Gill P E, Murray W and Saunders M A (2005a) Users' guide for SQOPT 7: a Fortran package for large-scale linear and quadratic programming
Report NA 05-1 Department of Mathematics, University of California, San Diego
ftp://www.cam.ucsd.edu/pub/peg/reports/sqdoc7.pdf
Gill P E, Murray W and Saunders M A (2005b) Users' guide for SNOPT 7.1: a Fortran package for large-scale linear nonlinear programming
Report NA 05-2 Department of Mathematics, University of California, San Diego
ftp://www.cam.ucsd.edu/pub/peg/reports/sndoc7.pdf
Gill P E, Murray W, Saunders M A and Wright M H (1986) Users' guide for NPSOL (Version 4.0): a Fortran package for nonlinear programming Report SOL 86-2 Department of Operations Research, Stanford University
Gill P E, Murray W, Saunders M A and Wright M H (1987) Maintaining LU factors of a general sparse matrix Linear Algebra and its Applics. 88/89 239–270
Gill P E, Murray W, Saunders M A and Wright M H (1992) Some theoretical properties of an augmented Lagrangian merit function Advances in Optimization and Parallel Computing (ed P M Pardalos) 101–128 North Holland
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 (1978) Large-scale linearly constrained optimization 14 41–72 Math. Program.
Murtagh B A and Saunders M A (1982) A projected Lagrangian algorithm and its implementation for sparse nonlinear constraints Math. Program. Stud. 16 84–118
Murtagh B A and Saunders M A (1995) MINOS 5.4 users' guide Report SOL 83-20R Department of Operations Research, Stanford University
5 Parameters
- 1: START – INTEGERInput
On entry: indicates how a starting point is to be obtained.
- Requests that the Crash procedure be used, unless a Basis file is provided via optional parameters Old Basis File, Insert File or Load File.
- Is the same as but is more meaningful when a Basis file is given.
- Means that XSTATE and FSTATE define a valid starting point (probably from an earlier call, though not necessarily).
Constraint:
, or .
- 2: NF – INTEGERInput
On entry:
, the number of problem functions in
, including the objective function (if any) and the linear and nonlinear constraints. Upper and lower bounds on
can be defined using the parameters
XLOW and
XUPP and should not be included in
.
Constraint:
.
- 3: N – INTEGERInput
On entry: , the number of variables.
Constraint:
.
- 4: NXNAME – INTEGERInput
On entry: the number of names provided in the array
XNAMES.
- There are no names provided and generic names will be used in the output.
- Names for all variables must be provided and will be used in the output.
Constraint:
.
- 5: NFNAME – INTEGERInput
On entry: the number of names provided in the array
FNAMES.
- There are no names provided and generic names will be used in the output.
- Names for all functions must be provided and will be used in the output.
Constraint:
.
Note: if
then
NFNAME must also be
(and vice versa). Similarly, if
then
NFNAME must be
NF (and vice versa).
- 6: OBJADD – REAL (KIND=nag_wp)Input
On entry: is a constant that will be added to the objective row for printing purposes. Typically, .
- 7: OBJROW – INTEGERInput
On entry: says which row of is to act as the objective function. If there is no such row, set . Then E04VHF will seek a feasible point such that and .
Constraint:
(or a feasible point problem).
- 8: PROB – CHARACTER(8)Input
On entry: is an
-character name for the problem.
PROB is used in the printed solution and in some routines that output Basis files. A blank name may be used.
- 9: USRFUN – SUBROUTINE, supplied by the user.External Procedure
USRFUN must define the nonlinear portion
of the problem functions
, along with its gradient elements
. (A dummy subroutine is needed even if
and all functions are linear.)
In general,
USRFUN should return all function and gradient values on every entry except perhaps the last. This provides maximum reliability and corresponds to the default option setting,
.
The elements of
are stored in the array
in the order specified by the input arrays
IGFUN and
JGVAR.
In practice it is often convenient
not to code gradients. E04VHF is able to estimate them by finite differences, using a call to
USRFUN for each variable
for which some
needs to be estimated. However, this reduces the reliability of the optimization algorithm, and it can be very expensive if there are many such variables
.
As a compromise, E04VHF allows you to code
as many gradients as you like. This option is implemented as follows. Just before
USRFUN is called, each element of the derivative array
G is initialized to a specific value. On exit, any element retaining that value must be estimated by finite differences.
Some rules of thumb follow:
(i) |
for maximum reliability, compute all gradients; |
(ii) |
if the gradients are expensive to compute, specify optional parameter Nonderivative Linesearch and use the value of the input parameter NEEDG to avoid computing them on certain entries. (There is no need to compute gradients if on entry to USRFUN.); |
(iii) |
if not all gradients are known, you must specify . You should still compute as many gradients as you can. (It often happens that some of them are constant or zero.); |
(iv) |
again, if the known gradients are expensive, don't compute them if on entry to USRFUN; |
(v) |
use the input parameter STATUS to test for special actions on the first or last entries; |
(vi) |
while USRFUN is being developed, use the optional parameter Verify Level to check the computation of gradients that are supposedly known; |
(vii) |
USRFUN is not called until the linear constraints and bounds on are satisfied. This helps confine to regions where the functions are likely to be defined. However, be aware of the optional parameter Minor Feasibility Tolerance if the functions have singularities on the constraint boundaries; |
(viii) |
set if some of the functions are undefined. The linesearch will shorten the step and try again; |
(ix) |
set if you want E04VHF to stop. |
The specification of
USRFUN is:
SUBROUTINE USRFUN ( |
STATUS, N, X, NEEDF, NF, F, NEEDG, LENG, G, CUSER, IUSER, RUSER) |
INTEGER |
STATUS, N, NEEDF, NF, NEEDG, LENG, IUSER(*) |
REAL (KIND=nag_wp) |
X(N), F(NF), G(LENG), RUSER(*) |
CHARACTER(8) |
CUSER(*) |
|
- 1: STATUS – INTEGERInput/Output
On entry: indicates the first and last calls to
USRFUN.
- There is nothing special about the current call to USRFUN.
- E04VHF is calling your subroutine for the first time. You may wish to do something special such as read data from a file.
- E04VHF is calling your subroutine for the last time. This parameter setting allows you to perform some additional computation on the final solution.
- The current X is optimal.
- The problem appears to be infeasible.
- The problem appears to be unbounded.
- An iterations limit was reached.
If the functions are expensive to evaluate, it may be desirable to do nothing on the last call. The first executable statement could be
IF (STATUS .GE. 2) RETURN.
On exit: may be used to indicate that you are unable to evaluate
or its gradients at the current
. (For example, the problem functions may not be defined there.)
During the linesearch, is evaluated at points for various step lengths , where has already been evaluated satisfactorily. For any such , if you set , E04VHF will reduce and evaluate again (closer to , where is more likely to be defined).
If for some reason you wish to terminate the current problem, set .
- 2: N – INTEGERInput
On entry: , the number of variables, as defined in the call to E04VHF.
- 3: X(N) – REAL (KIND=nag_wp) arrayInput
On entry: the variables at which the problem functions are to be calculated. The array must not be altered.
- 4: NEEDF – INTEGERInput
On entry: indicates whether
F must be assigned during this call of
USRFUN.
- F is not required and is ignored.
- The components of corresponding to the nonlinear part of must be calculated and assigned to F.
If
is linear and completely defined by the
th row of
,
, then the associated value
is ignored and need not be assigned. However, if
has a nonlinear portion
that happens to be zero at
, then it is still necessary to set
. If the linear part
of a nonlinear
is provided using the arrays
IAFUN,
JAVAR and
A, then it must not be computed again as part of
.
To simplify the code, you may ignore the value of
NEEDF and compute
on every entry to
USRFUN.
NEEDF may also be ignored with
Derivative Linesearch and
. In this case,
NEEDF is always
, and
F must always be assigned.
- 5: NF – INTEGERInput
On entry: is the length of the full vector as defined in the call to E04VHF.
- 6: F(NF) – REAL (KIND=nag_wp) arrayInput/Output
On entry: concerns the calculation of .
On exit:
F contains the computed functions
(except perhaps if
).
- 7: NEEDG – INTEGERInput
On entry: indicates whether
G must be assigned during this call of
USRFUN.
- G is not required and is ignored.
- The partial derivatives of must be calculated and assigned to G. The value of should be , where , and .
- 8: LENG – INTEGERInput
On entry: is the length of the coordinate arrays
JGVAR and
IGFUN in the call to E04VHF.
- 9: G(LENG) – REAL (KIND=nag_wp) arrayInput/Output
On entry: concerns the calculations of the derivatives of the function .
On exit: contains the computed derivatives
(unless
).
These derivative elements must be stored in
G in exactly the same positions as implied by the definitions of arrays
IGFUN and
JGVAR. There is no internal check for consistency (except indirectly via the optional parameter
Verify Level), so great care is essential.
- 10: CUSER() – CHARACTER(8) arrayUser Workspace
-
USRFUN is called with the parameter
CUSER as supplied to E04VHF. You are free to use the array
CUSER to supply information to
USRFUN as an alternative to using COMMON global variables.
- 11: IUSER() – INTEGER arrayUser Workspace
-
USRFUN is called with the parameter
IUSER as supplied to E04VHF. You are free to use the array
IUSER to supply information to
USRFUN as an alternative to using COMMON global variables.
- 12: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
-
USRFUN is called with the parameter
RUSER as supplied to E04VHF. You are free to use the array
RUSER to supply information to
USRFUN as an alternative to using COMMON global variables.
USRFUN must either be a module subprogram USEd by, or declared as EXTERNAL in, the (sub)program from which E04VHF is called. Parameters denoted as
Input must
not be changed by this procedure.
- 10: IAFUN(LENA) – INTEGER arrayInput
- 11: JAVAR(LENA) – INTEGER arrayInput
- 12: A(LENA) – REAL (KIND=nag_wp) arrayInput
On entry: define the coordinates
and values
of the nonzero elements of the linear part
of the function
.
In particular,
NEA triples
define the row and column indices
and
of the element
.
The coordinates may define the elements of in any order.
- 13: LENA – INTEGERInput
On entry: the dimension of the arrays
IAFUN,
JAVAR and
A that hold
as declared in the (sub)program from which E04VHF is called.
Constraint:
.
- 14: NEA – INTEGERInput
On entry: is the number of nonzero entries in such that .
Constraint:
.
- 15: IGFUN(LENG) – INTEGER arrayInput
- 16: JGVAR(LENG) – INTEGER arrayInput
On entry: define the coordinates
of the nonzero elements of
, the nonlinear part of the derivative
of the function
.
E04VJF may be used to define these two arrays.
The coordinates can define the elements of
in any order. However,
USRFUN must define the actual elements of
G in exactly the same order as defined by the coordinates
.
- 17: LENG – INTEGERInput
On entry: the dimension of the arrays
IGFUN and
JGVAR that define the varying Jacobian elements
as declared in the (sub)program from which E04VHF is called.
Constraint:
.
- 18: NEG – INTEGERInput
On entry: the number of nonzero entries in .
Constraint:
.
- 19: XLOW(N) – REAL (KIND=nag_wp) arrayInput
- 20: XUPP(N) – REAL (KIND=nag_wp) arrayInput
On entry: contain the lower and upper bounds
and
on the variables
.
To specify a nonexistent lower bound
, set
, where
is the optional parameter
Infinite Bound Size. To specify a nonexistent upper bound
, set
.
To fix the th variable at , where , set .
Constraint:
, for .
- 21: XNAMES(NXNAME) – CHARACTER(8) arrayInput
On entry: the optional names for the variables.
If
,
XNAMES is not referenced and default names will be used for output.
If , should contain the -character name of the th variable.
- 22: FLOW(NF) – REAL (KIND=nag_wp) arrayInput
- 23: FUPP(NF) – REAL (KIND=nag_wp) arrayInput
On entry: contain the lower and upper bounds
and
on
.
To specify a nonexistent lower bound , set . For a nonexistent upper bound , set .
To make the th constraint an equality at , where , set .
Constraint:
, for .
- 24: FNAMES(NFNAME) – CHARACTER(8) arrayInput
On entry: the optional names for the problem functions.
If
,
FNAMES is not referenced and default names will be used for output.
If , should contain the -character name of the th row of .
- 25: X(N) – REAL (KIND=nag_wp) arrayInput/Output
On entry: an initial estimate of the variables
. See the following description of
XSTATE.
On exit: the final values of the variable .
- 26: XSTATE(N) – INTEGER arrayInput/Output
On entry: the initial state for each variable
.
If
or
and no basis information is provided (the optional parameters
Old Basis File,
Insert File and
Load File are all set to
; the default)
X and
XSTATE must be defined.
If nothing special is known about the problem, or if there is no wish to provide special information, you may set , , for all . If you set set ; if you set then set . In this case a Crash procedure is used to select an initial basis.
If
or
and basis information is provided (at least one of the optional parameters
Old Basis File,
Insert File and
Load File is nonzero)
X and
XSTATE need not be set.
If
(Warm Start),
X and
XSTATE must be set (probably from a previous call). In this case
must be
,
,
, for
.
On exit: the final state of the variables.
| State of variable | Usual value of |
0 | nonbasic | |
1 | nonbasic | |
2 | superbasic | Between and |
3 | basic | Between and |
Basic and superbasic variables may be outside their bounds by as much as the optional parameter
Minor Feasibility Tolerance. Note that if scaling is specified, the feasibility tolerance applies to the variables of the
scaled problem. In this case, the variables of the original problem may be as much as
outside their bounds, but this is unlikely unless the problem is very badly scaled. Check the value of
Primal infeasibility output to the unit number associated with the optional parameter
Print File.
Very occasionally some nonbasic variables may be outside their bounds by as much as the optional parameter
Minor Feasibility Tolerance, and there may be some nonbasics for which
lies strictly between its bounds.
If
, some basic and superbasic variables may be outside their bounds by an arbitrary amount (bounded by
SINF if scaling was not used).
Constraint:
.
- 27: XMUL(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the vector of the dual variables (Lagrange multipliers) for the simple bounds .
- 28: F(NF) – REAL (KIND=nag_wp) arrayInput/Output
On entry: an initial value for the problem functions
. See the following description of
FSTATE.
On exit: the final values for the problem functions
(the values
at the final point
X).
- 29: FSTATE(NF) – INTEGER arrayInput/Output
On entry: the initial state for the problem functions
.
If
or
and no basis information is provided (the optional parameters
Old Basis File,
Insert File and
Load File are all set to
; the default,
F and
FSTATE must be defined.
If nothing special is known about the problem, or if there is no wish to provide special information, you may set , , for all . Less trivially, to say that the optimal value of function will probably be equal to one of its bounds, set and or and as appropriate. In this case a Crash procedure is used to select an initial basis.
If
or
and basis information is provided (at least one of the optional parameters
Old Basis File,
Insert File and
Load File is nonzero),
F and
FSTATE need not be set.
If
(Warm Start),
F and
FSTATE must be set (probably from a previous call). In this case
must be
,
,
or
, for
.
On exit: the final state of the variables. The elements of
FSTATE have the following meaning:
| State of the corresponding slack variable | Usual value of |
0 | nonbasic | |
1 | nonbasic | |
2 | superbasic | Between and |
3 | basic | Between and |
Basic and superbasic slack variables may lead to the corresponding functions being outside their bounds by as much as the optional parameter
Minor Feasibility Tolerance.
Very occasionally some functions may be outside their bounds by as much as the optional parameter
Minor Feasibility Tolerance, and there may be some nonbasics for which
lies strictly between its bounds.
If
, some basic and superbasic variables may be outside their bounds by an arbitrary amount (bounded by
SINF if scaling was not used).
Constraint:
.
- 30: FMUL(NF) – REAL (KIND=nag_wp) arrayInput/Output
On entry: an estimate of
, the vector of Lagrange multipliers (shadow prices) for the constraints
. All
NF components must be defined. If nothing is known about
, set
, for
. For warm start use the values from a previous call.
On exit: the vector of the dual variables (Lagrange multipliers) for the general constraints
- 31: NS – INTEGERInput/Output
On entry: the number of superbasic variables.
NS need not be specified for cold starts, but should retain its value from a previous call when warm start is used.
On exit: the final number of superbasic variables.
- 32: NINF – INTEGEROutput
- 33: SINF – REAL (KIND=nag_wp)Output
On exit: are the number and the sum of the infeasibilities of constraints that lie outside one of their bounds by more than the optional parameter
Minor Feasibility Tolerance before the solution is unscaled.
If any
linear constraints are infeasible,
minimizes the sum of the infeasibilities of the linear constraints subject to the upper and lower bounds being satisfied. In this case
NINF gives the number of variables and linear constraints lying outside their upper or lower bounds. The nonlinear constraints are not evaluated.
Otherwise,
minimizes the sum of infeasibilities of the
nonlinear constraints subject to the linear constraints and upper and lower bounds being satisfied. In this case
NINF gives the number of components of
lying outside their bounds by more than the optional parameter
Minor Feasibility Tolerance. Again this is
before the solution is unscaled.
- 34: CW(LENCW) – CHARACTER(8) arrayCommunication Array
- 35: LENCW – INTEGERInput
On entry: the dimension of the array
CW as declared in the (sub)program from which E04VHF is called.
Constraint:
.
- 36: IW(LENIW) – INTEGER arrayCommunication Array
- 37: LENIW – INTEGERInput
On entry: the dimension of the array
IW as declared in the (sub)program from which E04VHF is called.
Constraint:
.
- 38: RW(LENRW) – REAL (KIND=nag_wp) arrayCommunication Array
- 39: LENRW – INTEGERInput
On entry: the dimension of the array
RW as declared in the (sub)program from which E04VHF is called.
Constraint:
.
- 40: CUSER() – CHARACTER(8) arrayUser Workspace
- 41: IUSER() – INTEGER arrayUser Workspace
- 42: RUSER() – REAL (KIND=nag_wp) arrayUser Workspace
-
CUSER,
IUSER and
RUSER are not used by E04VHF, but are passed directly to
USRFUN and may be used to pass information to this routine as an alternative to using COMMON global variables.
- 43: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, because for this routine the values of the output parameters may be useful even if
on exit, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
E04VHF returns with
if the iterates have converged to a point
that satisfies the first-order Kuhn–Tucker (see
Section 12.2) conditions to the accuracy requested by the optional parameter
Major Optimality Tolerance, i.e., the projected gradient and active constraint residuals are negligible at
.
You should check whether the following four conditions are satisfied:
(i) |
the final value of rgNorm (see Section 12.2) is significantly less than that at the starting point; |
(ii) |
during the final major iterations, the values of Step and Minors (see Section 12.1) are both one; |
(iii) |
the last few values of both rgNorm and SumInf (see Section 12.2) become small at a fast linear rate; and |
(iv) |
condHz (see Section 12.1) is small. |
If all these conditions hold,
is almost certainly a local minimum of
(1).
One caution about ‘Optimal solutions’. Some of the variables or slacks may lie outside their bounds more than desired, especially if scaling was requested.
Max Primal infeas in the Print file (see
Section 12) refers to the largest bound infeasibility and which variable is involved. If it is too large, consider restarting with a smaller
Minor Feasibility Tolerance (say
times smaller) and perhaps
.
Similarly,
Max Dual infeas in the Print file indicates which variable is most likely to be at a nonoptimal value. Broadly speaking, if
then the objective function would probably change in the
th significant digit if optimization could be continued. If
seems too large, consider restarting with a smaller
Major Optimality Tolerance.
Finally,
Nonlinear constraint violn in the Print file shows the maximum infeasibility for nonlinear rows. If it seems too large, consider restarting with a smaller
Major Feasibility Tolerance.
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Note: E04VHF may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the routine:
The initialization routine
E04VGF has not been called or at least one of
LENCW,
LENIW and
LENRW is less than
.
An input parameter is invalid. The output message provides more details of the invalid argument.
Requested accuracy could not be achieved.
A feasible solution has been found, but the requested accuracy in the dual infeasibilities could not be achieved. An abnormal termination has occurred, but E04VHF is within
of satisfying the
Major Optimality Tolerance. Check that the
Major Optimality Tolerance is not too small.
The problem appears to be infeasible.
When the constraints are linear, this message is based on a relatively reliable indicator of infeasibility. Feasibility is measured with respect to the upper and lower bounds on the variables and slacks. Among all the points satisfying the general constraints
(see
(6) and
(7) in
Section 10.2), there is apparently no point that satisfies the bounds on
and
. Violations as small as the
Minor Feasibility Tolerance are ignored, but at least one component of
or
violates a bound by more than the tolerance.
When nonlinear constraints are present, infeasibility is much harder to recognize correctly. Even if a feasible solution exists, the current linearization of the constraints may not contain a feasible point. In an attempt to deal with this situation, when solving each QP subproblem, E04VHF is prepared to relax the bounds on the slacks associated with nonlinear rows.
If a QP subproblem proves to be infeasible or unbounded (or if the Lagrange multiplier estimates for the nonlinear constraints become large), E04VHF enters so-called ‘nonlinear elastic’ mode. The subproblem includes the original QP objective and the sum of the infeasibilities – suitably weighted using the optional parameter
Elastic Weight. In elastic mode, some of the bounds on the nonlinear rows are ‘elastic’ – i.e., they are allowed to violate their specific bounds. Variables subject to elastic bounds are known as
elastic variables. An elastic variable is free to violate one or both of its original upper or lower bounds. If the original problem has a feasible solution and the elastic weight is sufficiently large, a feasible point eventually will be obtained for the perturbed constraints, and optimization can continue on the subproblem. If the nonlinear problem has no feasible solution, E04VHF will tend to determine a ‘good’ infeasible point if the elastic weight is sufficiently large. (If the elastic weight were infinite, E04VHF would locally minimize the nonlinear constraint violations subject to the linear constraints and bounds.)
Unfortunately, even though E04VHF locally minimizes the nonlinear constraint violations, there may still exist other regions in which the nonlinear constraints are satisfied. Wherever possible, nonlinear constraints should be defined in such a way that feasible points are known to exist when the constraints are linearized.
The problem appears to be unbounded (or badly scaled).
For linear problems, unboundedness is detected by the simplex method when a nonbasic variable can be increased or decreased by an arbitrary amount without causing a basic variable to violate a bound. Consider adding an upper or lower bound to the variable. Also, examine the constraints that have nonzeros in the associated column, to see if they have been formulated as intended.
Very rarely, the scaling of the problem could be so poor that numerical error will give an erroneous indication of unboundedness. Consider using the optional parameter
Scale Option.
For nonlinear problems, E04VHF monitors both the size of the current objective function and the size of the change in the variables at each step. If either of these is very large (as judged by the unbounded parameters (see
Section 12.1)), the problem is terminated and declared unbounded. To avoid large function values, it may be necessary to impose bounds on some of the variables in order to keep them away from singularities in the nonlinear functions.
The message may indicate an abnormal termination while enforcing the limit on the constraint violations. This exit implies that the objective is not bounded below in the feasible region defined by expanding the bounds by the value of the
Violation Limit.
Iteration limit reached.
Either the
Iterations Limit or the
Major Iterations Limit was exceeded before the required solution could be found. Check the iteration log to be sure that progress was being made. If so, and if you caused a basis file to be saved by using the optional parameter
New Basis File, consider restarting the run using the optional parameter
Old Basis File to see whether further progress can be made. If you have no basis file available, you might rerun the problem after increasing the optional parameters
Minor Iterations Limit and/or
Major Iterations Limit.
If none of the above limits have been reached, this error may mean that the problem appears to be more nonlinear than anticipated. The current set of basic and superbasic variables have been optimized as much as possible and a pricing operation (where a nonbasic variable is selected to become superbasic) is necessary to continue, but it can't continue as the number of superbasic variables has already reached the limit specified by the optional parameter
Superbasics Limit. In general, raise the
Superbasics Limit by a reasonable amount, bearing in mind the storage needed for the reduced Hessian.
Numerical difficulties have been encountered and no further progress can be made.
Several circumstances could lead to this exit.
- USRFUN could be returning accurate function values but inaccurate gradients (or vice versa). This is the most likely cause. Study the comments given for , and do your best to ensure that the coding is correct.
- The function and gradient values could be consistent, but their precision could be too low. For example, accidental use of a low precision data type when a higher precision was intended would lead to a relative function precision of about instead of something like . The default Major Optimality Tolerance of would need to be raised to about for optimality to be declared (at a rather suboptimal point). Of course, it is better to revise the function coding to obtain as much precision as economically possible.
- If function values are obtained from an expensive iterative process, they may be accurate to rather few significant figures, and gradients will probably not be available. One should specify but even then, if is as large as or (only or significant figures), the same exit condition may occur. At present the only remedy is to increase the accuracy of the function calculation.
- An factorization of the basis has just been obtained and used to recompute the basic variables , given the present values of the superbasic and nonbasic variables. A step of ‘iterative refinement’ has also been applied to increase the accuracy of . However, a row check has revealed that the resulting solution does not satisfy the current constraints sufficiently well.
This probably means that the current basis is very ill-conditioned. If there are some linear constraints and variables, try if scaling has not yet been used.
For certain highly structured basis matrices (notably those with band structure), a systematic growth may occur in the factor
. Consult the description of
Umax and
Growth in
Section 12.4 and set the
LU Factor Tolerance to
(or possibly even smaller, but not less than
).
- The first factorization attempt will have found the basis to be structurally or numerically singular. (Some diagonals of the triangular matrix were respectively zero or smaller than a certain tolerance.) The associated variables are replaced by slacks and the modified basis is refactorized, but singularity persists. This must mean that the problem is badly scaled, or the LU Factor Tolerance is too much larger than . This is highly unlikely to occur.
Derivative appears to be incorrect.
A check has been made on some elements of the Jacobian as returned in the parameter
G of
USRFUN. At least one value disagrees remarkably with its associated forward difference estimate (the relative difference between the computed and estimated values is
or more). This exit is a safeguard, since E04VHF will usually fail to make progress when the computed gradients are seriously inaccurate. In the process it may expend considerable effort before terminating with
.
Check the function and Jacobian computation
very carefully in
USRFUN. A simple omission could explain everything. If a component is very large, then give serious thought to scaling the function or the nonlinear variables.
If you feel certain that the computed Jacobian is correct (and that the forward-difference estimate is therefore wrong), you can specify to prevent individual elements from being checked. However, the optimization procedure may have difficulty.
Undefined user-supplied function.
You have indicated that the problem functions are undefined by assigning the value
on exit from
USRFUN. E04VHF attempts to evaluate the problem functions closer to a point at which the functions are already known to be defined. This exit occurs if E04VHF is unable to find a point at which the functions are defined. This will occur in the case of:
– |
undefined functions with no recovery possible; |
– |
undefined functions at the first point; |
– |
undefined functions at the first feasible point; or |
– |
undefined functions when checking derivatives. |
User requested termination.
You have indicated the wish to terminate solution of the current problem by setting
STATUS to a value
on exit from
USRFUN.
Internal memory allocation failed when attempting to obtain the required workspace. Please contact
NAG.
Internal memory allocation was insufficient. Please contact
NAG.
An error has occurred in the basis package, perhaps indicating incorrect setup of arrays. Set the optional parameter
Print File and examine the output carefully for further information.
An unexpected error has occurred. Set the optional parameter
Print File and examine the output carefully for further information.
7 Accuracy
If the value of the optional parameter
Major Optimality Tolerance is set to
(
) and
on exit, then the final value of
should have approximately
correct significant digits.
This section describes the final output produced by E04VHF. Intermediate and other output are given in
Section 12.
8.1 The Final Output
If
,
the final output, including a listing of the status of every variable and constraint will be sent to the
channel numbers associated with
Print File. The following describes the output for each constraint (row) and variable (column).
8.1.1 The ROWS section
General linear constraints take the form
. The
th constraint is therefore of the form
where
is the
th row of
.
Internally, the constraints take the form , where is the set of slack variables (which satisfy the bounds ). For the th row it is the slack variable that is directly available and it is sometimes convenient to refer to its state. Nonlinear constraints are treated similarly, except that the row activity and degree of infeasibility are computed directly from , rather than .
A full stop (.) is printed for any numerical value that is exactly zero.
Label |
Description |
Number |
is the value of . (This is used internally to refer to in the intermediate output.)
|
Row |
gives the name of the th row. |
State |
the state of the th row relative to the bounds and . The various states possible are as follows:
LL |
the row is at its lower limit, . |
UL |
the row is at its upper limit, . |
EQ |
the limits are the same (). |
FR |
is nonbasic and currently zero, even though it is free to take any value between its bounds and . |
BS |
is basic. |
SBS |
is superbasic. |
A key is sometimes printed before State.
Note that unless the optional parameter is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A |
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.
|
D |
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.
|
I |
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.
|
N |
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Major Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible. |
|
Activity |
is the value of (or for nonlinear rows) at the final iterate. |
Slack Activity |
is the value by which the row differs from its nearest bound. (For the free row (if any), it is set to Activity.)
|
Lower Limit |
is , the lower bound on the row. |
Upper Limit |
is , the upper bound on the row. |
Dual Activity |
is the value of the dual variable (the Lagrange multiplier for the th constraint). The full vector always satisfies , where is the current basis matrix and contains the associated gradients for the current objective function. For FP problems, is set to zero. |
i |
gives the index of the th row.
|
8.1.2 The COLUMNS section
Let the
th component of
be the variable
and assume that it satisfies the bounds
. A fullstop (.) is printed for any numerical value that is exactly zero.
Label |
Description |
Number |
is the column number . (This is used internally to refer to in the intermediate output.)
|
Column |
gives the name of .
|
State |
the state of relative to the bounds and . The various states possible are as follows:
LL |
is nonbasic at its lower limit, . |
UL |
is nonbasic at its upper limit, . |
EQ |
is nonbasic and fixed at the value . |
FR |
is nonbasic at some value strictly between its bounds: . |
BS |
is basic. Usually . |
SBS |
is superbasic. Usually . |
A key is sometimes printed before State.
Note that unless the optional parameter is specified, the tests for assigning a key are applied to the variables of the scaled problem.
A |
Alternative optimum possible. The variable is nonbasic, but its reduced gradient is essentially zero. This means that if the variable were allowed to start moving away from its bound, there would be no change in the value of the objective function. The values of the other free variables might change, giving a genuine alternative solution. However, if there are any degenerate variables (labelled D), the actual change might prove to be zero, since one of them could encounter a bound immediately. In either case, the values of the Lagrange multipliers might also change.
|
D |
Degenerate. The variable is basic or superbasic, but it is equal (or very close) to one of its bounds.
|
I |
Infeasible. The variable is basic or superbasic and is currently violating one of its bounds by more than the value of the Feasibility Tolerance.
|
N |
Not precisely optimal. The variable is nonbasic or superbasic. If the value of the reduced gradient for the variable exceeds the value of the optional parameter Major Optimality Tolerance, the solution would not be declared optimal because the reduced gradient for the variable would not be considered negligible. |
|
Activity |
is the value of at the final iterate.
|
Obj Gradient |
is the value of at the final iterate. For FP problems, is set to zero.
|
Lower Limit |
is the lower bound specified for the variable. None indicates that . |
Upper Limit |
is the upper bound specified for the variable. None indicates that . |
Reduced Gradnt |
is the value of the reduced gradient where is the th column of the constraint matrix. For FP problems, is set to zero. |
m + j |
is the value of .
|
Note that movement off a constraint (as opposed to a variable moving away from its bound) can be interpreted as allowing the entry in the Slack Activity column to become positive.
Numerical values are output with a fixed number of digits; they are not guaranteed to be accurate to this precision.
9 Example
This example is a reformulation of Problem 74 from
Hock and Schittkowski (1981) and involves the minimization of the nonlinear function
subject to the bounds
to the nonlinear constraints
and to the linear constraints
The initial point, which is infeasible, is
and
.
The optimal solution (to five figures) is
and
. All the nonlinear constraints are active at the solution.
The example in the document for
E04VJF solves the above problem. It first calls
E04VJF to determine the sparsity pattern before calling E04VHF.
The example in the document for
E04VKF solves the above problem using some of the optional parameters described in
Section 11.
The formulation of the problem combines the constraints and the objective into a single vector (
) which is split into linear part (
) and a nonlinear part (
). For example we could write
where
and
The nonzero elements of
need to be stored in the triples
in any order. For example
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The nonlinear functions
and the Jacobian need to be supplied in
USRFUN. Please note that there is no need to assign any value to
or
as there is no nonlinear part in
or
.
The nonzero entries of the Jacobian of
are
So the arrays
IGFUN and
JGVAR must contain:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and
USRFUN must return in
the value of
, where
and
.
9.1 Program Text
Program Text (e04vhfe.f90)
9.2 Program Data
Program Data (e04vhfe.d)
9.3 Program Results
Program Results (e04vhfe.r)
Note: the remainder of this document is intended for more advanced users. Section 10 contains a detailed description of the algorithm which may be needed in order to understand Sections 11 and 12. Section 11 describes the optional parameters which may be set by calls to E04VKF, E04VLF, E04VMF and/or E04VNF. Section 12 describes the quantities which can be requested to monitor the course of the computation.
10 Algorithmic Details
Here we summarise the main features of the SQP algorithm used in E04VHF and introduce some terminology used in the description of the subroutine and its arguments. The SQP algorithm is fully described in
Gill et al. (2002).
10.1 Constraints and Slack Variables
Problem
(1) contains
variables in
. Let
be the number of components of
and
combined. The upper and lower bounds on those terms define the
general constraints of the problem. E04VHF converts the general constraints to equalities by introducing a set of
slack variables . For example, the linear constraint
is replaced by
together with the bounded slack
. The minimization problem
(1) can therefore be written in the equivalent form
The general constraints become the equalities and , where and are the linear and nonlinear slacks.
10.2 Major Iterations
The basic structure of the SQP algorithm involves
major and
minor iterations. The major iterations generate a sequence of iterates
that satisfy the linear constraints and converge to a point that satisfies the nonlinear constraints and the first-order conditions for optimality. At each iterate
a QP subproblem is used to generate a search direction towards the next iterate
. The constraints of the subproblem are formed from the linear constraints
and the linearized constraint
where
denotes the
Jacobian matrix, whose elements are the first derivatives of
evaluated at
. The QP constraints therefore comprise the
linear constraints
where
and
are bounded above and below by
and
as before. If the
by
matrix
and
-vector
are defined as
then the QP subproblem can be written as
where
is a quadratic approximation to a modified Lagrangian function (see
Gill et al. (2002)). The matrix
is a quasi-Newton approximation to the Hessian of the Lagrangian. A BFGS update is applied after each major iteration. If some of the variables enter the Lagrangian linearly the Hessian will have some zero rows and columns. If the nonlinear variables appear first, then only the
rows and columns of the Hessian need to be approximated, where
is the number of nonlinear variables. This quantity is determined by the implicit values of the number of nonlinear objective and Jacobian variables determined after the constraints and variables are reordered.
10.3 Minor Iterations
Solving the QP subproblem is itself an iterative procedure. Here, the iterations of the QP solver
E04NQF form the
minor iterations of the SQP method.
E04NQF uses a reduced-Hessian active-set method implemented as a reduced-gradient method. At each minor iteration, the constraints
are partitioned into the form
where the
basis matrix is square and nonsingular, and the matrices
and
are the remaining columns of
. The vectors
,
and
are the associated
basic,
superbasic and
nonbasic variables respectively; they are a permutation of the elements of
and
. At a QP subproblem, the basic and superbasic variables will lie somewhere between their bounds, while the nonbasic variables will normally be equal to one of their bounds. At each iteration,
is regarded as a set of independent variables that are free to move in any desired direction, namely one that will improve the value of the QP objective (or the sum of infeasibilities). The basic variables are then adjusted in order to ensure that
continues to satisfy
. The number of superbasic variables (
, say) therefore indicates the number of degrees of freedom remaining after the constraints have been satisfied. In broad terms,
is a measure of
how nonlinear the problem is. In particular,
will always be zero for LP problems.
If it appears that no improvement can be made with the current definition of , and , a nonbasic variable is selected to be added to , and the process is repeated with the value of increased by one. At all stages, if a basic or superbasic variable encounters one of its bounds, the variable is made nonbasic and the value of is decreased by one.
Associated with each of the equality constraints are the dual variables . Similarly, each variable in has an associated reduced gradient . The reduced gradients for the variables are the quantities , where is the gradient of the QP objective, and the reduced gradients for the slacks are the dual variables . The QP subproblem is optimal if for all nonbasic variables at their lower bounds, for all nonbasic variables at their upper bounds, and for other variables, including superbasics. In practice, an approximate QP solution is found by relaxing these conditions.
10.4 The Merit Function
After a QP subproblem has been solved, new estimates of the solution are computed using a linesearch on the augmented Lagrangian merit function
where
is a diagonal matrix of penalty parameters
, and
now refers to dual variables for the nonlinear constraints in
(1). If
denotes the current solution estimate and
denotes the QP solution, the linesearch determines a step
such that the new point
gives a
sufficient decrease in the merit function
. When necessary, the penalties in
are increased by the minimum-norm perturbation that ensures descent for
(see
Gill et al. (1992)). The value of
is adjusted to minimize the merit function as a function of
before the solution of the QP subproblem (see
Gill et al. (1986) and
Eldersveld (1991)).
10.5 Treatment of Constraint Infeasibilities
E04VHF makes explicit allowance for infeasible constraints. First, infeasible
linear constraints are detected by solving the linear program
where
is a vector of ones, and the nonlinear constraint bounds are temporarily excluded from
and
. This is equivalent to minimizing the sum of the general linear constraint violations subject to the bounds on
. (The sum is the
-norm of the linear constraint violations. In the linear programming literature, the approach is called
elastic programming.)
The linear constraints are infeasible if the optimal solution of
(11) has
or
. E04VHF then terminates without computing the nonlinear functions.
Otherwise, all subsequent iterates satisfy the linear constraints. (Such a strategy allows linear constraints to be used to define a region in which the functions can be safely evaluated.) E04VHF proceeds to solve nonlinear problems as given, using search directions obtained from the sequence of QP subproblems (see
(7)).
If a QP subproblem proves to be infeasible or unbounded (or if the dual variables
for the nonlinear constraints become large), E04VHF enters ‘elastic’ mode and thereafter solves the problem
where
is a non-negative parameter (the
elastic weight), and
is called a
composite objective (the
penalty function for the nonlinear constraints).
The value of may increase automatically by multiples of if the optimal and continue to be nonzero. If is sufficiently large, this is equivalent to minimizing the sum of the nonlinear constraint violations subject to the linear constraints and bounds.
The initial value of
is controlled by the optional parameter
Elastic Weight.
11 Optional Parameters
Several optional parameters in E04VHF define choices in the problem specification or the algorithm logic. In order to reduce the number of formal parameters of E04VHF these optional parameters have associated default values that are appropriate for most problems. Therefore, you need only specify those optional parameters whose values are to be different from their default values.
The remainder of this section can be skipped if you wish to use the default values for all optional parameters.
The following is a list of the optional parameters available. A full description of each optional parameter is provided in
Section 11.1.
Optional parameters may be specified by calling one, or more, of the routines
E04VKF,
E04VLF,
E04VMF and
E04VNF before a call to E04VHF.
E04VKF reads options from an external options file, with
Begin and
End as the first and last lines respectively and each intermediate line defining a single optional parameter. For example,
Begin
Print Level = 5
End
The call
CALL E04VKF (ISPECS, CW, IW, RW, IFAIL)
can then be used to read the file on
unit
ISPECS.
on successful exit.
E04VKF should be consulted for a full description of this method of supplying optional parameters.
E04VLF,
E04VMF and
E04VNF can be called to supply options directly, one call being necessary for each optional parameter. For example,
CALL E04VLF ('Print Level = 5', CW, IW, RW, IFAIL)
E04VLF,
E04VMF and
E04VNF should be consulted for a full description of this method of supplying optional parameters.
All optional parameters you do not specify are set to their default values. Optional parameters you specify are unaltered by E04VHF (unless they define invalid values) and so remain in effect for subsequent calls to E04VHF, unless you alter them.
11.1 Description of the Optional Parameters
For each option, we give a summary line, a description of the optional parameter and details of constraints.
The summary line contains:
- the keywords, where the minimum abbreviation of each keyword is underlined (if no characters of an optional qualifier are underlined, the qualifier may be omitted);
- a parameter value,
where the letters , denote options that take character, integer and real values respectively;
- the default value, where the symbol is a generic notation for machine precision (see X02AJF), and denotes the relative precision of the objective function Function Precision, and signifies the value of Infinite Bound Size.
Keywords and character values are case and white space insensitive.
Central Difference Interval | | Default |
When , the central-difference interval is used near an optimal solution to obtain more accurate (but more expensive) estimates of gradients. Twice as many function evaluations are required compared to forward differencing. The interval used for the th variable is . The resulting derivative estimates should be accurate to , unless the functions are badly scaled.
If you supply a value for this optional parameter, a small value between and is appropriate.
Check Frequency | | Default |
Every th minor iteration after the most recent basis factorization, a numerical test is made to see if the current solution satisfies the general linear constraints (the linear constraints and the linearized nonlinear constraints, if any). The constraints are of the form , where is the set of slack variables. To perform the numerical test, the residual vector is computed. If the largest component of is judged to be too large, the current basis is refactorized and the basic variables are recomputed to satisfy the general constraints more accurately. If , the value of is used and effectively no checks are made.
is useful for debugging purposes, but otherwise this option should not be needed.
Crash Tolerance | | Default |
Except on restarts, an internal Crash procedure is used to select an initial basis from certain rows and columns of the constraint matrix
. The
Crash Option determines which rows and columns of
are eligible initially, and how many times the Crash procedure is called. Columns of
are used to pad the basis where necessary.
|
Meaning |
|
The initial basis contains only slack variables: . |
|
The Crash procedure is called once, looking for a triangular basis in all rows and columns of . |
|
The Crash procedure is called twice (if there are nonlinear constraints). The first call looks for a triangular basis in linear rows, and the iteration proceeds with simplex iterations until the linear constraints are satisfied. The Jacobian is then evaluated for the first major iteration and the Crash procedure is called again to find a triangular basis in the nonlinear rows (retaining the current basis for linear rows). |
|
The Crash procedure is called up to three times (if there are nonlinear constraints). The first two calls treat linear equalities and linear inequalities separately. As before, the last call treats nonlinear rows before the first major iteration. |
If , certain slacks on inequality rows are selected for the basis first. (If , numerical values are used to exclude slacks that are close to a bound). The Crash procedure then makes several passes through the columns of , searching for a basis matrix that is essentially triangular. A column is assigned to ‘pivot’ on a particular row if the column contains a suitably large element in a row that has not yet been assigned. (The pivot elements ultimately form the diagonals of the triangular basis.) For remaining unassigned rows, slack variables are inserted to complete the basis.
The
Crash Tolerance allows the starting Crash procedure to ignore certain ‘small’ nonzeros in each column of
. If
is the largest element in column
, other nonzeros of
in the columns are ignored if
. (To be meaningful,
should be in the range
.)
When , the basis obtained by the Crash procedure may not be strictly triangular, but it is likely to be nonsingular and almost triangular. The intention is to obtain a starting basis containing more columns of and fewer (arbitrary) slacks. A feasible solution may be reached sooner on some problems.
For example, suppose the first
columns of
form the matrix shown under
LU Factor Tolerance; i.e., a tridiagonal matrix with entries
,
,
. To help the Crash procedure choose all
columns for the initial basis, we would specify a
Crash Tolerance of
for some value of
.
This special keyword may be used to reset all optional parameters to their default values.
Derivative Option | | Default |
Optional parameter
Derivative Option specifies which nonlinear function gradients are known analytically and will be supplied to E04VHF by
USRFUN.
|
Meaning |
|
Some problem derivatives are unknown. |
|
All problem derivatives are known. |
The value should be used whenever possible. It is the most reliable and will usually be the most efficient.
If
, E04VHF will
estimate the missing components of
using finite differences. This may simplify the coding of
USRFUN. However, it could increase the total run-time substantially (since a special call to
USRFUN is required for each column of the Jacobian that has a missing element), and there is less assurance that an acceptable solution will be located. If the nonlinear variables are not well scaled, it may be necessary to specify a nonstandard optional parameter
Difference Interval.
For each column of the Jacobian, one call to
USRFUN is needed to estimate all missing elements in that column, if any.
At times, central differences are used rather than forward differences. Twice as many calls to
USRFUN are needed. (This is not under your control.)
Derivative Linesearch | | Default |
At each major iteration a linesearch is used to improve the merit function. Optional parameter
Derivative Linesearch uses safeguarded cubic interpolation and requires both function and gradient values to compute estimates of the step
. If some analytic derivatives are not provided, or optional parameter
Nonderivative Linesearch is specified, E04VHF employs a linesearch based upon safeguarded quadratic interpolation, which does not require gradient evaluations.
A nonderivative linesearch can be slightly less robust on difficult problems, and it is recommended that the default be used if the functions and derivatives can be computed at approximately the same cost. If the gradients are very expensive relative to the functions, a nonderivative linesearch may give a significant decrease in computation time.
If
Nonderivative Linesearch is selected, E04VHF signals the evaluation of the linesearch by calling
USRFUN with
. Once the linesearch is completed, the problem functions are called again with
and
. If the potential saving provided by a nonderivative linesearch is to be realised, it is essential that
USRFUN be coded so that derivatives are not computed when
.
Difference Interval | | Default |
This alters the interval
used to estimate gradients by forward differences. It does so in the following circumstances:
– |
in the interval (‘cheap’) phase of verifying the problem derivatives; |
– |
for verifying the problem derivatives; |
– |
for estimating missing derivatives. |
In all cases, a derivative with respect to is estimated by perturbing that component of to the value , and then evaluating or at the perturbed point. The resulting gradient estimates should be accurate to unless the functions are badly scaled. Judicious alteration of may sometimes lead to greater accuracy.
If you supply a value for this optional parameter, a small value between and is appropriate.
Optional parameters
Dump File and
Load File are similar to optional parameters
Punch File and
Insert File, but they record solution information in a manner that is more direct and more easily modified. A full description of information recorded in optional parameters
Dump File and
Load File is given in
Gill et al. (2005a).
If , the last solution obtained will be output to the file with unit number .
If
, the
Load File,
containing basis information, will be read. The file will usually have been output previously as a
Dump File. The file will not be accessed if optional parameters
Old Basis File or
Insert File are specified.
Elastic Weight | | Default |
This keyword determines the initial weight
associated with the problem
(12) (see
Section 10.5).
At major iteration , if elastic mode has not yet started, a scale factor is defined from the current objective gradient. Elastic mode is then started if the QP subproblem is infeasible, or the QP dual variables are larger in magnitude than . The QP is resolved in elastic mode with .
Thereafter, major iterations continue in elastic mode until they converge to a point that is optimal for
(12) (see
Section 10.5). If the point is feasible for equation
(1) , it is declared locally optimal. Otherwise,
is increased by a factor of
and major iterations continue. If
has already reached a maximum allowable value, equation
(1) is declared locally infeasible.
Expand Frequency | | Default |
This option is part of the anti-cycling procedure designed to make progress even on highly degenerate problems.
For linear models, the strategy is to force a positive step at every iteration, at the expense of violating the bounds on the variables by a small amount. Suppose that the optional parameter
Minor Feasibility Tolerance is
. Over a period of
iterations, the tolerance actually used by E04VHF increases from
to
(in steps of
).
For nonlinear models, the same procedure is used for iterations in which there is only one superbasic variable. (Cycling can occur only when the current solution is at a vertex of the feasible region.) Thus, zero steps are allowed if there is more than one superbasic variable, but otherwise positive steps are enforced.
Increasing
helps reduce the number of slightly infeasible nonbasic variables (most of which are eliminated during a resetting procedure). However, it also diminishes the freedom to choose a large pivot element (see optional parameter
Pivot Tolerance).
Factorization Frequency | | Default |
At most basis changes will occur between factorizations of the basis matrix.
With linear programs, the basis factors are usually updated every iteration. The default is reasonable for typical problems. Higher values up to (say) may be more efficient on well-scaled problems.
When the objective function is nonlinear, fewer basis updates will occur as an optimum is approached. The number of iterations between basis factorizations will therefore increase. During these iterations a test is made regularly (according to the optional parameter
Check Frequency) to ensure that the general constraints are satisfied. If necessary the basis will be refactorized before the limit of
updates is reached.
Function Precision | | Default |
The relative function precision is intended to be a measure of the relative accuracy with which the nonlinear functions can be computed. For example, if is computed as for some relevant and if the first significant digits are known to be correct, the appropriate value for would be .
Ideally the functions should have magnitude of order . If all functions are substantially less than in magnitude, should be the absolute precision. For example, if at some point and if the first significant digits are known to be correct, the appropriate value for would be .)
The default value of is appropriate for simple analytic functions.
In some cases the function values will be the result of extensive computation, possibly involving a costly iterative procedure that can provide few digits of precision. Specifying an appropriate
Function Precision may lead to savings, by allowing the linesearch procedure to terminate when the difference between function values along the search direction becomes as small as the absolute error in the values.
Hessian Full Memory | | Default if |
Hessian Limited Memory | | Default if |
These options select the method for storing and updating the approximate Hessian. (E04VHF uses a quasi-Newton approximation to the Hessian of the Lagrangian. A BFGS update is applied after each major iteration.)
If
Hessian Full Memory is specified, the approximate Hessian is treated as a dense matrix and the BFGS updates are applied explicitly. This option is most efficient when the number of variables
is not too large (say, less than
). In this case, the storage requirement is fixed and one can expect
-step Q-superlinear convergence to the solution.
Hessian Limited Memory should be used on problems where
is very large. In this case a limited-memory procedure is used to update a diagonal Hessian approximation
a limited number of times. (Updates are accumulated as a list of vector pairs. They are discarded at regular intervals after
has been reset to their diagonal.)
Hessian Frequency | | Default |
If optional parameter
Hessian Full Memory is in effect and
BFGS updates have already been carried out, the Hessian approximation is reset to the identity matrix. (For certain problems, occasional resets may improve convergence, but in general they should not be necessary.)
Hessian Full Memory and
have a similar effect to
Hessian Limited Memory and
(except that the latter retains the current diagonal during resets).
If optional parameter
Hessian Limited Memory is in effect and
BFGS updates have already been carried out, all but the diagonal elements of the accumulated updates are discarded and the updating process starts again.
Broadly speaking, the more updates stored, the better the quality of the approximate Hessian. However, the more vectors stored, the greater the cost of each QP iteration. The default value is likely to give a robust algorithm without significant expense, but faster convergence can sometimes be obtained with significantly fewer updates (e.g., ).
Infinite Bound Size | | Default |
If , defines the ‘infinite’ bound in the definition of the problem constraints. Any upper bound greater than or equal to will be regarded as (and similarly any lower bound less than or equal to will be regarded as ). If , the default value is used.
Iterations Limit | | Default |
The value of
specifies the maximum number of minor iterations allowed (i.e., iterations of the simplex method or the QP algorithm), summed over all major iterations. (See also the description of the optional parameter
Minor Iterations Limit.)
Linesearch Tolerance | | Default |
This tolerance, , controls the accuracy with which a step length will be located along the direction of search each iteration. At the start of each linesearch a target directional derivative for the merit function is identified. This parameter determines the accuracy to which this target value is approximated, and it must be a value in the range .
The default value requests just moderate accuracy in the linesearch.
If the nonlinear functions are cheap to evaluate, a more accurate search may be appropriate; try .
If the nonlinear functions are expensive to evaluate, a less accurate search may be appropriate. If all gradients are known, try . (The number of major iterations might increase, but the total number of function evaluations may decrease enough to compensate.)
If not all gradients are known, a moderately accurate search remains appropriate. Each search will require only –5 function values (typically), but many function calls will then be needed to estimate missing gradients for the next iteration.
LU Density Tolerance | | Default |
LU Singularity Tolerance | | Default |
The density tolerance, , is used during factorization of the basis matrix . Columns of and rows of are formed one at a time, and the remaining rows and columns of the basis are altered appropriately. At any stage, if the density of the remaining matrix exceeds , the Markowitz strategy for choosing pivots is terminated, and the remaining matrix is factored by a dense procedure. Raising the density tolerance towards may give slightly sparser factors, with a slight increase in factorization time.
The singularity tolerance, , helps guard against ill-conditioned basis matrices. After is refactorized, the diagonal elements of are tested as follows: if or , the th column of the basis is replaced by the corresponding slack variable. (This is most likely to occur after a restart.)
LU Factor Tolerance | | Default |
LU Update Tolerance | | Default |
The values of
and
affect the stability of the basis factorization
, during refactorization and updates respectively. The lower triangular matrix
is a product of matrices of the form
where the multipliers
will satisfy
. The default values of
and
usually strike a good compromise between stability and sparsity. They must satisfy
,
.
For large and relatively dense problems, (say) may give a useful improvement in stability without impairing sparsity to a serious degree.
For certain very regular structures (e.g., band matrices) it may be necessary to reduce
in order to achieve stability. For example, if the columns of
include a sub-matrix of the form
one should set both
and
to values in the range
.
LU Partial Pivoting | | Default |
The
factorization implements a Markowitz-type search for pivots that locally minimize the fill-in subject to a threshold pivoting stability criterion. The default option is to use threshhold partial pivoting. The optional parameters
LU Rook Pivoting and
LU Complete Pivoting are more expensive than partial pivoting but are more stable and better at revealing rank, as long as
LU Factor Tolerance is not too large (say
). When numerical difficulties are encountered, E04VHF automatically reduces the
tolerance towards
and switches (if necessary) to rook or complete pivoting, before reverting to the default or specified options at the next refactorization (with
System Information Yes, relevant messages are output to the
Print File).
Major Feasibility Tolerance | | Default |
This tolerance, , specifies how accurately the nonlinear constraints should be satisfied. The default value is appropriate when the linear and nonlinear constraints contain data to about that accuracy.
Let
be the maximum nonlinear constraint violation, normalized by the size of the solution, which is required to satisfy
where
is the violation of the
th nonlinear constraint, for
.
In the major iteration log (see
Section 12.2),
appears as the quantity labelled ‘Feasible’. If some of the problem functions are known to be of low accuracy, a larger
Major Feasibility Tolerance may be appropriate.
Major Optimality Tolerance | | Default |
This tolerance,
, specifies the final accuracy of the dual variables. On successful termination, E04VHF will have computed a solution
such that
where
is an estimate of the complementarity slackness for variable
, for
. The values
are computed from the final QP solution using the reduced gradients
(where
is the
th component of the objective gradient,
is the associated column of the constraint matrix
, and
is the set of QP dual variables):
In the
Print File,
appears as the quantity labelled ‘Optimal’.
Major Iterations Limit | | Default |
This is the maximum number of major iterations allowed. It is intended to guard against an excessive number of linearizations of the constraints. If , optimality and feasibility are checked.
Major Print Level | | Default |
This controls the amount of output to the optional parameters
Print File and
Summary File at each major iteration.
suppresses most output, except for error messages.
gives normal output for linear and nonlinear problems, and
gives additional details of the Jacobian factorization that commences each major iteration.
In general, the value being specified may be thought of as a binary number of the form
where each letter stands for a digit that is either
or
as follows:
|
a single line that gives a summary of each major iteration. (This entry in is not strictly binary since the summary line is printed whenever ); |
|
basis statistics, i.e., information relating to the basis matrix whenever it is refactorized. (This output is always provided if ); |
|
, the nonlinear variables involved in the objective function or the constraints. These appear under the heading ‘Jacobian variables’; |
|
, the dual variables for the nonlinear constraints. These appear under the heading ‘Multiplier estimates’; |
|
, the values of the nonlinear constraint functions; |
|
, the Jacobian matrix. This appears under the heading ‘ and Jacobian’. |
To obtain output of any items , set the corresponding digit to , otherwise to .
If
, the Jacobian matrix will be output column-wise at the start of each major iteration. Column
will be preceded by the value of the corresponding variable
and a key to indicate whether the variable is basic, superbasic or nonbasic. (Hence if
, there is no reason to specify
unless the objective contains more nonlinear variables than the Jacobian.) A typical line of output is
3 1.250000E+01 BS 1 1.00000E+00 4 2.00000E+00
which would mean that
is basic at value
, and the third column of the Jacobian has elements of
and
in rows
and
.
Major Step Limit | | Default |
This parameter limits the change in
during a linesearch. It applies to all nonlinear problems, once a ‘feasible solution’ or ‘feasible subproblem’ has been found.
- A linesearch determines a step over the range , where is if there are nonlinear constraints or is the step to the nearest upper or lower bound on if all the constraints are linear. Normally, the first step length tried is .
- In some cases, such as or , even a moderate change in the components of can lead to floating point overflow. The parameter is therefore used to define a limit (where is the search direction), and the first evaluation of is at the potentially smaller step length .
- Wherever possible, upper and lower bounds on should be used to prevent evaluation of nonlinear functions at meaningless points. The optional parameter Major Step Limit provides an additional safeguard. The default value should not affect progress on well behaved problems, but setting may be helpful when rapidly varying functions are present. A ‘good’ starting point may be required. An important application is to the class of nonlinear least squares problems.
- In cases where several local optima exist, specifying a small value for may help locate an optimum near the starting point.
The keywords
Minimize and
Maximize specify the required direction of optimization. It applies to both linear and nonlinear terms in the objective.
The keyword
Feasible Point means ‘Ignore the objective function, while finding a feasible point for the linear and nonlinear constraints’. It can be used to check that the nonlinear constraints are feasible without altering the call to E04VHF.
Minor Feasibility Tolerance | | Default |
Feasibility Tolerance | | Default |
E04VHF tries to ensure that all variables eventually satisfy their upper and lower bounds to within this tolerance, . This includes slack variables. Hence, general linear constraints should also be satisfied to within .
Feasibility with respect to nonlinear constraints is judged by the optional parameter
Major Feasibility Tolerance (not by
).
If the bounds and linear constraints cannot be satisfied to within
, the problem is declared
infeasible. If
SINF
is quite small, it may be appropriate to raise
by a factor of
or
. Otherwise, some error in the data should be suspected.
Nonlinear functions will be evaluated only at points that satisfy the bounds and linear constraints. If there are regions where a function is undefined, every attempt should be made to eliminate these regions from the problem.
For example, if , it is essential to place lower bounds on both variables. If , the bounds and might be appropriate. (The log singularity is more serious. In general, keep as far away from singularities as possible.)
If , feasibility is defined in terms of the scaled problem (since it is then more likely to be meaningful).
In reality, E04VHF uses
as a feasibility tolerance for satisfying the bounds on
and
in each QP subproblem. If the sum of infeasibilities cannot be reduced to zero, the QP subproblem is declared infeasible. E04VHF is then in
elastic mode thereafter (with only the linearized nonlinear constraints defined to be elastic). See the description of the optional parameter
Elastic Weight.
Minor Iterations Limit | | Default |
If the number of minor iterations for the optimality phase of the QP subproblem exceeds , then all nonbasic QP variables that have not yet moved are frozen at their current values and the reduced QP is solved to optimality.
Note that more than minor iterations may be necessary to solve the reduced QP to optimality. These extra iterations are necessary to ensure that the terminated point gives a suitable direction for the linesearch.
In the major iteration log (see
Section 12.2) a
t at the end of a line indicates that the corresponding QP was artificially terminated using the limit
.
Compare with the optional parameter
Iterations Limit, which defines an independent
absolute limit on the
total number of minor iterations (summed over all QP subproblems).
Minor Print Level | | Default |
This controls the amount of output to the
Print File and
Summary File during solution of the QP subproblems. The value of
has the following effect:
|
Meaning |
|
No minor iteration output except error messages. |
|
A single line of output at each minor iteration (controlled by optional parameters Print Frequency and Summary Frequency. |
|
Basis factorization statistics generated during the periodic refactorization of the basis (see the optional parameter Factorization Frequency). Statistics for the first factorization each major iteration are controlled by the optional parameter Major Print Level. |
New Basis File | | Default |
Backup Basis File | | Default |
Save Frequency | | Default |
New Basis File and
Backup Basis File are sometimes referred to as basis maps. They contain the most compact representation of the state of each variable. They are intended for restarting the solution of a problem at a point that was reached by an earlier run. For nontrivial problems, it is advisable to save basis maps at the end of a run, in order to restart the run if necessary.
If , a basis map will be saved in the file associated with unit every th iteration. The first record of the file will contain the word PROCEEDING if the run is still in progress. A basis map will also be saved at the end of a run, with some other word indicating the final solution status.
Use of
is intended as a safeguard against losing the results of a long run. Suppose that a
New Basis File is being saved every
(
Save Frequency) iterations, and that E04VHF is about to save such a basis at iteration
. It is conceivable that the run may be interrupted during the next few milliseconds (in the middle of the save). In this case the Basis file will be corrupted and the run will have been essentially wasted.
To eliminate this risk, both a
New Basis File and a
Backup Basis File may be specified. The following would be suitable for the above example:
Backup Basis File 11New Basis File 12
The current basis will then be saved every iterations, first in the file associated with unit and then immediately in the file associated with unit . If the run is interrupted at iteration during the save in the file associated with unit , there will still be a usable basis in the file associated with unit (corresponding to iteration ).
Note that a new basis will be saved in
New Basis File at the end of a run if it terminates normally, but it will not be saved in
Backup Basis File. In the above example, if an optimum solution is found at iteration
(or if the iteration limit is
), the final basis in the file associated with unit
will correspond to iteration
, but the last basis saved in the file associated with unit
will be the one for iteration
.
A full description of information recorded in
New Basis File and
Backup Basis File is given in
Gill et al. (2005a).
New Superbasics Limit | | Default |
This option causes early termination of the QP subproblems if the number of free variables has increased significantly since the first feasible point. If the number of new superbasics is greater than , the nonbasic variables that have not yet moved are frozen and the resulting smaller QP is solved to optimality.
In the major iteration log (see
Section 12.1), a
t at the end of a line indicates that the QP was terminated early in this way.
For E04VHF, normally each optional parameter specification is printed as it is supplied. Optional parameter
Nolist may be used to suppress the printing and optional parameter
List may be used to turn on printing.
Old Basis File | | Default |
If
, the basis maps information will be obtained from this file.
The file will usually have been output previously as a
New Basis File or
Backup Basis File.
A full description of information recorded in
New Basis File and
Backup Basis File is given in
Gill et al. (2005a).
The file will not be acceptable if the number of rows or columns in the problem has been altered.
This parameter is recommended for large problems that have significantly more variables than constraints. It reduces the work required for each ‘pricing’ operation (where a nonbasic variable is selected to become superbasic). When , all columns of the constraint matrix are searched. Otherwise, and are partitioned to give roughly equal segments and , for . If the previous pricing search was successful on and , the next search begins on the segments and . (All subscripts here are modulo .) If a reduced gradient is found that is larger than some dynamic tolerance, the variable with the largest such reduced gradient (of appropriate sign) is selected to become superbasic. If nothing is found, the search continues on the next segments and , and so on.
For time-stage models having
time periods,
Partial Price (or
or
) may be appropriate.
Pivot Tolerance | | Default |
During the solution of QP subproblems, the pivot tolerance is used to prevent columns entering the basis if they would cause the basis to become almost singular.
When changes to for some search direction , a ‘ratio test’ determines which component of reaches an upper or lower bound first. The corresponding element of is called the pivot element. Elements of are ignored (and therefore cannot be pivot elements) if they are smaller than the pivot tolerance .
It is common for two or more variables to reach a bound at essentially the same time. In such cases, the
Minor Feasibility Tolerance (say,
) provides some freedom to maximize the pivot element and thereby improve numerical stability. Excessively small values of
should therefore not be specified. To a lesser extent, the
Expand Frequency (say,
) also provides some freedom to maximize the pivot element. Excessively
large values of
should therefore not be specified.
If
,
the following information is output to a file associated with
unit
during the solution of each problem:
– |
a listing of the optional parameters; |
– |
some statistics about the problem; |
– |
the amount of storage available for the factorization of the basis matrix; |
– |
notes about the initial basis resulting from a Crash procedure or a Basis file; |
– |
the iteration log; |
– |
basis factorization statistics; |
– |
the exit IFAIL condition and some statistics about the solution obtained; |
– |
the printed solution, if requested. |
These items are described in
Sections 8 and
12. Further brief output may be directed to the
Summary File.
Print Frequency | | Default |
If , one line of the iteration log will be printed every th iteration. A value such as is suggested for those interested only in the final solution. If , the value of is used and effectively no checks are made.
Proximal Point Method | | Default |
specifies minimization of or when the starting point is changed to satisfy the linear constraints (where refers to nonlinear variables).
The
Punch File from a previous run may be used as an
Insert File for a later run on the same problem. A full description of information recorded in
Insert File and
Punch File is given in
Gill et al. (2005a).
If , the final solution obtained will be output to the file.
For linear programs, this format is compatible with various commercial systems.
If
the
Insert File containing basis information will be read from unit
.
The file will usually have been output previously as a
Punch File. The file will not be accessed if
Old Basis File is specified.
Scale Tolerance | | Default |
Three scale options are available as follows:
|
Meaning |
0 |
No scaling. This is recommended if it is known that and the constraint matrix never have very large elements (say, larger than ). |
1 |
The constraints and variables are scaled by an iterative procedure that attempts to make the matrix coefficients as close as possible to (see Fourer (1982)). This will sometimes improve the performance of the solution procedures. |
2 |
The constraints and variables are scaled by the iterative procedure. Also, a certain additional scaling is performed that may be helpful if the right-hand side or the solution is large. This takes into account columns of that are fixed or have positive lower bounds or negative upper bounds. |
Optional parameter
Scale Tolerance affects how many passes might be needed through the constraint matrix. On each pass, the scaling procedure computes the ratio of the largest and smallest nonzero coefficients in each column:
If
is less than
times its previous value, another scaling pass is performed to adjust the row and column scales. Raising
from
to
(say) usually increases the number of scaling passes through
. At most
passes are made. The value of
should lie in the range
.
Scale Print causes the row scales
and column scales
to be printed to
Print File, if
System Information Yes has been specified. The scaled matrix coefficients are
, and the scaled bounds on the variables and slacks are
,
, where
if
.
If , the final solution will be output to file (whether optimal or not). All numbers are printed in 1pe16.6 format.
To see more significant digits in the printed solution, it will sometimes be useful to
make
refer to
Print File.
Summary Frequency | | Default |
If
, a brief log will be output to the file associated with unit
,
including one line of information every
th iteration. In an interactive environment, it is useful to direct this output to the terminal, to allow a run to be monitored online. (If something looks wrong, the run can be manually terminated.) Further details are given in
Section 12.6.
Superbasics Limit | | Default |
This option places a limit on the storage allocated for superbasic variables. Ideally, should be set slightly larger than the ‘number of degrees of freedom’ expected at an optimal solution.
For nonlinear problems, the number of degrees of freedom is often called the ‘number of independent variables’. Normally, need not be greater than , where is the number of nonlinear variables. For many problems, may be considerably smaller than . This will save storage if is very large.
Normally E04VHF prints the options file as it is being read, and then prints a complete list of the available keywords and their final values. The optional parameter
Suppress Parameters tells E04VHF not to print the full list.
System Information No | | Default |
This option prints additional information on the progress of major and minor iterations, and Crash statistics. See
Section 12.
If , some timing information will be output to the Print file, if .
Unbounded Objective | | Default |
Unbounded Step Size | | Default |
These parameters are intended to detect unboundedness in nonlinear problems. During a linesearch, is evaluated at points of the form , where and are fixed and varies. If exceeds or exceeds , iterations are terminated with the exit message .
If singularities are present, unboundedness in may be manifested by a floating point overflow (during the evaluation of ), before the test against can be made.
Unboundedness in is best avoided by placing finite upper and lower bounds on the variables.
This option refers to finite difference checks on the derivatives computed by the user-supplied routines. Derivatives are checked at the first point that satisfies all bounds and linear constraints.
|
Meaning |
|
Only a ‘cheap’ test will be performed, requiring two calls to USRFUN. |
|
Individual gradients will be checked (with a more reliable test). A key of the form OK or Bad? indicates whether or not each component appears to be correct. |
|
Individual columns of the problem Jacobian will be checked. |
|
Options 2 and 1 will both occur (in that order). |
|
Derivative checking is disabled. |
should be specified whenever a new
USRFUN is being developed.
Violation Limit | | Default |
This keyword defines an absolute limit on the magnitude of the maximum constraint violation,
, after the linesearch. On completion of the linesearch, the new iterate
satisfies the condition
where
is the point at which the nonlinear constraints are first evaluated and
is the
th nonlinear constraint violation
.
The effect of this violation limit is to restrict the iterates to lie in an expanded feasible region whose size depends on the magnitude of . This makes it possible to keep the iterates within a region where the objective is expected to be well-defined and bounded below. If the objective is bounded below for all values of the variables, then may be any large positive value.
12 Description of Monitoring Information
E04VHF produces monitoring information, statistical information and information about the solution.
Section 8.1 contains details of the final output information sent to the unit specified by the optional parameter
Print File. This section contains other details of output information.
12.1 Major Iteration Log
This section describes the output to unit
Print File if
. One line of information is output every
th major iteration, where
is
Print Frequency.
Label |
Description |
Itns |
is the cumulative number of minor iterations. |
Major |
is the current major iteration number. |
Minors |
is the number of iterations required by both the feasibility and optimality phases of the QP subproblem. Generally, Minors will be in the later iterations, since theoretical analysis predicts that the correct active set will be identified near the solution (see Section 10). |
Step |
is the step length taken along the current search direction . The variables have just been changed to . On reasonably well-behaved problems, the unit step will be taken as the solution is approached. |
nCon |
the number of times USRFUN has been called to evaluate the nonlinear problem functions. Evaluations needed for the estimation of the derivatives by finite differences are not included. nCon is printed as a guide to the amount of work required for the linesearch. |
Feasible |
is the value of (see (13)), the maximum component of the scaled nonlinear constraint residual (see optional parameter Major Feasibility Tolerance). The solution is regarded as acceptably feasible if Feasible is less than the Major Feasibility Tolerance. In this case, the entry is contained in parentheses.
If the constraints are linear, all iterates are feasible and this entry is not printed. |
Optimal |
is the value of (see (14)), the maximum complementary gap (see optional parameter Major Optimality Tolerance). It is an estimate of the degree of nonoptimality of the reduced costs. Both Feasible and Optimal are small in the neighbourhood of a solution. |
MeritFunction |
is the value of the augmented Lagrangian merit function (see (8)). This function will decrease at each iteration unless it was necessary to increase the penalty parameters (see Section 10.4). As the solution is approached, MeritFunction will converge to the value of the objective at the solution.
In elastic mode, the merit function is a composite function involving the constraint violations weighted by the elastic weight.
If the constraints are linear, this item is labelled Objective, the value of the objective function. It will decrease monotonically to its optimal value. |
L+U |
is the number of nonzeros representing the basis factors and on completion of the QP subproblem.
If nonlinear constraints are present, the basis factorization is computed at the start of the first minor iteration. At this stage, , where lenL (see Section 12.4) is the number of subdiagonal elements in the columns of a lower triangular matrix and lenU (see Section 12.4) is the number of diagonal and superdiagonal elements in the rows of an upper-triangular matrix.
As columns of are replaced during the minor iterations, L+U may fluctuate up or down but, in general, will tend to increase. As the solution is approached and the minor iterations decrease towards zero, L+U will reflect the number of nonzeros in the factors at the start of the QP subproblem.
If the constraints are linear, refactorization is subject only to the Factorization Frequency, and L+U will tend to increase between factorizations. |
BSwap |
is the number of columns of the basis matrix that were swapped with columns of to improve the condition of . The swaps are determined by an factorization of the rectangular matrix with stability being favoured more than sparsity. |
nS |
is the current number of superbasic variables. |
condHz |
is an estimate of the condition number of , itself an estimate of , the reduced Hessian of the Lagrangian. The condition number is the square of the ratio of the largest and smallest diagonals of the upper triangular matrix , this being a lower bound on the condition number of . condHz gives a rough indication of whether or not the optimization procedure is having difficulty. If is the relative machine precision being used, the SQP algorithm will make slow progress if condHz becomes as large as , and will probably fail to find a better solution if condHz reaches .
To guard against high values of condHz, attention should be given to the scaling of the variables and the constraints. In some cases it may be necessary to add upper or lower bounds to certain variables to keep them a reasonable distance from singularities in the nonlinear functions or their derivatives. |
Penalty |
is the Euclidean norm of the vector of penalty parameters used in the augmented Lagrangian merit function (not printed if there are no nonlinear constraints). |
The summary line may include additional code characters that indicate what happened during the course of the major iteration. These will follow the separator ‘_’ in the output
Label |
Description |
c |
central differences have been used to compute the unknown components of the objective and constraint gradients. A switch to central differences is made if either the linesearch gives a small step, or is close to being optimal. In some cases, it may be necessary to re-solve the QP subproblem with the central difference gradient and Jacobian. |
d |
during the linesearch it was necessary to decrease the step in order to obtain a maximum constraint violation conforming to the value of the optional parameter Violation Limit. |
D |
you set on exit from USRFUN, indicating that the linesearch needed to be done with a smaller value of the step length . |
l |
the norm wise change in the variables was limited by the value of the optional parameter Major Step Limit. If this output occurs repeatedly during later iterations, it may be worthwhile increasing the value of the optional parameter Major Step Limit. |
i |
if E04VHF is not in elastic mode, an i signifies that the QP subproblem is infeasible. This event triggers the start of nonlinear elastic mode, which remains in effect for all subsequent iterations. Once in elastic mode, the QP subproblems are associated with the elastic problem (12) (see Section 10.5).
If E04VHF is already in elastic mode, an i indicates that the minimizer of the elastic subproblem does not satisfy the linearized constraints. (In this case, a feasible point for the usual QP subproblem may or may not exist.) |
M |
an extra evaluation of the problem functions was needed to define an acceptable positive definite quasi-Newton update to the Lagrangian Hessian. This modification is only done when there are nonlinear constraints. |
m |
this is the same as M except that it was also necessary to modify the update to include an augmented Lagrangian term. |
n |
no positive definite BFGS update could be found. The approximate Hessian is unchanged from the previous iteration. |
R |
the approximate Hessian has been reset by discarding all but the diagonal elements. This reset will be forced periodically by the Hessian Frequency and Hessian Updates keywords. However, it may also be necessary to reset an ill-conditioned Hessian from time to time. |
r |
the approximate Hessian was reset after ten consecutive major iterations in which no BFGS update could be made. The diagonals of the approximate Hessian are retained if at least one update has been done since the last reset. Otherwise, the approximate Hessian is reset to the identity matrix. |
s |
a self-scaled BFGS update was performed. This update is used when the Hessian approximation is diagonal, and hence always follows a Hessian reset. |
t |
the minor iterations were terminated because of the Minor Iterations Limit. |
T |
the minor iterations were terminated because of the New Superbasics Limit. |
u |
the QP subproblem was unbounded. |
w |
a weak solution of the QP subproblem was found. |
z |
the Superbasics Limit was reached. |
12.2 Minor Iteration Log
If
, one line of information is output to the Print file every
th minor iteration, where
is the specified
Print Frequency. A heading is printed before the first such line following a basis factorization. The heading contains the items described below. In this description, a pricing operation is the process by which a nonbasic variable is selected to become superbasic (in addition to those already in the superbasic set). The selected variable is denoted by
jq. Variable
jq often becomes basic immediately. Otherwise it remains superbasic, unless it reaches its opposite bound and returns to the nonbasic set.
If
Partial Price is in effect, variable
jq is selected from
or
, the
th segments of the constraint matrix
.
Label |
Description |
Itn |
the current iteration number. |
LPmult or QPmult |
is the reduced cost (or reduced gradient) of the variable jq selected by the pricing procedure at the start of the present iteration. Algebraically, the reduced gradient is for , where is the gradient of the current objective function, is the vector of dual variables for the QP subproblem, and is the th column of .
Note that the reduced cost is the -norm of the reduced-gradient vector at the start of the iteration, just after the pricing procedure. |
LPstep or QPstep |
is the step length taken along the current search direction . The variables have just been changed to . Write Step to stand for LPStep or QPStep, depending on the problem. If a variable is made superbasic during the current iteration (), Step will be the step to the nearest bound. During Phase 2, the step can be greater than one only if the reduced Hessian is not positive definite. |
nInf |
is the number of infeasibilities after the present iteration. This number will not increase unless the iterations are in elastic mode. |
SumInf |
is the sum of infeasibilities after the present iteration, if . The value usually decreases at each nonzero Step, but if it decreases by or more, SumInf may occasionally increase. |
rgNorm |
is the norm of the reduced-gradient vector at the start of the iteration. (It is the norm of the vector with elements for variables in the superbasic set.) During Phase 2 this norm will be approximately zero after a unit step. (The heading is not printed if the problem is linear.) |
LPobjective or QPobjective |
the QP objective function after the present iteration. In elastic mode, the heading is changed to Elastic QPobj. In either case, the value printed decreases monotonically. |
+SBS |
is the variable jq selected by the pricing operation to be added to the superbasic set. |
-SBS |
is the superbasic variable chosen to become nonbasic. |
-BS |
is the basis variable removed (if any) to become nonbasic. |
Pivot |
if column replaces the th column of the basis , Pivot is the th element of a vector satisfying . Wherever possible, Step is chosen to avoid extremely small values of Pivot (since they cause the basis to be nearly singular). In rare cases, it may be necessary to increase the Pivot Tolerance to exclude very small elements of from consideration during the computation of Step. |
L+U |
is the number of nonzeros representing the basis factors and . Immediately after a basis factorization , L+U is lenL+lenU, the number of subdiagonal elements in the columns of a lower triangular matrix and the number of diagonal and superdiagonal elements in the rows of an upper-triangular matrix. Further nonzeros are added to L when various columns of are later replaced. As columns of are replaced, the matrix is maintained explicitly (in sparse form). The value of L will steadily increase, whereas the value of U may fluctuate up or down. Thus the value of L+U may fluctuate up or down (in general, it will tend to increase). |
ncp |
is the number of compressions required to recover storage in the data structure for . This includes the number of compressions needed during the previous basis factorization. |
nS |
is the current number of superbasic variables. (The heading is not printed if the problem is linear.) |
condHz |
see Section 12.1. (The heading is not printed if the problem is linear.) |
12.3 Crash Statistics
If
and
System Information Yes has been specified, the following items are output to the Print file when
and no Basis file is loaded. They refer to the number of columns that the Crash procedure selects during selected passes through
while searching for a triangular basis matrix.
Label |
Description |
Slacks |
is the number of slacks selected initially. |
Free cols |
is the number of free columns in the basis. |
Preferred |
is the number of ‘preferred’ columns in the basis (i.e., for some ). |
Unit |
is the number of unit columns in the basis. |
Double |
is the number of columns in the basis containing nonzeros. |
Triangle |
is the number of triangular columns in the basis. |
Pad |
is the number of slacks used to pad the basis (to make it a nonsingular triangle). |
12.4 Basis Factorization Statistics
If
, the first seven items listed below are output to the Print file whenever the basis
or the rectangular matrix
is factorized before solution of the next QP subproblem (see
Section 11.1).
Note that may be factorized at the start of just some of the major iterations. It is immediately followed by a factorization of itself.
Gaussian elimination is used to compute a sparse
factorization of
or
, where
and
are lower and upper triangular matrices, for some permutation matrices
and
. Stability is ensured as described under optional parameter
LU Factor Tolerance.
If
, the same items are printed during the QP solution whenever the current
is factorized. In addition, if
System Information Yes has been specified, the entries from
Elems onwards are also printed.
Label |
Description |
Factor |
the number of factorizations since the start of the run. |
Demand |
a code giving the reason for the present factorization, as follows:
Code |
Meaning |
0 |
First factorization. |
1 |
The number of updates reached the Factorization Frequency. |
2 |
The nonzeros in the updated factors have increased significantly. |
7 |
Not enough storage to update factors. |
10 |
Row residuals are too large (see the description of the optional parameter Check Frequency). |
11 |
Ill-conditioning has caused inconsistent results. |
|
Itn |
is the current minor iteration number. |
Nonlin |
is the number of nonlinear variables in the current basis . |
Linear |
is the number of linear variables in . |
Slacks |
is the number of slack variables in . |
B, BR, BS or BT factorize |
is the type of factorization.
B |
periodic factorization of the basis . |
BR |
more careful rank-revealing factorization of using threshold rook pivoting. This occurs mainly at the start, if the first basis factors seem singular or ill-conditioned. Followed by a normal B factorize. |
BS |
is factorized to choose a well-conditioned from the current . Followed by a normal B factorize. |
BT |
same as BS except the current is tried first and accepted if it appears to be not much more ill-conditioned than after the previous BS factorize. |
|
m |
is the number of rows in or . |
n |
is the number of columns in or . Preceded by ‘=’ or ‘>’ respectively. |
Elems |
is the number of nonzero elements in or . |
Amax |
is the largest nonzero in or . |
Density |
is the percentage nonzero density of or . |
Merit/MerRP/MerCP |
Merit is the average Markowitz merit count for the elements chosen to be the diagonals of . Each merit count is defined to be where and are the number of nonzeros in the column and row containing the element at the time it is selected to be the next diagonal. Merit is the average of n such quantities. It gives an indication of how much work was required to preserve sparsity during the factorization. If LU Complete Pivoting or LU Rook Pivoting has been selected, this heading is changed to MerCP, respectively MerRP. |
lenL |
is the number of nonzeros in . |
L+U |
is the number of nonzeros representing the basis factors and . Immediately after a basis factorization , this is lenL+lenU, the number of subdiagonal elements in the columns of a lower triangular matrix and the number of diagonal and superdiagonal elements in the rows of an upper-triangular matrix. Further nonzeros are added to L when various columns of are later replaced. As columns of are replaced, the matrix is maintained explicitly (in sparse form). The value of L will steadily increase, whereas the value of U may fluctuate up or down. Thus the value of L+U may fluctuate up or down (in general, it will tend to increase). |
Cmpressns |
is the number of times the data structure holding the partially factored matrix needed to be compressed to recover unused storage. Ideally this number should be zero. If it is more than or , the amount of workspace available to E04VHF should be increased for efficiency. |
Incres |
is the percentage increase in the number of nonzeros in and relative to the number of nonzeros in or . |
Utri |
is the number of triangular rows of or at the top of . |
lenU |
the number of nonzeros in , including its diagonals. |
Ltol |
is the largest subdiagonal element allowed in . This is the specified LU Factor Tolerance or a smaller value that is currently being used for greater stability. |
Umax |
the maximum nonzero element in . |
Ugrwth |
is the ratio , which ideally should not be substantially larger than or . If it is orders of magnitude larger, it may be advisable to reduce the LU Factor Tolerance to , , or , say (but bigger than ).
As long as Lmax is not large (say or less), gives an estimate of the condition number . If this is extremely large, the basis is nearly singular. Slacks are used to replace suspect columns of and the modified basis is refactored. |
Ltri |
is the number of triangular columns of or at the left of . |
dense1 |
is the number of columns remaining when the density of the basis matrix being factorized reached . |
Lmax |
is the actual maximum subdiagonal element in (bounded by Ltol). |
Akmax |
is the largest nonzero generated at any stage of the factorization. (Values much larger than Amax indicate instability.) Akmax is not printed if LU Partial Pivoting is selected. |
Agrwth |
is the ratio . Values much larger than (say) indicate instability. Agrwth is not printed if LU Partial Pivoting is selected. |
bump |
is the size of the block to be factorized nontrivially after the triangular rows and columns of or have been removed. |
dense2 |
is the number of columns remaining when the density of the basis matrix being factorized reached . (The Markowitz pivot strategy searches fewer columns at that stage.) |
DUmax |
is the largest diagonal of . |
DUmin |
is the smallest diagonal of . |
condU |
the ratio , which estimates the condition number of (and of if Ltol is less than , say). |
12.5 The Solution File
At the end of a run, the final solution may be output as a Solution file, according to
Solution File. Some header information appears first to identify the problem and the final state of the optimization procedure. A ROWS section and a COLUMNS section then follow, giving one line of information for each row and column. The format used is similar to certain commercial systems, though there is no industry standard.
In general, numerical values are output with format f16.5.
The maximum record length is characters, including the first (carriage-control) character.
To reduce clutter, a full stop (.) is printed for any numerical value that is exactly zero. The values are also printed specially as and . Infinite bounds ( or larger) are printed as None.
A Solution file is intended to be read from disk by a self-contained program that extracts and saves certain values as required for possible further computation. Typically, the first
records would be ignored.
Each subsequent record may be read using
format(i8, 2x, 2a4, 1x, a1, 1x, a3, 5e16.6, i7)
adapted to suit the occasion.
The end of the ROWS section is marked by a record that starts with a
and is otherwise blank. If this and the next
records are skipped, the COLUMNS section can then be read under the same format.
(There should be no need for backspace statements.)
A full description of the ROWS section and the COLUMNS section is given in
Sections 8.1.1 and
8.1.2.
12.6 The Summary File
If
, the following information is output to the unit number associated with
Summary File.
(It is a brief summary of the output directed to unit
Print File):
– |
the optional parameters supplied via the option setting routines, if any; |
– |
the Basis file loaded, if any; |
– |
a brief major iteration log (see Section 12.1); |
– |
a brief minor iteration log (see Section 12.2); |
– |
the exit condition, IFAIL; |
– |
a summary of the final iterate. |