exit code 3

255 views
Skip to first unread message

fatemeh boloori

unread,
Mar 9, 2016, 3:26:59 AM3/9/16
to gamsworld
Hello dear all
I defined a problem in GAMS (the attached file) which I know it is not feasible. But I expect that GAMS executes the solve statement and reports the modelstat after executing the solve statement. If I change my data set, the program works properly, but within this data set, the solve statement is not executed at all and exits with exit code 3 and therefore the remaining lines of the program are not executed. How can I prevent the GAMS program to exit? Thank you very much in advance. This is the code:

sets t /T1*T4/ i /i1*i2/ r /r1*r3/ ; table p(t,i) i1 i2 T1 1 0 T2 -1 0 T3 0 0 T4 0 0; table q(t,r) r1 r2 r3 T1 1.2 1 0 T2 -1 -1 -0.3 T3 -0.3 0.1 0 T4 0.5 -0.1 0; variable obj2; 
positive variable alpha(r) , pi(t); equation eq4(i) eq5(r) eq6 ; eq4(i).. sum(t , pi(t)*p(t,i))=e=-1; eq5(r).. sum(t , pi(t)*q(t,r))=e=-1+alpha(r); eq6.. obj2=e=sum(r,alpha(r)); model model2 /eq4,eq5,eq6 /; solve model2 using LP maximizing obj2; file str /"D:\cinsistency.xls"/ ; PUT str; put model2.modelstat;
test.gms

Michael Bussieck

unread,
Mar 9, 2016, 3:52:31 AM3/9/16
to gamsworld
Hi,

Usually GAMS let's the solver determine the status (optimal/infeasible/unbounded) of an optimization model instance, but in case you have an obvious infeasibility like "0 =e= -1"  GAMS will not even pass this to a solver and you get the error as you get it:

**** Exec Error at line 25: Equation infeasible due to rhs value
**** INFEASIBLE EQUATIONS ...
---- eq4  =E= 
eq4(i2)..  0 =E= -1 ; (LHS = 0, INFES = 1 ****)

I think the message in the log and the corresponding details in the LST are conclusive.

Hope this helps,
Michael Bussieck - GAMSWorld Coordinator

Ali Reza Bahari

unread,
Mar 9, 2016, 3:06:12 PM3/9/16
to gams...@googlegroups.com
Hi Mrs Boloori
Summation of P(t,i) over set t for i =2 is zero. so it can't satisfy Equ4 for i=2 with -1 in its RHS. Actually infeasibility of your model arises from data. 

Ali-Reza Bahari

--
You received this message because you are subscribed to the Google Groups "gamsworld" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+...@googlegroups.com.
To post to this group, send email to gams...@googlegroups.com.
Visit this group at https://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages