Download gams a user's guide
Transcript
98 GAMS OUTPUT 1 set c crops / wheat, corn, wheat, longaname / **** $172 2 parameter price(c) / wheat 200, cotton 700 / **** $170 3 Error Messages 170 172 Domain violation for element Element is redefined **** 2 ERROR(S) 0 WARNING(S) .. **** USER ERROR(S) ENCOUNTERED 10.6.2 COMPILATION TIME ERRORS The reporting format for errors found while analyzing solve statements is more complicated than for normal compilation errors, mainly because many things must be checked. All identifiers referenced must be defined or assigned, the mathematics in the equations must match the model class, and so on. More elaborate reporting is required to accurately describe any problems found. The solve statement is only checked if the model has been found to be error free up to this point. This is not only because the check is comparatively expensive, but also because many erroneous and confusing messages can be produced while checking a solve in a program containing other errors. Solve error messages are reported in two places and in two formats. First, they are shown immediately below the solve statement with a short text including the name of any offending identifier and the type of model involved. This will be sufficient in most cases. Second, a longer message with some hints appears with the rest of the error messages at the end of the compilation. The example below illustrates how the general reporting format for compiler errors associated with a solve statement. 1 variables x,y, z ; 2 equations eq1 , eq2; 3 4 eq1.. x**2 - y =e= z ; 5 eq2.. min(x,y) =l= 20 ; 6 7 model silly / all / ; 8 solve silly using lp maximizing z ; **** $54,51,256 **** THE FOLLOWING LP ERRORS WERE DETECTED IN MODEL SILLY: **** 54 IN EQUATION EQ1 .. ENDOG OPERANDS FOR ** **** 51 IN EQUATION EQ2 .. ENDOG ARGUMENT(S) IN FUNCTION 9 Error Messages 51 54 256 Endogenous function argument(s) not allowed in linear models Endogenous operands for ** not allowed in linear models Error(s) in analyzing solve statement. More detail appears Below the solve statement above **** 3 ERROR(S) 0 WARNING(S) **** USER ERROR(S) ENCOUNTERED