GAMS [ Home | Support | Sales | Solvers | Documentation | Model Library | Search | Contact Us ]

badpt4.gms : Test acceptance of models with generation errors


In this model we attempt to solve a number of models that have
generation errors of various types.  We set the error limit
and the sys12 switch to allow this non-default behavior.
The results are analyzed and any unacceptable results cause an error.

Contributor: Steve Dirkse, Nov 2004

Small Model of Type: GAMS    Includes:  badpt.inc
$title 'Test acceptance of models with generation errors' (BADPT4,SEQ=203) $ontext In this model we attempt to solve a number of models that have generation errors of various types. We set the error limit and the sys12 switch to allow this non-default behavior. The results are analyzed and any unacceptable results cause an error. Contributor: Steve Dirkse, Nov 2004 $offtext $if not set TESTTOL $set TESTTOL 1e-6 scalar tol / %TESTTOL% /; * get the model definitions $include badpt.inc maxexecerror = 10; option sys12 = 1; solve logzero using nlp min z; if {logzero.solvestat, abort$(logzero.solvestat <> 1 or logzero.modelstat > 2) 'wrong status codes'; abort$(logzero.numnopt <> 0) ' NONOPT flags set'; abort$(logzero.numinfes <> 0) 'INFEASIBLE flags set'; * abort$(logzero.numunbnd <> 0) ' UNBOUNDED flags set'; abort$(abs(x.l-1) > tol) 'bad solution: x.l ', x.l; abort$(abs(x.m) > tol) 'bad solution: x.m ', x.m; abort$(abs(z.l) > tol) 'bad solution: z.l ', z.l; abort$(abs(z.m) > tol) 'bad solution: z.m ', z.m; abort$(abs(f.l) > tol) 'bad solution: f.l ', f.l; abort$(abs(f.m-1) > tol) 'bad solution: f.m ', f.m; abort$(abs(g.l-1) > tol) 'bad solution: g.l ', g.l; abort$(abs(g.m-.5) > tol) 'bad solution: g.m ', g.m; else abort$(logzero.solvestat <> 9 or logzero.modelstat <> 14) 'wrong status codes'; }; $exit solve divzero using nlp min z; if {haveBaron, abort$(divzero.solvestat <> 1 or divzero.modelstat <> 1) 'wrong status codes'; abort$(divzero.numnopt <> 0) ' NONOPT flags set'; abort$(divzero.numinfes <> 0) 'INFEASIBLE flags set'; * abort$(divzero.numunbnd <> 0) ' UNBOUNDED flags set'; abort$(abs(x.l-1) > tol) 'bad solution: x.l ', x.l; abort$(abs(x.m) > tol) 'bad solution: x.m ', x.m; abort$(abs(z.l+1) > tol) 'bad solution: z.l ', z.l; abort$(abs(z.m) > tol) 'bad solution: z.m ', z.m; abort$(abs(s.l) > tol) 'bad solution: s.l ', s.l; abort$(abs(s.m-1) > tol) 'bad solution: s.m ', s.m; abort$(abs(t.l-1) > tol) 'bad solution: t.l ', t.l; abort$(abs(t.m-.5) > tol) 'bad solution: t.m ', t.m; else abort$(divzero.solvestat <> 9 or divzero.modelstat <> 14) 'wrong status codes'; };