|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.math.MinConNLP
public class MinConNLP
General nonlinear programming solver.
MinConNLP
is based on the FORTRAN subroutine, DONLP2
,
by Peter Spellucci and licensed from TU Darmstadt. MinConNLP
uses a
sequential equality constrained quadratic programming method with an active set
technique, and an alternative usage of a fully regularized mixed constrained subproblem
in case of nonregular constraints (i.e. linear dependent gradients in the "working sets").
It uses a slightly modified version of the Pantoja-Mayne update for the Hessian of the
Lagrangian, variable dual scaling and an improved Armjijo-type stepsize algorithm. Bounds
on the variables are treated in a gradient-projection like fashion. Details may be found
in the following two papers:
P. Spellucci: An SQP method for general nonlinear programs using only equality constrained subproblems. Math. Prog. 82, (1998), 413-448.
P. Spellucci: A new technique for inconsistent problems in the SQP method. Math. Meth. of Oper. Res. 47, (1998), 355-500. (published by Physica Verlag, Heidelberg, Germany).
The problem is stated as follows:
subject to
where all problem functions are assumed to be continuously differentiable.
Although default values are provided for optional input arguments, it may be
necessary to adjust these values for some problems. Through the use of member
functions, MinConNLP
allows for several parameters of the algorithm
to be adjusted to account for specific characteristics of problems. The
DONLP2
Users Guide
provides detailed descriptions of these parameters as well as
strategies for maximizing the performance of the algorithm.
In addition, the following are a number of guidelines to
consider when using MinConNLP
:
setGuess
.
MinConNLP
.
Selecting a higher order approximation method may be necessary for some
problems. See method setDifferentiationType
.
setBindingThreshold
.
ierr
provided in the interface to the user supplied function FCN
can be very useful in cases when evaluation is requested at a point that is not
possible or reasonable. For example, if evaluation at the requested point would
result in a floating point exception, then setting ierr
to true
and
returning without performing the evaluation will avoid the exception. MinConNLP
will then
reduce the stepsize and try the step again. Note, if ierr
is set to true
for the initial guess, then an error is issued.
The solver terminates if there is an error or if one of the following
three terminations conditions is satisfied.
The method getTerminationCondition
returns the
termination condition index.
Note that one can use the JDK 1.4 JAVA Logging API to generate intermediate output for the solver. Accumulated levels of detail correspond to JAVA's CONFIG, FINE, FINER, and FINEST logging levels with CONFIG yielding the smallest amount of information and FINEST yielding the most. The levels of output yield the following:
Level | Output |
CONFIG | One line of intermediate results is printed with each iteration. A summary report is printed upon completion. |
FINE | Lines of intermediate results giving the most important data for each step are printed after each step. A summary report is printed upon completion. |
FINER | Lines of detailed intermediate results showing all primal and dual variables, the relevant values from the working set, progress in the backtracking, etc. are printed. A summary report is printed upon completion. |
FINEST | Lines of detailed intermediate results showing all primal and dual variables, the relevant values from the working set, progress in the backtracking, the gradients in the working set, the quasi-Newton updated, etc. are printed. A summary report is printed upon completion. |
Nested Class Summary | |
---|---|
static class |
MinConNLP.BadInitialGuessException
Penalty function point infeasible for original problem. |
static class |
MinConNLP.ConstraintEvaluationException
Constraint evaluation returns an error with current point. |
static interface |
MinConNLP.Function
Public interface for the user supplied function to the MinConNLP object. |
static interface |
MinConNLP.Gradient
Public interface for the user supplied function to compute the gradient for MinConNLP object. |
static class |
MinConNLP.IllConditionedException
Problem is singular or ill-conditioned. |
static class |
MinConNLP.LimitingAccuracyException
Limiting accuracy reached for a singular problem. |
static class |
MinConNLP.LinearlyDependentGradientsException
Working set gradients are linearly dependent. |
static class |
MinConNLP.NoAcceptableStepsizeException
No acceptable stepsize in [SIGMA,SIGLA]. |
static class |
MinConNLP.ObjectiveEvaluationException
Objective evaluation returns an error with current point. |
static class |
MinConNLP.PenaltyFunctionPointInfeasibleException
Penalty function point infeasible. |
static class |
MinConNLP.QPInfeasibleException
QP problem seemingly infeasible. |
static class |
MinConNLP.SingularException
Problem is singular. |
static class |
MinConNLP.TerminationCriteriaNotSatisfiedException
Termination criteria are not satisfied. |
static class |
MinConNLP.TooManyIterationsException
Maximum number of iterations exceeded. |
static class |
MinConNLP.TooMuchTimeException
Maximum time allowed for solve exceeded. |
static class |
MinConNLP.WorkingSetSingularException
Working set is singular in dual extended QP. |
Constructor Summary | |
---|---|
MinConNLP(int mTotalConstraints,
int mEqualityConstraints,
int nVariables)
Nonlinear programming solver constructor. |
Method Summary | |
---|---|
double[] |
getConstraintResiduals()
Returns the constraint residuals. |
int |
getIterations()
Returns the actual number of iterations used. |
double[] |
getLagrangeMultiplierEst()
Returns the Lagrange multiplier estimates of the constraints. |
Logger |
getLogger()
Returns the logger object. |
long |
getMaximumTime()
Returns the maximum time allowed for the solve step. |
double[] |
getSolution()
Returns the last computed solution. |
int |
getTerminationCriterion()
Returns the reason the solve step terminated. |
double |
getTolerance()
Returns the desired precision of the solution. |
void |
setBindingThreshold(double del0)
Set the binding threshold for constraints. |
void |
setBoundViolationBound(double taubnd)
Set the amount by which bounds may be violated during numerical differentiation. |
void |
setDifferentiationType(int idtype)
Set the type of numerical differentiation to be used. |
void |
setFunctionPrecision(double epsfcn)
Set the relative precision of the function evaluation routine. |
void |
setGradientPrecision(double epsdif)
Set the relative precision in gradients. |
void |
setGuess(double[] xguess)
Set the initial guess of the minimum point of the input function. |
void |
setMaximumTime(long maximumTime)
Sets the maximum time allowed for the solve step. |
void |
setMaxIterations(int maxIterations)
Set the maximum number of iterations allowed. |
void |
setMultiplierError(double smallw)
Set the error allowed in the multipliers. |
void |
setPenaltyBound(double tau0)
Set the universal bound for describing how much the unscaled penalty-term may deviate from zero. |
void |
setScalingBound(double scbnd)
Set the scaling bound for the internal automatic scaling of the objective function. |
void |
setTolerance(double epsx)
Set the desired precision of the solution. |
void |
setViolationBound(double delmin)
Set the scalar which defines allowable constraint violations of the final accepted result. |
void |
setXlowerBound(double[] xlb)
Set the lower bounds on the variables. |
void |
setXscale(double[] xscale)
Set the internal scaling of the variables. |
void |
setXupperBound(double[] xub)
Set the upper bounds on the variables. |
double[] |
solve(MinConNLP.Function F)
Solve a general nonlinear programming problem using the successive quadratic programming algorithm with a finite-difference gradient or with a user-supplied gradient. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MinConNLP(int mTotalConstraints, int mEqualityConstraints, int nVariables) throws IllegalArgumentException
mTotalConstraints
- An int
scalar value which defines the total
number of constraintsmEqualityConstraints
- An int
scalar value which defines the number
of equality constraintsnVariables
- An int
scalar value which defines the number
of variables.
IllegalArgumentException
Method Detail |
---|
public double[] getConstraintResiduals()
double
array containing the constraint residuals.public int getIterations()
public double[] getLagrangeMultiplierEst()
double
array containing the Lagrange multiplier estimates of the constraints.public Logger getLogger()
public long getMaximumTime()
public double[] getSolution()
solve
method.
double
array containing the solution.public int getTerminationCriterion()
int
that indicates the reason the solve method
terminated.public double getTolerance()
double
that is the the desired precision of the solution.public void setBindingThreshold(double del0)
Good values are between .01 and 1.0. If del0 is chosen too small then identification of the correct set of binding constraints may be delayed. Contrary, if del0 is too large, then the method will often escape to the full regularized SQP method, using individual slack variables for any active constraint, which is quite costly. For well scaled problems del0 = 1.0 is reasonable. If this member function is not called, del0 is set to .5 * tau0.
del0
- a double
scalar value specifying the binding threshold for constraints.
IllegalArgumentException
- is thrown if del0 is less than or equal to 0.0public void setBoundViolationBound(double taubnd)
taubnd
- a double
scalar value specifying the amount by which
bounds may be violated during numerical differentiation.
IllegalArgumentException
- is thrown if taubnd is less than or equal to 0.0public void setDifferentiationType(int idtype)
idtype
- an int
scalar value specifying the type of numerical differentiation
to be used. If this member function is not called, idtype is set to 1.
idtype | Action |
1 | Use a forward difference quotient with discretization stepsize componentwise relative. This is the default value used. |
2 | Use the symmetric difference quotient with discretization stepsize componentwise relative. |
3 | Use the sixth order approximation computing a Richardson extrapolation of three symmetric difference quotient values. This uses a discretization stepsize |
IllegalArgumentException
- is thrown if idtype is less than or equal to 0 or
greater than or equal to 4.public void setFunctionPrecision(double epsfcn)
epsfcn
- a double
scalar value specifying the relative precision of the function
evaluation routine.
IllegalArgumentException
- is thrown if epsfcn is less than or equal to 0.0public void setGradientPrecision(double epsdif)
epsdif
- a double
scalar value specifying the relative precision in gradients.
IllegalArgumentException
- is thrown if epsdif is less than or equal to 0.0public void setGuess(double[] xguess)
xguess
- a double
array specifying the initial guess of the
minimum point of the input functionpublic void setMaximumTime(long maximumTime)
maximumTime
- is the maximum time, in milliseconds, to be allowed
for the solve step. If less than or equal to zero
then no time limit is imposed.public void setMaxIterations(int maxIterations)
maxIterations
- an int
specifying the maximum number of
iterations allowed
IllegalArgumentException
- is thrown if maxIterations
is less than or equal to 0public void setMultiplierError(double smallw)
smallw
- a double
scalar value specifying the error allowed in the multipliers.
IllegalArgumentException
- is thrown if smallw is less than or equal to 0.0public void setPenaltyBound(double tau0)
tau0
- a double
scalar value specifying the universal bound for describing how
much the unscaled penalty-term may deviate from zero.
IllegalArgumentException
- is thrown if tau0 is less than or equal to 0.0public void setScalingBound(double scbnd)
scbnd
- a double
scalar value specifying the scaling variable for the problem function.
IllegalArgumentException
- is thrown if scbnd is less than or equal to 0.0public void setTolerance(double epsx)
epsx
- is the the desired precision of the solution. For a well
scaled and well-conditioned problem it essentially
specifies a desired relative precision in the solution. It
should never be chosen less than the square root of the
machine precision since the control of progress in the
method is based on the comparison of function values
usually taken from the constraining manifold where the
objective function varies like . Even this requirement may be too strong. The
default value of 1.0e-5 is approximately the third root of
the machine precision. The user should be aware of the
fact that the precision requirement is automatically
relaxed if the solver considers a problem "singular". If
the precision seems to be too poor in such a case a
decrease of epsx
might help. Default: 1.0e-5.public void setViolationBound(double delmin)
delmin
- a double
scalar value specifying the allowable constraint
violations of the final accepted result.
IllegalArgumentException
- is thrown if delmin is less than or equal to 0.0public void setXlowerBound(double[] xlb)
xlb
- a double
array specifying the lower bounds
on the variablespublic void setXscale(double[] xscale)
xscale
- a double
array specifying the internal scaling of the variables.
IllegalArgumentException
- is thrown if xscale is less than or equal to 0.0public void setXupperBound(double[] xub)
xub
- a double
array specifying the upper bounds
on the variablespublic double[] solve(MinConNLP.Function F) throws MinConNLP.ConstraintEvaluationException, MinConNLP.ObjectiveEvaluationException, MinConNLP.WorkingSetSingularException, MinConNLP.QPInfeasibleException, MinConNLP.PenaltyFunctionPointInfeasibleException, MinConNLP.LimitingAccuracyException, MinConNLP.TooManyIterationsException, MinConNLP.BadInitialGuessException, MinConNLP.IllConditionedException, MinConNLP.SingularException, MinConNLP.LinearlyDependentGradientsException, MinConNLP.NoAcceptableStepsizeException, MinConNLP.TerminationCriteriaNotSatisfiedException
F
- defines the user-supplied function to evaluate the function
at a given point. F can be used to supply a gradient of the function.
If F implements Gradient
the user-supplied
gradient is used. Otherwise,an attempt to solve the problem is made
using a finite-difference gradient.
double
array containing the solution of the
nonlinear programming problem.
MinConNLP.ConstraintEvaluationException
MinConNLP.ObjectiveEvaluationException
MinConNLP.WorkingSetSingularException
MinConNLP.QPInfeasibleException
MinConNLP.PenaltyFunctionPointInfeasibleException
MinConNLP.LimitingAccuracyException
MinConNLP.TooManyIterationsException
MinConNLP.BadInitialGuessException
MinConNLP.IllConditionedException
MinConNLP.SingularException
MinConNLP.LinearlyDependentGradientsException
MinConNLP.NoAcceptableStepsizeException
MinConNLP.TerminationCriteriaNotSatisfiedException
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |