naginterfaces.library.opt.nlp2_​solve

naginterfaces.library.opt.nlp2_solve(a, bl, bu, objfun, istate, ccon, cjac, clamda, h, x, comm, confun=None, data=None, io_manager=None, spiked_sorder='C')[source]

nlp2_solve is designed to minimize an arbitrary smooth function subject to constraints (which may include simple bounds on the variables, linear constraints and smooth nonlinear constraints) using a Sequential Quadratic Programming (SQP) method. As many first derivatives as possible should be supplied by you; any unspecified derivatives are approximated by finite differences. It is not intended for large sparse problems.

nlp2_solve may also be used for unconstrained, bound-constrained and linearly constrained optimization.

nlp2_solve uses forward communication for evaluating the objective function, the nonlinear constraint functions, and any of their derivatives.

The initialization function nlp2_init() must have been called before to calling nlp2_solve.

Note: this function uses optional algorithmic parameters, see also: nlp2_option_file(), nlp2_option_string(), nlp2_option_integer_set(), nlp2_option_double_set(), nlp2_init().

For full information please refer to the NAG Library document for e04wd

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/e04/e04wdf.html

Parameters
afloat, array-like, shape

Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .

The th row of contains the th row of the matrix of general linear constraints in (1). That is, the th row contains the coefficients of the th general linear constraint, for .

blfloat, array-like, shape

must contain the lower bounds for all the constraints

bufloat, array-like, shape

must contain the upper bounds for all the constraints

objfuncallable (mode, objf, grad) = objfun(mode, x, grad, nstate, data=None)

must calculate the objective function and (optionally) its gradient for a specified -vector .

Parameters
modeint

Is set by nlp2_solve to indicate which values must be assigned during each call of . Only the following values need be assigned:

.

All available elements of .

and all available elements of .

xfloat, ndarray, shape

, the vector of variables at which the objective function and/or all available elements of its gradient are to be evaluated.

gradfloat, ndarray, shape

The elements of are set to special values.

nstateint

If , then nlp2_solve is calling for the first time. This argument setting allows you to save computation time if certain data must be read or calculated only once.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
modeint

May be used to indicate that you are unable or unwilling to evaluate the objective function at the current .

During the linesearch, the function is evaluated at points of the form after they have already been evaluated satisfactorily at .

For any such , if you set , nlp2_solve will reduce and evaluate the functions again (closer to , where they are more likely to be defined).

If for some reason you wish to terminate the current problem, set .

objffloat

If or , must be set to the value of the objective function at .

gradfloat, array-like, shape

If or , must return the available elements of the gradient evaluated at , i.e., contains the partial derivative .

istateint, array-like, shape

Is an integer array that need not be initialized if nlp2_solve is called with the ‘Cold Start’ option (the default).

If option ‘Warm Start’ has been chosen, every element of must be set.

If nlp2_solve has just been called on a problem with the same dimensions, already contains valid values.

Otherwise, should indicate whether either of the constraints or is expected to be active at a solution of (1).

The ordering of is the same as for , and , i.e., the first components of refer to the upper and lower bounds on the variables, the next refer to the bounds on , and the last refer to the bounds on .

Possible values of follow:

Neither nor is expected to be active.

is expected to be active.

is expected to be active.

This may be used if . Normally an equality constraint is active at a solution.

The values , or all have the same effect when .

If necessary, nlp2_solve will override your specification of , so that a poor choice will not cause the algorithm to fail.

cconfloat, array-like, shape

need not be initialized if the (default) option ‘Cold Start’ is used.

For a ‘Warm Start’, and if , contains values of the nonlinear constraint functions , for , calculated in a previous call to nlp2_solve.

cjacfloat, array-like, shape

Note: the required extent for this argument in dimension 2 is determined as follows: if : ; otherwise: .

In general, need not be initialized before the call to nlp2_solve. However, if or , any constant elements of may be initialized. Such elements need not be reassigned on subsequent calls to .

clamdafloat, array-like, shape

Need not be set if the (default) option ‘Cold Start’ is used.

If the option ‘Warm Start’ has been chosen, must contain a multiplier estimate for each nonlinear constraint, with a sign that matches the status of the constraint specified by the array, for .

