emp33.gms : JAMS: matches from model statement may be ignored

Description

If JAMS is directed to do a non-trivial transformation, this
transformation typically determines all the matching in the resultant
problem.  So any matching in the original model statement is ignored.

Contributor: Steven Dirkse, July 2021


Small Model of Type : GAMS


Category : GAMS Test library


Main file : emp33.gms

$title 'JAMS: matches from model statement may be ignored' (EMP33,SEQ=873)

$onText
If JAMS is directed to do a non-trivial transformation, this
transformation typically determines all the matching in the resultant
problem.  So any matching in the original model statement is ignored.

Contributor: Steven Dirkse, July 2021
$offText

scalar
  delta 'slope factor consumer benefit' / 1e-1 /
  gamma 'exponent in consumer benefit'  / 0.25 /
  ;

positive variable p 'unit price';
positive variable q 'consumption';
variable bene 'consumer benefit';
variable z    'consumer objective';

equation
  beneDef
  zDef 'define consumer objective'
  pDefLin 'linear price function';
  ;
beneDef.. q * [1-delta*(1+q)**gamma] =E= bene;
zDef.. bene - p*q =E= z;
pDefLin.. p =G= 0.5 + 0.1/72 * (q-33);

model
  m  'producer/consumer equilibrium' / beneDef, zDef, pDefLin.p /
  ;

solve m using nlp max z;;
abort$[m.modelStat > 2] 'NLP model not solved!', m.modelStat;
abort$[m.solveStat <> %solveStat.normalCompletion%] 'NLP model not solved!', m.solveStat;

scalars znlp, qnlp;
znlp = z.l;
qnlp = q.l;

file empinfo / '%emp.info%'/;

PUT empinfo "equilibrium" /;
PUT "max", z, q, bene, p /;
PUT zDef, beneDef, pDefLin /;
PUTCLOSE;
solve m using emp;
abort$[m.modelStat > 2] 'EMP model not solved!', m.modelStat;
abort$[m.solveStat <> %solveStat.normalCompletion%] 'EMP Model not solved!', m.solveStat;
abort$[abs(z.l - znlp) >= 1e-4] 'EMP objective different than NLP'; 
abort$[abs(q.l - qnlp) >= 1e-4] 'EMP consumption different than NLP';