mcp14.gms : Test equList matching in model statement

Description

Test equList matching in model statement.
In particular, test on invalid inputs that lead to compilation errors.

Contributor: Steven Dirkse, September 2024


Small Model of Type : MCP


Category : GAMS Test library


Main file : mcp14.gms

$title Test equList matching in model statement (MCP14, SEQ=967)

$onText
Test equList matching in model statement.
In particular, test on invalid inputs that lead to compilation errors.

Contributor: Steven Dirkse, September 2024
$offText


$onEcho > m4.gms
$ontext
------------------------------------------------------------------------
rows: f1_a_solo, f2_b_solo
cols:  v_a,       v_b
result: bad match always: f1/f2 is not conformant with v
------------------------------------------------------------------------
$offtext

Scalar c / 0 /;

Sets
  u / a, b, c /
  i1(u)
  i2(u)
  j / uno /
  ;

Variable v(u);
Equations
  f1(u,j) '2d equation'
  f2(u,j) '2d equation'
  ;

f1(i1(u),j).. v(u-1) + v(u) + c * v(u+1) =E= min(2,ord(u));
f2(i2(u),j).. v(u-1) + v(u) + c * v(u+1) =E= min(2,ord(u));

i1(u) = sameas(u,'a');
i2(u) = sameas(u,'b');

Model m4 / ( f1 | f2 ) : v /;

solve m4 using mcp;
$offEcho

$call gams m4.gms lo=%GAMS.lo%
$ife errorlevel=0 $abort Expected error for m4

$onEcho > m5.gms
$ontext
------------------------------------------------------------------------
rows: e1_a, f2_b_solo
cols:  v_a,  v_b
result: bad match always: e1 not conformant with f2
------------------------------------------------------------------------
$offtext

Scalar c / 0 /;

Sets
  u / a, b, c /
  i1(u)
  i2(u)
  j / uno /
  ;

Variable v(u);
Equations
  e1(u)   'matched equations'
  f2(u,j) '2d equation'
  ;

e1(i1(u)).. v(u-1) + v(u) + c * v(u+1) =E= min(2,ord(u));
f2(i2(u),j).. v(u-1) + v(u) + c * v(u+1) =E= min(2,ord(u));

i1(u) = sameas(u,'a');
i2(u) = sameas(u,'b');

Model m5 / ( e1 | f2 ) : v /;

solve m5 using mcp;
$offEcho

$call gams m5.gms lo=%GAMS.lo%
$ife errorlevel=0 $abort Expected error for m5