qcp05.gms : Test case for poly function
Compare modlib's qdemo7 with a version making use of the poly function
Contributor: Jan-Hendrik Jagla, June 2008
Small Model of Type: QCP
$TITLE 'Test case for poly function' (QCP05,SEQ=390)
$ontext
Compare modlib's qdemo7 with a version making use of the poly function
Contributor: Jan-Hendrik Jagla, June 2008
$offtext
$set NUL nul
$if %system.filesys% == UNIX $set NUL /dev/null
$if not set TESTTOL $set TESTTOL 1e-4
$call gamslib -q qdemo7
$include qdemo7.gms
Equation objnpoly objective function;
objnpoly.m = objn.m;
execute_unload 'demo7n.gdx';
objnpoly.. cps =e= sum(cn, poly(natcon(cn),0,alpha(cn),.5*beta(cn)))
+ sum(ce, exports(ce)*pe(ce))
- sum(cm, imports(cm)*pm(cm))
- tcost;
Model demo7npoly QCP version/ landbal, laborbal, plow, ares,
alab, acost, dem, proc,
amisc, aplow, lclover, lstraw, objnpoly /;
scalar rc;
Solve demo7npoly maximizing cps using QCP;
execute_unload 'demo7npoly.gdx';
execute 'gdxdiff demo7n.gdx demo7npoly.gdx Eps=%TESTTOL% RelEps=%TESTTOL% > %NUL%';
rc=errorlevel;
abort$(rc <> 0) 'GDXDIFF no difference expected';