The remaining elements need not be set.

If the th constraint is defined as ‘inactive’ by the initial value of the array (i.e., ), should be zero; if the th constraint is an inequality active at its lower bound (i.e., ), should be non-negative; if the th constraint is an inequality active at its upper bound (i.e., ), should be non-positive.

If necessary, the function will modify to match these rules.

hfloat, array-like, shape

need not be initialized if the (default) option ‘Cold Start’ is used, and will be set to the identity.

If the option ‘Warm Start’ has been chosen, provides the initial approximation of the Hessian of the Lagrangian, i.e., , where and is an estimate of the Lagrange multipliers. must be a positive definite matrix.

xfloat, array-like, shape

An initial estimate of the solution.

commdict, communication object, modified in place

Communication structure.

This argument must have been initialized by a prior call to nlp2_init().

confunNone or callable (mode, ccon, cjac) = confun(mode, needc, x, cjac, nstate, data=None), optional

Note: if this argument is None then a NAG-supplied facility will be used.

must calculate the vector of nonlinear constraint functions and (optionally) its Jacobian, , for a specified -vector .

If there are no nonlinear constraints (i.e., ), nlp2_solve will never call , so it may be None. If there are nonlinear constraints, the first call to will occur before the first call to .

If all constraint gradients (Jacobian elements) are known (i.e., or ), any constant elements may be assigned to once only at the start of the optimization.

An element of that is not subsequently assigned in will retain its initial value throughout.

Constant elements may be loaded in during the first call to (signalled by the value of ).

The ability to preload constants is useful when many Jacobian elements are identically zero, in which case may be initialized to zero and nonzero elements may be reset by .

It must be emphasized that, if , unassigned elements of are not treated as constant; they are estimated by finite differences, at nontrivial expense.

Parameters
modeint

Is set by nlp2_solve to indicate which values must be assigned during each call of . Only the following values need be assigned, for each value of such that :

The components of corresponding to positive values in must be set. Other components and the array are ignored.

The known components of the rows of corresponding to positive values in must be set. Other rows of and the array will be ignored.

Only the elements of corresponding to positive values of need to be set (and similarly for the known components of the rows of ).

needcint, ndarray, shape

The indices of the elements of and/or that must be evaluated by . If , the th element of and/or the available elements of the th row of (see argument ) must be evaluated at .

xfloat, ndarray, shape

, the vector of variables at which the constraint functions and/or the available elements of the constraint Jacobian are to be evaluated.

cjacfloat, ndarray, shape

The elements of are set to special values that enable nlp2_solve to detect whether they are reset by .

nstateint

If , then nlp2_solve is calling for the first time. This argument setting allows you to save computation time if certain data must be read or calculated only once.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
modeint

May be used to indicate that you are unable or unwilling to evaluate the constraint functions at the current .

During the linesearch, the constraint functions are evaluated at points of the form after they have already been evaluated satisfactorily at .

At any such , if you set , nlp2_solve will evaluate the functions at some point closer to (where they are more likely to be defined).

If for some reason you wish to terminate the current problem, set .

cconfloat, array-like, shape

If and or , must contain the value of the th constraint at . The remaining elements of , corresponding to the non-positive elements of , are ignored.

cjacfloat, array-like, shape

If and or , the th row of must contain the available elements of the vector given by

where is the partial derivative of the th constraint with respect to the th variable, evaluated at the point . See also the argument . The remaining rows of , corresponding to non-positive elements of , are ignored.

If all elements of the constraint Jacobian are known (i.e., or ), any constant elements may be assigned to one time only at the start of the optimization.

An element of that is not subsequently assigned in will retain its initial value throughout.

Constant elements may be loaded into during the first call to (signalled by the value ).

The ability to preload constants is useful when many Jacobian elements are identically zero, in which case may be initialized to zero and nonzero elements may be reset by .

Note that constant nonzero elements do affect the values of the constraints.

Thus, if is set to a constant value, it need not be reset in subsequent calls to , but the value must nonetheless be added to .

For example, if and , then the term must be included in the definition of .

It must be emphasized that, if or , unassigned elements of are not treated as constant; they are estimated by finite differences, at nontrivial expense.

If you do not supply a value for the option ‘Difference Interval’, an interval for each element of is computed automatically at the start of the optimization.

The automatic procedure can usually identify constant elements of , which are then computed once only by finite differences.

dataarbitrary, optional

User-communication data for callback functions.

io_managerFileObjManager, optional

Manager for I/O in this routine.

spiked_sorderstr, optional

If and are spiked (i.e., have unit extent in all but one dimension, or have size ), selects the storage order to associate with them in the NAG Engine:

spiked_sorder =

row-major storage will be used;

spiked_sorder =

column-major storage will be used.

Two-dimensional arrays returned from callback functions in this routine must then use the same storage order.

Returns
majitsint

The number of major iterations performed.

istateint, ndarray, shape

Describes the status of the constraints . For the th lower or upper bound, , the possible values of are as follows (see Figure [label omitted]). is the appropriate feasibility tolerance.

(Region 1) The lower bound is violated by more than .

(Region 5) The upper bound is violated by more than .

(Region 3) Both bounds are satisfied by more than .

(Region 2) The lower bound is active (to within ).

(Region 4) The upper bound is active (to within ).

() The bounds are equal and the equality constraint is satisfied (to within ).

These values of are labelled in the printed solution according to Table [label omitted].

Region

Printed solution

LL

FR

UL

++

EQ

cconfloat, ndarray, shape

If , contains the value of the th nonlinear constraint function at the final iterate, for .

If , the array is not referenced.

cjacfloat, ndarray, shape

If , contains the Jacobian matrix of the nonlinear constraint functions at the final iterate, i.e., contains the partial derivative of the th constraint function with respect to the th variable, for , for . (See the discussion of argument under .)

If , the array is not referenced.

clamdafloat, ndarray, shape

The values of the QP multipliers from the last QP subproblem. should be non-negative if and non-positive if .

objffloat

The value of the objective function at the final iterate.

gradfloat, ndarray, shape

The gradient of the objective function (or its finite difference approximation) at the final iterate.

hfloat, ndarray, shape

Contains the Hessian of the Lagrangian at the final estimate .

xfloat, ndarray, shape

The final estimate of the solution.

Other Parameters
‘Central Difference Interval’float

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 option, a small value between and is appropriate.

‘Check Frequency’int

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.

‘Cold Start’valueless

Default

This option controls the specification of the initial working set in the procedure for finding a feasible point for the linear constraints and bounds and in the first QP subproblem thereafter. With a ‘Cold Start’, the first working set is chosen by nlp2_solve based on the values of the variables and constraints at the initial point. Broadly speaking, the initial working set will include equality constraints and bounds or inequality constraints that violate or ‘nearly’ satisfy their bounds (to within ‘Crash Tolerance’).

With a ‘Warm Start’, you must set the array and define and as discussed in Parameters. values associated with bounds and linear constraints determine the initial working set of the procedure to find a feasible point with respect to the bounds and linear constraints. values associated with nonlinear constraints determine the initial working set of the first QP subproblem after such a feasible point has been found. nlp2_solve will override your specification of if necessary, so that a poor choice of the working set will not cause a fatal error. For instance, any elements of which are set to , or will be reset to zero, as will any elements which are set to when the corresponding elements of and are not equal. A warm start will be advantageous if a good estimate of the initial working set is available – for example, when nlp2_solve is called repeatedly to solve related problems.

‘Warm Start’valueless

This option controls the specification of the initial working set in the procedure for finding a feasible point for the linear constraints and bounds and in the first QP subproblem thereafter. With a ‘Cold Start’, the first working set is chosen by nlp2_solve based on the values of the variables and constraints at the initial point. Broadly speaking, the initial working set will include equality constraints and bounds or inequality constraints that violate or ‘nearly’ satisfy their bounds (to within ‘Crash Tolerance’).

With a ‘Warm Start’, you must set the array and define and as discussed in Parameters. values associated with bounds and linear constraints determine the initial working set of the procedure to find a feasible point with respect to the bounds and linear constraints. values associated with nonlinear constraints determine the initial working set of the first QP subproblem after such a feasible point has been found. nlp2_solve will override your specification of if necessary, so that a poor choice of the working set will not cause a fatal error. For instance, any elements of which are set to , or will be reset to zero, as will any elements which are set to when the corresponding elements of and are not equal. A warm start will be advantageous if a good estimate of the initial working set is available – for example, when nlp2_solve is called repeatedly to solve related problems.

