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.

338 MINOS<br />

4 Modeling Issues<br />

Formulating nonlinear models requires that the modeler pays attention to some details that play no role when<br />

dealing with linear models.<br />

4.1 Starting Points<br />

<strong>The</strong> first issue is specifying a starting point. It is advised to specify a good starting point for as many nonlinear<br />

variables as possible. <strong>The</strong> <strong>GAMS</strong> default of zero is often a very poor choice, making this even more important.<br />

As an (artificial) example consider the problem where we want to find the smallest circle that contains a number<br />

of points (x i , y i ):<br />

Example<br />

minimize r<br />

r,a,b<br />

subject to (x i − a) 2 + (y i − b) 2 ≤ r 2 , r ≥ 0.<br />

This problem can be modeled in <strong>GAMS</strong> as follows.<br />

set i ’points’ /p1*p10/;<br />

parameters<br />

x(i)<br />

y(i)<br />

’x coordinates’,<br />

’y coordinates’;<br />

* fill with random data<br />

x(i) = uniform(1,10);<br />

y(i) = uniform(1,10);<br />

variables<br />

a<br />

b<br />

r<br />

equations<br />

e(i)<br />

’x coordinate of center of circle’<br />

’y coordinate of center of circle’<br />

’radius’;<br />

’points must be inside circle’;<br />

e(i).. sqr(x(i)-a) + sqr(y(i)-b) =l= sqr(r);<br />

r.lo = 0;<br />

model m /all/;<br />

option nlp=minos;<br />

solve m using nlp minimizing r;<br />

Without help, MINOS will not be able to find an optimal solution. <strong>The</strong> problem will be declared infeasible. In<br />

this case, providing a good starting point is very easy. If we define<br />

x min = min<br />

i<br />

x i ,<br />

y min = min<br />

i<br />

y i ,<br />

x max = max<br />

i<br />

y max = max<br />

i<br />

x i ,<br />

y i ,

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

Saved successfully!

Ooh no, something went wrong!