xerr1.gms : External Equation Errors: RHS wrong

Description

This model checks if Cmex creates an error as expected when dealing with
external equations. The errors we want to get are:
- RHS value not integer in =X= equation
- RHS value out of range in =X= equation
- RHS value not unique in =X= equation

Contributor: Lutz Westermann


Small Model of Type : GAMS


Category : GAMS Test library


Main file : xerr1.gms

$title External Equation Errors: RHS wrong (xerr1,SEQ=493)
$onText

This model checks if Cmex creates an error as expected when dealing with
external equations. The errors we want to get are:
- RHS value not integer in =X= equation
- RHS value out of range in =X= equation
- RHS value not unique in =X= equation

Contributor: Lutz Westermann

$offText

$onEcho > err.gms
set i / i1*i4 /
variables x(i), z;
equations zdef;

zdef.. sum(i, ord(i)*x(i) ) + (card(i)+1)* z =X= 1.5;
model xerr     'External equations'  / all /;
solve xerr using nlp minimizing z;
$offEcho

$call =gams err.gms lo=%GAMS.lo%
$if not errorlevel 1 $abort should get error because of RHS not integer

$onEcho > err.gms
set i / i1*i4 /
variables x(i), z;
equations zdef;

zdef.. sum(i, ord(i)*x(i) ) + (card(i)+1)* z =X= 2;
model xerr     'External equations'  / all /;
solve xerr using nlp minimizing z;
$offEcho

$call =gams err.gms lo=%GAMS.lo%
$if not errorlevel 1 $abort should get error because of RHS out of range

$onEcho > err.gms
set i / i1*i4 /
variables x(i), z;
equations zdef,zdef2;

zdef..  sum(i, ord(i)*x(i) ) + (card(i)+1)* z =X= 1;
zdef2.. sum(i, ord(i)*x(i) )                  =X= 1;
model xerr     'External equations'  / all /;
solve xerr using nlp minimizing z;
$offEcho

$call =gams err.gms lo=%GAMS.lo%
$if not errorlevel 1 $abort should get error because of RHS not unique