‘Crash Option’int

Default

If a ‘Cold Start’ is specified, an internal Crash procedure is used to select an initial basis from certain rows and columns of the constraint matrix . The option ‘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, must 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 .

‘Crash Tolerance’float

Default

If a ‘Cold Start’ is specified, an internal Crash procedure is used to select an initial basis from certain rows and columns of the constraint matrix . The option ‘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, must 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 .

‘Defaults’valueless

This special keyword may be used to reset all options to their default values.

‘Derivative Level’int

Default

Option ‘Derivative Level’ specifies which nonlinear function gradients are known analytically and will be supplied to nlp2_solve by functions and .

Meaning

All objective and constraint gradients are known.

All constraint gradients are known, but some or all components of the objective gradient are unknown.

The objective gradient is known, but some or all of the constraint gradients are unknown.

Some components of the objective gradient are unknown and some of the constraint gradients are unknown.

The value should be used whenever possible. It is the most reliable and will usually be the most efficient.

If or , nlp2_solve will estimate the missing components of the objective gradient, using finite differences. This may simplify the coding of . However, it could increase the total run-time substantially (since a special call to is required for each missing element), and there is less assurance that an acceptable solution will be located. If the nonlinear variables are not well scaled, it may be necessary to specify a non-default option ‘Difference Interval’.

If or , nlp2_solve will estimate missing elements of the Jacobian. For each column of the Jacobian, one call to is needed to estimate all missing elements in that column, if any.

At times, central differences are used rather than forward differences. (This is not under your control.)

‘Derivative Linesearch’valueless

Default

At each major iteration a linesearch is used to improve the merit function. Option ‘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 option ‘Nonderivative Linesearch’ is specified, nlp2_solve 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, nlp2_solve signals the evaluation of the linesearch by calling with . If the potential saving provided by a nonderivative linesearch is to be realised, it is essential that be coded so that derivatives are not computed when .

‘Nonderivative Linesearch’valueless

At each major iteration a linesearch is used to improve the merit function. Option ‘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 option ‘Nonderivative Linesearch’ is specified, nlp2_solve 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, nlp2_solve signals the evaluation of the linesearch by calling with . If the potential saving provided by a nonderivative linesearch is to be realised, it is essential that be coded so that derivatives are not computed when .

‘Difference Interval’float

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 option, a small value between and is appropriate.

‘Dump File’int

Default

Options ‘Dump File’ and ‘Load File’ are similar to options ‘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 options ‘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 options ‘Old Basis File’ or ‘Insert File’ are specified.

‘Load File’int

Default

Options ‘Dump File’ and ‘Load File’ are similar to options ‘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 options ‘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 options ‘Old Basis File’ or ‘Insert File’ are specified.

‘Elastic Weight’float

Default

This keyword determines the initial weight associated with the problem (1) (see Treatment of Constraint Infeasibilities).

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 (1) (see Treatment of Constraint Infeasibilities). 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’int

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 option ‘Minor Feasibility Tolerance’ is . Over a period of iterations, the tolerance actually used by nlp2_solve 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 option ‘Pivot Tolerance’).

‘Factorization Frequency’int

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 option ‘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’float

Default

The relative function precision is intended to be a measure of the relative accuracy with which the 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 or 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’valueless

Default if

These options select the method for storing and updating the approximate Hessian. (nlp2_solve 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 Limited Memory’valueless

Default if

These options select the method for storing and updating the approximate Hessian. (nlp2_solve 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’int

Default

If option ‘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).

‘Hessian Updates’int

Default if ‘Hessian Full Memory’, otherwise

If option ‘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’float

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’int

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 option ‘Minor Iterations Limit’.)

‘Linesearch Tolerance’float

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 argument 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.

‘Nolist’valueless

Default

Option ‘List’ enables printing of each option specification as it is supplied. ‘Nolist’ suppresses this printing.

‘List’valueless

Option ‘List’ enables printing of each option specification as it is supplied. ‘Nolist’ suppresses this printing.

‘LU Density Tolerance’float

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 Singularity Tolerance’float

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’float

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, or (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 Update Tolerance’float

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, or (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’valueless

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 options ‘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, nlp2_solve 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’).

‘LU Complete Pivoting’valueless

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 options ‘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, nlp2_solve 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’).

‘LU Rook Pivoting’valueless

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 options ‘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, nlp2_solve 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’float

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 .

In the major iteration log (see Minor Iteration Log, 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’float

Default

This tolerance, , specifies the final accuracy of the dual variables. On successful termination, nlp2_solve will have computed a solution such that

where is an estimate of the complementarity slackness for variable where . 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’int

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’int

Default

This controls the amount of output to the options ‘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’float

Default

This argument 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 .

  1. In some cases, such as or , even a moderate change in the components of can lead to floating-point overflow. The argument is, therefore, used to define a limit (where is the search direction), and the first evaluation of is at the potentially smaller step length .

  2. Wherever possible, upper and lower bounds on should be used to prevent evaluation of nonlinear functions at meaningless points. The option ‘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.

  3. In cases where several local optima exist, specifying a small value for may help locate an optimum near the starting point.

‘Minimize’valueless

Default

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 nlp2_solve.

‘Maximize’valueless

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 nlp2_solve.

‘Feasible Point’valueless

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 nlp2_solve.

‘Minor Feasibility Tolerance’valueless

nlp2_solve 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 option ‘Major Feasibility Tolerance’ (not by ).

If the bounds and linear constraints cannot be satisfied to within , the problem is declared infeasible. If the corresponding sum of infeasibilities 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, nlp2_solve 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. nlp2_solve is then in elastic mode thereafter (with only the linearized nonlinear constraints defined to be elastic). See the description of the option ‘Elastic Weight’.

‘Feasibility Tolerance’float

Default

nlp2_solve 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 option ‘Major Feasibility Tolerance’ (not by ).

If the bounds and linear constraints cannot be satisfied to within , the problem is declared infeasible. If the corresponding sum of infeasibilities 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, nlp2_solve 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. nlp2_solve is then in elastic mode thereafter (with only the linearized nonlinear constraints defined to be elastic). See the description of the option ‘Elastic Weight’.

‘Minor Iterations Limit’int

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 Minor Iteration Log) a t at the end of a line indicates that the corresponding QP was artificially terminated using the limit .

Compare with the option ‘Iterations Limit’, which defines an independent absolute limit on the total number of minor iterations (summed over all QP subproblems).

‘Minor Print Level’int

Default

This controls the amount of output to the ‘Print File’ and the ‘Summary File’ during solution of the QP subproblems. The value of has the following effect:

Output

No minor iteration output except error messages.

A single line of output at each minor iteration (controlled by options ‘Print Frequency’ and ‘Summary Frequency’.

Basis factorization statistics generated during the periodic refactorization of the basis (see the option ‘Factorization Frequency’). Statistics for the first factorization each major iteration are controlled by the option ‘Major Print Level’.

‘New Basis File’int

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 on 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 nlp2_solve 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 11
New Basis File 12

The current basis will then be saved every iterations, first on the file associated with unit and then immediately on the file associated with unit . If the run is interrupted at iteration during the save on the file associated with unit , there will still be a usable basis on 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).

‘Backup Basis File’int

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 on 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 nlp2_solve 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 11
New Basis File 12

The current basis will then be saved every iterations, first on the file associated with unit and then immediately on the file associated with unit . If the run is interrupted at iteration during the save on the file associated with unit , there will still be a usable basis on 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).

‘Save Frequency’int

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 on 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 nlp2_solve 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 11
New Basis File 12

The current basis will then be saved every iterations, first on the file associated with unit and then immediately on the file associated with unit . If the run is interrupted at iteration during the save on the file associated with unit , there will still be a usable basis on 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’int

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 Major Iteration Log), a t at the end of a line indicates that the QP was terminated early in this way.

‘Old Basis File’int

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.

‘Partial Price’int

Default

This argument 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’float

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.

‘Print File’int

Default

If , the following information is output to a file associated with unit during the solution of each problem:

  • a listing of the options;

  • 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 condition and some statistics about the solution obtained;

  • the printed solution, if requested.

