16.01.2015 Views

GAMS — The Solver Manuals - Available Software

GAMS — The Solver Manuals - Available Software

GAMS — The Solver Manuals - Available Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

118 CONOPT<br />

CONOPT time Total<br />

0.109 seconds<br />

of which: Function evaluations 0.000 = 0.0%<br />

Derivative evaluations 0.000 = 0.0%<br />

Work length =<br />

Estimate =<br />

Max used =<br />

0.35 Mbytes<br />

0.35 Mbytes<br />

0.35 Mbytes<br />

<strong>The</strong> text after ”Insufficient memory to” may be different; it says something about where CONOPT ran out of<br />

memory. If the memory problem appears during model setup the message will be accompanied by Solvestat = 9<br />

(Error Setup Failure) and Modelstat = 13 (Error No Solution) and CONOPT will not return any values. If the<br />

memory problem appears later during the optimization Solvestat will be 10 (Error Internal <strong>Solver</strong> Failure) and<br />

Modelstat will be either 6 (Intermediate Infeasible) or 7 (Intermediate Nonoptimal) and CONOPT will return<br />

primal solution values. <strong>The</strong> marginals of both equations and variables will be zero or EPS.<br />

<strong>The</strong> first set of statistics in the message text shows you how much memory is available for CONOPT, and<br />

the last set shows how much is available for <strong>GAMS</strong> and CONOPT combined (<strong>GAMS</strong> needs space to store the<br />

nonlinear functions). It is recommended that you use the WORKFACTOR option if you must change the amount<br />

of memory. <strong>The</strong> same number will usually work for a whole family of models. If you prefer to use WORKSPACE,<br />

the <strong>GAMS</strong> WORKSPACE option corresponds to the combined memory, measured in Mbytes.<br />

4 Function Evaluation Errors<br />

Many of the nonlinear functions available with <strong>GAMS</strong> are not defined for all values of their arguments. LOG<br />

is not defined for negative arguments, EXP overflows for large arguments, and division by zero is illegal. To<br />

avoid evaluating functions outside their domain of definition you should add reasonable bounds on your variables.<br />

CONOPT will in return guarantee that the nonlinear functions never are evaluated with variables outside their<br />

bounds.<br />

In some cases bounds are not sufficient, e.g. in the expression LOG( SUM(I, X(I) ) ): in some models each<br />

individual X should be allowed to become zero, but the SUM should not. In this case you should introduce an<br />

intermediate variable and an extra equation, e.g. XSUMDEF .. XSUM =E= SUM(I,X(I)); add a lower bound<br />

on XSUM; and use XSUM as the argument to the LOG function. See section 6.3 on ”Simple Expressions” for<br />

additional comments on this topic.<br />

Whenever a nonlinear function is called outside its domain of definition, <strong>GAMS</strong>’ function evaluator will intercept<br />

the function evaluation error and prevent that the system crashes. <strong>GAMS</strong> will replace the undefined result by<br />

some appropriate real number, and it will make sure the error is reported to the modeler as part of the standard<br />

solution output in the <strong>GAMS</strong> listing file. <strong>GAMS</strong> will also report the error to CONOPT, so CONOPT can try to<br />

correct the problem by backtracking to a safe point. Finally, CONOPT will be instructed to stop after DOMLIM<br />

errors.<br />

During Phase 0, 1, and 3 CONOPT will often use large steps as the initial step in a line search and functions<br />

will very likely be called with some of the variables at their lower or upper bound. You are therefore likely to<br />

get a division-by-zero error if your model contains a division by X and X has a lower bound of zero. And you<br />

are likely to get an exponentiation overflow error if your model contains EXP(X) and X has no upper bound.<br />

However, CONOPT will usually not get trapped in a point outside the domain of definition for the model. When<br />

<strong>GAMS</strong>’ function evaluator reports that a point is ”bad”, CONOPT will decrease the step length, and it will for<br />

most models be able to recover and continue to an optimal solution. It is therefore safe to use a large value for<br />

DOMLIM instead of <strong>GAMS</strong> default value of 0.<br />

CONOPT may get stuck in some cases, for example because there is no previous point to backtrack to, because<br />

”bad” points are very close to ”reasonable” feasible points, or because the derivatives are not defined in a feasible<br />

point. <strong>The</strong> more common messages are:<br />

** Fatal Error ** Function error in initial point in Phase 0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!