Equations

Top  Previous  Next

GAMS requires that the modeler name each equation, which is active in the optimization model.  Later each equation is specified using the .. notation as explained just below.  These equations must be named in an EQUATION or EQUATIONS instruction.  This is used in each of the example models as reproduced below

 

EQUATIONS     OBJ,  land ,  labor;(optimize.gms)

 

EQUATIONS     PDemand,PSupply, Equilibrium;(econequil.gms)

 

Equations r1, r2, r3, r4, b1, b2 ;(nonlinsys.gms)

Notes:

The general form of these statements are

         Equations comma or line feed specified list of equations ;

 where

         equation or equations is required

         a list of equations follows

         a ; ends the statement

 

In optimization models the objective function is always defined in one of the named equations.
This statement may be more complex including set element definitions (as we will elaborate on below) and descriptive text as illustrated in the file (model.gms)

EQUATIONS

         TCOSTEQTOTAL COST ACCOUNTING EQUATION
         SUPPLYEQ(SUPPLYL)LIMIT ON SUPPLY AVAILABLE AT A SUPPLY POINT
         DEMANDEQ(MARKET)MINIMUM REQUIREMENT AT A DEMAND MARKET
         BALANCE(WAREHOUSE)WAREHOUSE SUPPLY DEMAND BALANCE
         CAPACITY(WAREHOUSE)WAREHOUSE CAPACITY
         CONFIGUREONLY ONE WAREHOUSE;

 

 as discussed in the Variables, Equations, Models and Solves chapter.

The equation names can be up to 63 characters long as discussed and illustrated in the Rules for Item Names, Element Names and Explanatory Text chapter.