These items are described in Further Comments and Monitoring Information. Further brief output may be directed to the ‘Summary File’.

‘Print Frequency’int

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’int

Default

specifies minimization of or when the starting point is changed to satisfy the linear constraints (where refers to nonlinear variables).

‘Punch File’int

Default

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.

‘Insert File’int

Default

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.

‘QPSolver Cholesky’valueless

Default

Specifies the active-set algorithm used to solve subproblem (1) (see Treatment of Constraint Infeasibilities). ‘QPSolver Cholesky’ holds the full Cholesky factor of the reduced Hessian . As the QP iterations proceed, the dimension of changes with the number of superbasic variables. If the number of superbasic variables needs to increase beyond the value of ‘Reduced Hessian Dimension’, the reduced Hessian cannot be stored and the solver switches to ‘QPSolver CG’. The Cholesky solver is reactivated if the number of superbasics stabilizes at a value less than ‘Reduced Hessian Dimension’.

‘QPSolver QN’ solves the QP using a quasi-Newton method. In this case, is the factor of a quasi-Newton approximate Hessian.

‘QPSolver CG’ uses an active-set method similar to ‘QPSolver QN’, but uses the conjugate-gradient method to solve all systems involving the reduced Hessian.

The Cholesky QP solver is the most robust, but may require a significant amount of computation if there are many superbasics.

The quasi-Newton QP solver does not require computation of the exact at the start of the subproblem in (1). It may be appropriate when the number of superbasics is large but relatively few iterations are needed to reach a solution (e.g., if nlp2_solve is called with a Warm Start).

The conjugate-gradient QP solver is appropriate for problems with many degrees of freedom (say, more than superbasics).

‘QPSolver CG’valueless

Specifies the active-set algorithm used to solve subproblem (1) (see Treatment of Constraint Infeasibilities). ‘QPSolver Cholesky’ holds the full Cholesky factor of the reduced Hessian . As the QP iterations proceed, the dimension of changes with the number of superbasic variables. If the number of superbasic variables needs to increase beyond the value of ‘Reduced Hessian Dimension’, the reduced Hessian cannot be stored and the solver switches to ‘QPSolver CG’. The Cholesky solver is reactivated if the number of superbasics stabilizes at a value less than ‘Reduced Hessian Dimension’.

‘QPSolver QN’ solves the QP using a quasi-Newton method. In this case, is the factor of a quasi-Newton approximate Hessian.

‘QPSolver CG’ uses an active-set method similar to ‘QPSolver QN’, but uses the conjugate-gradient method to solve all systems involving the reduced Hessian.

The Cholesky QP solver is the most robust, but may require a significant amount of computation if there are many superbasics.

The quasi-Newton QP solver does not require computation of the exact at the start of the subproblem in (1). It may be appropriate when the number of superbasics is large but relatively few iterations are needed to reach a solution (e.g., if nlp2_solve is called with a Warm Start).

The conjugate-gradient QP solver is appropriate for problems with many degrees of freedom (say, more than superbasics).

‘QPSolver QN’valueless

Specifies the active-set algorithm used to solve subproblem (1) (see Treatment of Constraint Infeasibilities). ‘QPSolver Cholesky’ holds the full Cholesky factor of the reduced Hessian . As the QP iterations proceed, the dimension of changes with the number of superbasic variables. If the number of superbasic variables needs to increase beyond the value of ‘Reduced Hessian Dimension’, the reduced Hessian cannot be stored and the solver switches to ‘QPSolver CG’. The Cholesky solver is reactivated if the number of superbasics stabilizes at a value less than ‘Reduced Hessian Dimension’.

‘QPSolver QN’ solves the QP using a quasi-Newton method. In this case, is the factor of a quasi-Newton approximate Hessian.

‘QPSolver CG’ uses an active-set method similar to ‘QPSolver QN’, but uses the conjugate-gradient method to solve all systems involving the reduced Hessian.

The Cholesky QP solver is the most robust, but may require a significant amount of computation if there are many superbasics.

The quasi-Newton QP solver does not require computation of the exact at the start of the subproblem in (1). It may be appropriate when the number of superbasics is large but relatively few iterations are needed to reach a solution (e.g., if nlp2_solve is called with a Warm Start).

