emp15.gms : Test of EMP equilibrium model with vi func

Description

This model has two agents.
Each agent solves   min_{t_i} obj_i
                    s.t.      t_i >= 0

In addition to this, z_i is perp to
  F_i(z,t) = 0

This was giving JAMS trouble since dL_dt is empty (i.e. zero).

Contributors: Steve Dirkse & Michael Ferris, February 2013


Small Model of Type : GAMS


Category : GAMS Test library


Main file : emp15.gms

$title Test of EMP equilibrium model with vi func (EMP15,SEQ=601)

$onText
This model has two agents.
Each agent solves   min_{t_i} obj_i
                    s.t.      t_i >= 0

In addition to this, z_i is perp to
  F_i(z,t) = 0

This was giving JAMS trouble since dL_dt is empty (i.e. zero).

Contributors: Steve Dirkse & Michael Ferris, February 2013
$offText

set i agents /i1*i2/,
    j variables /j1*j2/;

scalars
  d
  c / 0 /;

$macro F ( z(j) - sqr(t('i1')-1)               )$sameas(j,'j1') + \
         ( -exp(z('j1')-t('i2')) + z(j) + 1    )$sameas(j,'j2')

variables obj(i), z(j);
positive variables t(i);

equations defF(j), defobj(i);

defobj(i).. obj(i) =e= sum(j$(i.ord eq j.ord), z(j)) + c * t(i);

defF(j)..  F =e= 0;

model empmod /all/;

file empinfo / 'empinfo.txt' /;
put empinfo 'equilibrium' /;
loop{i,
  put 'min ' obj(i) t(i) defobj(i) /;
};
put 'vi defF z' /;
putclose;

file jamsopt / 'jams.op5' /;
putclose jamsopt 'EMPInfoFile empinfo.txt'
               / 'fileName mcpTmpScalar.gms'
               / 'dict dict.txt'
               /;
empmod.optfile = 5;

z.l(j) = 2;
t.l(i) = 5;
solve empmod using emp;

c = 1;
solve empmod using emp;
abort$[sum{i, abs(t.l(i))} > 1e-7] 'bad t, should be 0', t.l;
abort$[abs(z.l('j1')-1) > 1e-7] 'bad z(j1), should be 1', z.l;
d = exp(1) - 1;
abort$[abs(z.l('j2')-d) > 1e-7] 'bad z(j1), should be exp(1)-1', z.l, d;
abort$[abs(obj.l('i1')-1) > 1e-7] 'bad obj(i1), should be 1', obj.l;
abort$[abs(obj.l('i2')-d) > 1e-7] 'bad obj(i2), should be exp(1)-1', obj.l, d;

abort$[sum{j, abs(defF.l(j)-defF.lo(j))} > 1e-7] 'bad defF, should be no slack', defF.l, defF.lo;

execute 'rm mcpTmpScalar*.* dict.txt empinfo.txt jams.op5';