L

Top  Previous  Next

Variables and equations have what is known as a level value that is the current solution value for that variable or equation.  The level value for a variable is the current solution value after a solution and the starting point for that variable before solution plus it helps provide a basis for the model.  The level value for an equation is sum of the endogenous terms in the equation evaluated at the current level value for the variables after a solution and in general is not defined before solution.  The attribute is addressed using .L as follows

 

Variable level is variablename.L(setdependency)

Equation level is equationname.L(setdependency)

 

These are commonly used in calculations to do one of three things

Variable levels are set at non zero levels pre solution to provide a starting point that can be very important in NLP problems.
Variable levels are set at nonzero values pre solution to provide an advanced basis.
Variable and equation levels are used post optimality in report writing (Note in this circumstance $Ondotl may be used to automatically add the .l items to variable names appearing on the right hand side of calculations).

Example:

(varmodatt.gms)

X.l(j)=1;

Move.l(source,sink)=historicmove(source,sink);

solve transport using lp minimizing cost;

Totalcost=sum((source,sink ),

     costtomove(source,sink )*Move.l(source,sink ));

Note:

The level values receives new values after a solve statement is executed.
One can use $ondotl to add .l to variable names automatically.