27.10.2013 Views

Quick start - Gams

Quick start - Gams

Quick start - Gams

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.

GAMS is fundamentally built to allow exploitation of algebraic features like summation<br />

notation. Specifically suppose xi is defined with three elements<br />

Algebra<br />

∑<br />

i<br />

x<br />

This can be expressed in GAMS as<br />

where<br />

z = SUM(I, X(I));<br />

i<br />

=<br />

x<br />

1<br />

+<br />

x<br />

I is a set in GAMS<br />

z is a scalar or variable<br />

X(I) is a parameter or variable defined over set I<br />

and the sum automatically treats all cases of I.<br />

Such an expression can be included either in a either a model equation .. specification or in an<br />

item to be calculated in the code. Let me now remake the first 2 examples better exploiting the<br />

GAMS algebraic features<br />

2<br />

+<br />

Revised algebra exploiting optimization example<br />

Courtesy of B.A. McCarl, October 2002 24<br />

x<br />

3

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

Saved successfully!

Ooh no, something went wrong!