Model generation error listing

Top  Previous  Next

The GAMS output next contains execution errors found during model generation.  These are numerical calculation or model structure errors.  The Fixing Execution Errors chapter shows how to find and fix these.

Numerical calculation errors involve improper exponentiation (such as raising a negative number to a real power), logs of negative numbers, or division by zero.  Model structure errors involve equations improperly set up i.e. ones that are inherently infeasible or the wrong solver is being used.

Discovery of execution errors is sometimes very straight forward, but can, at other times, be fairly involved.  Namely an error in the middle of a multi-dimensional equation block and/or in a multi-dimensional equation term within a block, can be difficult.  The most practical way of finding such errors is to use the LIMROW/LIMCOL option commands.

Consider the example executmd.gms.

 

sets elems /s1*s25/

parameter data1(elems)   data to be exponentiated

          datadiv(elems) divisors

          datamult(elems)     x limits;

data1(elems)=1;

data1("s20")=-1;

datadiv(elems)=1;

datadiv("s21")=0;

datamult(elems)=1;

datamult("s22")=0;

positive variables x(elems) variables

variables  obj;

equations  objr        objective with bad exponentiation

           xlim(elems) constraints with bad divisor

 nonlin      nonlinear constrint in LP;

objr.. obj=e=sum(elems,data1(elems)**2.1*x(elems));

xlim(elems).. datamult(elems)/datadiv(elems)*x(elems)=e=1;

nonlin..        sum(elems,sqr(x(elems)))e=1;

model executerr /all/

option limrow=30; option limcol=30;

solve executerr using lp maximizing obj;

 

When this is run through GAMS I find execution errors where the LOG file contains

 

--- Generating model EXECUTERR

--- EXECUTMD.GMS(16) 134 Kb

*** ExecError 10 at Line 16

    ILLEGAL ARGUMENTS IN ** OPERATION

--- EXECUTMD.GMS(17) 134 Kb 1 Errors

*** ExecError 0 at Line 17

    DIVISION BY ZERO

*** ExecError 28 at Line 17

    EQUATION INFEASIBLE DUE TO RHS VALUE

--- EXECUTMD.GMS(20) 134 Kb 3 Errors

*** SOLVE aborted

*** Status: Execution error(s)

 

and the LST file

 

**** EXECUTION ERROR 10 AT LINE 16 .. ILLEGAL ARGUMENTS IN ** OPERATION

 

---- OBJR        =E=  objective with bad exponentiation

 

OBJR..  - X(s1) - X(s2) - X(s3) - X(s4) - X(s5) - X(s6) - X(s7) - X(s8)

      - X(s9) - X(s10) - X(s11) - X(s12) - X(s13) - X(s14) - X(s15) - X(s16)

      - X(s17) - X(s18) - X(s19) + UNDF*X(s20) - X(s21) - X(s22) - X(s23)

      - X(s24) - X(s25) + OBJ =E= UNDF ; (LHS = UNDF, INFES = UNDF ***)

 

**** EXECUTION ERROR 0 AT LINE 17 .. DIVISION BY ZERO

 

**** EXECUTION ERROR 28 AT LINE 17 .. EQUATION INFEASIBLE DUE TO RHS VALUE

 

**** INFEASIBLE EQUATIONS ...

 

---- XLIM        =E=  constraints with bad divisor

 

XLIM(s22)..  0 =E= 1 ; (LHS = 0, INFES = 1 ***)

 

In this example there are execution errors:

in the objective function for the "S20" element where the code is exponentiating a negative constant to a real power (because of the assignment in line 9);
in the XLIM "S22" constraint where the code is setting zero equal to one which results in an infeasible constraint (because of the assignment in line 15).
in the XLIM constraint associated with element "S21" where the code is dividing by zero (because of the assignment in line 11); but this example does not at first display the divide by zero error.  To get it you have to fix the infeasibility and run again.  Then you get

 

   XLIM(s21)..  UNDF*X(s21) =E= UNDF ; (LHS = UNDF, INFES = UNDF ***)