.. specifications

Top  Previous  Next

The GAMS equation specifications actually consist of two parts.  The first part naming equations, was discussed just above.  The second part involves specifying the exact algebraic structure of equations.  This is done using the ..  notation.  In this notation we give the equation name followed by a .. then the exact equation type as it should appear in the model.  The equation type specification involves use of a special syntax to tell the exact form of the relation involved.  The most common of these are (see the Variables, Equations, Models and Solves chapter for a complete list):

 

=E= is used to indicate an equality relation

=L= indicates a less than or equal to relation

=G= indicates a greater than or equal to relation

 

This is used in each of the example models where a few of the component equations are reproduced below

 

OBJ..  Z =E= 109*Xcorn + 90*Xwheat + 115*Xcotton;(optimize.gms)

land..           Xcorn +    Xwheat +     Xcotton =L= 100;

 

Pdemand..     P            =g= 6 - 0.3*Qd;(econequil.gms)

 

r1..  ba * so4 =e= 1 ;(nonlinsys.gms)

Notes:

The general form of these statements is

Equationname ..   algebra1 equationtype algebra2 ;

 where

an equation with that name must have been declared (have appeared in and equation statement)

the .. appears just after the equation name

the algebraic expressions algebra1 and algebra2 can each be a mixture of variables, data items and constants

the equationtype is the =E=,  =L=, and =G= discussed above.

a ; ends the statement

 

All equations must be specified in .. notation before they can be used.
Some model equations may be specified in an alternative way by including upper or lower bounds as discussed in the Variables, Equations, Models and Solves chapter.
.. specification statements may be more complex including more involved algebra as discussed later in this tutorial and in the Calculating Items chapter.
It may be desirable to express equations as only being present under some conditions as discussed later in this tutorial and in the Conditionals chapter.