simpenlp.gms : Simple example of ENLP

Description

This model shows how to solve a simple ENLP using EMP

Contributor: Michael C. Ferris, February 2011


Small Model of Type : ENLP


Category : GAMS EMP library


Main file : simpenlp.gms

$title Simple example of ENLP  (SIMPENLP,SEQ=60)

$ontext
This model shows how to solve a simple ENLP using EMP

Contributor: Michael C. Ferris, February 2011
$offtext


variables obj,x1,x2;
equations f0,f1,f2;

f0.. obj =e= -x2;

f1.. x1 + x2 + 0.5 =n= 0;
f2.. x1 - 3*x2 =e= 2;

x1.lo = 0;

file myinfo /'%emp.info%'/;
putclose myinfo 'modeltype nlp' / 'Adjustequ' / 'f1 maxz 2';

model enlpemp /all/;
solve enlpemp using emp min obj;

positive variables w;
equation defobj, deflow;

defobj.. obj =e= -x2 + 2*w;
deflow.. w =g= x1 + x2 + 0.5;

model equivlp /defobj,f1,f2,deflow/;

solve equivlp using lp min obj;

abort$(enlpemp.objval <> equivlp.objval) 'Objval differs', enlpemp.objval, equivlp.objval;