The conjugate-gradient QP solver is appropriate for problems with many degrees of freedom (say, more than superbasics).

‘Reduced Hessian Dimension’int

Default

This specifies that an triangular matrix (to define the reduced Hessian according to ) is to be available for use by the Cholesky QP solver.

‘Scale Option’int

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.

Option ‘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 .

‘Scale Tolerance’float

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.

Option ‘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 .

‘Scale Print’valueless

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.

Option ‘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 .

‘Solution File’int

Default

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’.

‘Start Objective Check At Variable’int

Default

These keywords take effect only if . They may be used to contol the verification of gradient elements computed by function and/or Jacobian elements computed by function . For eample, if the first elements of the objective gradient appeared to be correct in an earlier run, so that only element remains questionable, it is reasonable to specify . If the first variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.

‘Stop Objective Check At Variable’int

Default

These keywords take effect only if . They may be used to contol the verification of gradient elements computed by function and/or Jacobian elements computed by function . For eample, if the first elements of the objective gradient appeared to be correct in an earlier run, so that only element remains questionable, it is reasonable to specify . If the first variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.

‘Start Constraint Check At Variable’int

Default

These keywords take effect only if . They may be used to contol the verification of gradient elements computed by function and/or Jacobian elements computed by function . For eample, if the first elements of the objective gradient appeared to be correct in an earlier run, so that only element remains questionable, it is reasonable to specify . If the first variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.

‘Stop Constraint Check At Variable’int

Default

These keywords take effect only if . They may be used to contol the verification of gradient elements computed by function and/or Jacobian elements computed by function . For eample, if the first elements of the objective gradient appeared to be correct in an earlier run, so that only element remains questionable, it is reasonable to specify . If the first variables appear linearly in the objective, so that the corresponding gradient elements are constant, the above choice would also be appropriate.

‘Summary File’int

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 The Summary File.

‘Summary Frequency’int

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 The Summary File.

‘Superbasics Limit’int

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.

‘Suppress Parameters’valueless

Normally nlp2_solve prints the options file as it is being read, and then prints a complete list of the available keywords and their final values. The option ‘Suppress Parameters’ tells nlp2_solve not to print the full list.

‘System Information No’valueless

Default

This option prints additional information on the progress of major and minor iterations, and Crash statistics. See Monitoring Information.

‘System Information Yes’valueless

This option prints additional information on the progress of major and minor iterations, and Crash statistics. See Monitoring Information.

‘Timing Level’int

Default

If , some timing information will be output to the Print file, if .

‘Unbounded Objective’float

Default

These arguments 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 = 5.

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.

‘Unbounded Step Size’float

Default

These arguments 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 = 5.

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.

‘Verify Level’int

Default

This option refers to finite difference checks on the derivatives computed by the user-supplied functions. 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 .

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 function function is being developed. Missing derivatives are not checked, so they result in no overhead.

‘Violation Limit’float

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 obective is bounded below for all values of the variables, may be any large positive value.

Raises
NagValueError
(errno )

The initialization function nlp2_init() has not been called.

(errno )

On entry, bounds and for are equal and infinite. and .

(errno )

On entry, bounds for are inconsistent. and .

(errno )

On entry, bounds and for are equal and infinite. and .

(errno )

On entry, bounds for are inconsistent. and .

(errno )

Basis file dimensions do not match this problem.

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

User-supplied function computes incorrect objective derivatives.

(errno )

User-supplied function computes incorrect constraint derivatives.

(errno )

Internal error: memory allocation failed when attempting to allocate workspace sizes and . Please contact NAG.

(errno )

Internal memory allocation was insufficient. Please contact NAG.

(errno )

An error has occurred in the basis package, perhaps indicating incorrect setup of arrays. Set the option ‘Print File’ and examine the output carefully for further information.

(errno )

An unexpected error has occurred. Set the option ‘Print File’ and examine the output carefully for further information.

Warns
NagAlgorithmicWarning
(errno )

The requested accuracy could not be achieved.

(errno )

The linear constraints appear to be infeasible.

(errno )

The problem appears to be infeasible. The linear equality constraints could not be satisfied.

(errno )

The problem appears to be infeasible. Nonlinear infeasibilites have been minimized.

(errno )

The problem appears to be infeasible. Infeasibilites have been minimized.

(errno )

The problem appears to be unbounded. The objective function is unbounded.

(errno )

The problem appears to be unbounded. The constraint violation limit has been reached.

(errno )

Numerical difficulties have been encountered and no further progress can be made.

(errno )

User-supplied constraint function requested termination.

(errno )

User-supplied objective function requested termination.

NagAlgorithmicMajorWarning
(errno )

Iteration limit reached.

(errno )

Major iteration limit reached.

(errno )

The value of the option ‘Superbasics Limit’ is too small.

(errno )

User-supplied function is undefined at the first feasible point.

(errno )

User-supplied function is undefined at the initial point.

(errno )

Unable to proceed into undefined region of user-supplied function.

Notes

nlp2_solve is designed to solve nonlinear programming problems – the minimization of a smooth nonlinear function subject to a set of constraints on the variables. nlp2_solve is suitable for small dense problems. The problem is assumed to be stated in the following form:

where (the objective function) is a nonlinear scalar function, is an constant matrix, and is an -vector of nonlinear constraint functions. (The matrix and the vector may be empty.) The objective function and the constraint functions are assumed to be smooth, here meaning at least twice-continuously differentiable. (The method of nlp2_solve will usually solve (1) if there are only isolated discontinuities away from the solution.) We also write for the vector of combined functions:

Note that although the bounds on the variables could be included in the definition of the linear constraints, we prefer to distinguish between them for reasons of computational efficiency. For the same reason, the linear constraints should not be included in the definition of the nonlinear constraints. Upper and lower bounds are specified for all the variables and for all the constraints. An equality constraint on can be specified by setting . If certain bounds are not present, the associated elements of or can be set to special values that will be treated as or . (See the description of the option ‘Infinite Bound Size’.)

Figure [label omitted] illustrates the feasible region for the th pair of constraints . The quantity of is the ‘Feasibility Tolerance’, which can be set by you (see Other Parameters). The constraints are considered ‘satisfied’ if lies in Regions 2, 3 or 4, and ‘inactive’ if lies in Region 3. The constraint is considered ‘active’ in Region 2, and ‘violated’ in Region 1. Similarly, is active in Region 4, and violated in Region 5. For equality constraints (), Regions 2 and 4 are the same and Region 3 is empty.

[figure omitted]

If there are no nonlinear constraints in (1) and is linear or quadratic, then it will generally be more efficient to use one of lp_solve(), lsq_lincon_solve() or qp_dense_solve(). If the problem is large and sparse and does have nonlinear constraints, then handle_solve_ssqp() should be used, since nlp2_solve treats all matrices as dense.

You must supply an initial estimate of the solution to (1), together with functions that define and with as many first partial derivatives as possible; unspecified derivatives are approximated by finite differences; see Other Parameters for a discussion of the option ‘Derivative Level’.

The objective function is defined by , and the nonlinear constraints are defined by . Note that if there are any nonlinear constraints then the first call to will precede the first call to .

For maximum reliability, it is preferable for you to provide all partial derivatives (see Module 8 of Gill et al. (1981), for a detailed discussion). If all gradients cannot be provided, it is similarly advisable to provide as many as possible. While developing and , the option ‘Verify Level’ should be used to check the calculation of any known gradients.

The method used by nlp2_solve is based on NPOPT, which is part of the SNOPT package described in Gill et al. (2005b), and the algorithm it uses is described in detail in Algorithmic Details.

References

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, 2005, 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, https://www.ccom.ucsd.edu/~peg/papers/sqdoc7.pdf

Gill, P E, Murray, W and Saunders, M A, 2005, 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, https://www.ccom.ucsd.edu/~peg/papers/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, 1992, Some theoretical properties of an augmented Lagrangian merit function, Advances in Optimization and Parallel Computing, (ed P M Pardalos), 101–128, North Holland

Gill, P E, Murray, W and Wright, M H, 1981, Practical Optimization, Academic Press

Hock, W and Schittkowski, K, 1981, Test Examples for Nonlinear Programming Codes. Lecture Notes in Economics and Mathematical Systems (187), Springer–Verlag