wrong solution

Problems with syntax of GAMS
Post Reply
anaskhan
User
User
Posts: 2
Joined: 3 months ago

wrong solution

Post by anaskhan » 1 month ago

Hi everyone
I was trying to solve a optimal route problem but my code is not giving right solution it just shows binary variable of last stage while binary variables of previous stage are zero so unable to identify the route. I m copying my code here plz let me know the mistake

binary variables y11,y12,y21,y22,y23,y24,y25;

positive variables m,m1,m2,s11,s12,s,e1,e2,e3,e4,e5,ep1,ep2,ep3,ep4,ep5,et;

free variable z;

equations obj,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19 ;

obj..z=e=0.08*et-(5687500-34.8*s11)*y11-(0-0*s12)*y12-(95000000-45.9*e1)*y21-(80532000-71.16*e2)*y22-(86936900-8.82*e3)*y23-(19143600-29.68*e4)*y24-(5937432-31.25*e5)*y25;

c1..m=e=1700000;
c2..m=e=m1+m2;

c3..s11=l=130000;
c4..e1=l=406975;
c5..e2=l=341275;
c6..e3=l=182500;
c7..e4=l=420000;
c8..e5=l=230680;
c9..et=e=ep1+ep2+ep3+ep4+ep5;

c10..y11+y12=l=0;
c11..y21+y22+y23+y24+y25=l=1;

c12..s11=e=0.9*m1;
c13..ep1=e=389*e1;
c14..ep2=e=1530*e2;
c15..ep3=e=490*e3;
c16..ep4=e=340*e4;
c17..ep5=e=162*e5;
c18..s12=e=m2;
c19..s=e=s11+s12;

model msw /all/;

solve msw maximize z using minlp;

display z.l,m.l,m1.l,m2.l,s11.l,s12.l,e1.l,e2.l,e3.l,e4.l,e5.l,et.l,y11.l,y12.l,y21.l,y22.l,y23.l,y24.l,y25.l;

Post Reply