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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

122 CONOPT<br />

by the reduced complexity. If the model is solved with CONOPT3 using explicit second derivatives then simple<br />

expressions will result in sparser second derivatives that are both faster to compute and to use.<br />

<strong>The</strong> reduction in complexity can be significant if an intermediate expression is linear.<br />

fragment:<br />

VARIABLE X(I), Y;<br />

EQUATION YDEF;<br />

YDEF .. Y =E= 1 / SUM(I, X(I) );<br />

should be written as<br />

VARIABLE X(I), XSUM, Y;<br />

EQUATION XSUMDEF, YDEF;<br />

XSUMDEF .. XSUM =E= SUM(I, X(I) );<br />

YDEF .. Y =E= 1 / XSUM;<br />

XSUM.LO = 1.E-2;<br />

<strong>The</strong> following model<br />

for three reasons. First, because the number of nonlinear derivatives is reduced in number and complexity.<br />

Second, because the lower bound on the intermediate result will bound the search away from the singularity at<br />

XSUM = 0. And third, because the matrix of second derivatives for the last model only depend on XSUM while<br />

it depends on all X in the first model.<br />

<strong>The</strong> last example shows an added potential saving by expanding functions of linear expressions. A constraint<br />

depends in a nonlinear fashion on the accumulated investments, INV, like<br />

CON(I) .. f( SUM( J$(ORD(J) LE ORD(I)), INV(J) ) ) =L= B(I);<br />

A new intermediate variable, CAP(I), that is equal to the content of the SUM can be defined recursively with<br />

the constraints<br />

CDEF(I) .. CAP(I) =E= INV(I) + CAP(I-1);<br />

and the original constraints become<br />

CON(I) .. f( CAP(I) ) =L= B(I);<br />

<strong>The</strong> reformulated model has N additional variables and N additional linear constraints. In return, the original<br />

N complex nonlinear constraints have been changed into N simpler nonlinear constraints. And the number of<br />

Jacobian elements, that has a direct influence on much of the computational work both in <strong>GAMS</strong> and in CONOPT,<br />

has been reduced from N*(N+1)/2 nonlinear elements to 3*N-1 linear elements and only N nonlinear element. If<br />

f is an invertable increasing function you may even rewrite the last constraint as a simple bound:<br />

CAP.LO(I) = finv(B(I));<br />

Some NLP solvers encourage you to move as many nonlinearities as possible into the objective which may make<br />

the objective very complex. This is neither recommended nor necessary with CONOPT. A special pre-processing<br />

step (discussed in section A4 in Appendix A) will aggregate parts of the model if it is useful for CONOPT without<br />

increasing the complexity in <strong>GAMS</strong>.<br />

6.4 Equalities vs. Inequalities<br />

A resource constraint or a production function is often modeled as an inequality constraint in an optimization<br />

model; the optimization algorithm will search over the space of feasible solutions, and if the constraint turns

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

Saved successfully!

Ooh no, something went wrong!