Equation listing

Top  Previous  Next

When GAMS generates the model by default the first three equations for each named equation will be generated.  A portion of the output (just that for the first two named equations) for the each for the three example models is

 

Equation Listing    SOLVE farmPROBLEM Using LP From line 10

---- OBJ  =E=

OBJ..  Z - 109*Xcorn - 90*Xwheat - 115*Xcotton =E= 0 ; (LHS = 0)

---- land  =L=

land..  Xcorn + Xwheat + Xcotton =L= 100 ; (LHS = 0)

 

Equation Listing    SOLVE wall Using NLP From line 28

---- PDemand  =G=

PDemand..  P + 0.3*Qd =G= 6 ; (LHS = 0, INFES = 6 ***)

---- PSupply  =G=

PSupply..  - P + 0.2*Qs =G= -1 ; (LHS = 0)

 

Equation Listing    SOLVE PROBLEM Using MCP From line 7

---- r1  =E=

r1..  (1)*ba + (1)*so4 =E= 1 ; (LHS = 1)

---- r2  =E=

r2..  - (1)*ba + (1)*baoh - (1)*oh =E= 4.8 ; (LHS = 1, INFES = 3.8 ***)

Notes:

The first part of this output gives the words Equation Listing followed by the word Solve, the name of the model being solved and the line number in the echo print file where the solve associated with this model generation appears.
The second part of this output consists of the marker ---- followed by the name of the equation with the relationship type (=L=, =G=, =E= etc).
When one wishes to find this LST file component, one can search for the marker ---- or the string Equation Listing.  Users will quickly find ---- marks other types of output like that from display statements.
The third part of this output contains the equation name followed by a .. and then a listing of the equation algebraic structure.  In preparing this output, GAMS collects all terms involving variables on the left hand side and all constants on the right hand side.  This output component portrays the equation in linear format giving the names of the variables that are associated with nonzero equation terms and their associated coefficients.
The algebraic structure portrayal is trailed by a term which is labeled LHS and gives at evaluation of the terms involving endogenous variables evaluated at their starting points (typically zero unless the .L levels were preset).  A marker INFEAS will also appear if the initial values do not constitute a feasible solution.
The equation output is a correct representation of the algebraic structure of any linear terms in the equation and a local representation containing the first derivatives of any nonlinear terms.  The nonlinear terms are automatically encased in parentheses to indicate a local approximation is present.  For example in the non-linear equation solving example the first equation is algebraically structured as

         ba * so4 = 1

 

 but the equation listing portrays this as additive

         ---- r1  =E=

         r1..  (1)*ba + (1)*so4 =E= 1 ; (LHS = 1)

 

 which the reader can verify as the first derivative use of the terms evaluated around the starting point (ba=1,so4=1).

More details on how the equation list is formed and controlled in terms of content and length are discussed in the Standard Output chapter while more on nonlinear terms appears in the NLP and MCP Model Types chapter.