Hi,
Any one can just copy and pastes this code in GAMS and send me the answer file. It’s really help full to me. I am very much sure that there is no error
in this code but I have demo version of GAMS, so I can’t solve this.
SETS I / 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18/;
SETS M / 1,2,3,4/;
PARAMETER CD(I) / 1 0.0, 2 0.0, 3 0.1, 4 0.1, 5 0.1 , 6 0.1, 7 0.2, 8 0.2, 9 0.2, 10 0.2, 11 0.2, 12 0.2, 13 0.2, 14 0.2, 15 0.2, 16 0.2, 17 0.2, 18 0.2/;
PARAMETER CH(I) / 1 3, 2 3, 3 3,4 3 ,5 3, 6 3,7 3.5, 8 3.5, 9 3.5, 10 3.5, 11 3.5, 12 3.5, 13 3.5, 14 3.5, 15 3.5, 16 3.5, 17 3.5, 18 3.5/;
PARAMETER XL(M) / 1 0.3, 2 0.3, 3 0.35, 4 0.35/;
PARAMETER XM(M) / 1 0.85, 2 0.85, 3 0.85,4 0.85/;
VARIABLES C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,X1,X2,
X3,X4,LAMBDA, obj;
EQUATION EQ1,EQ2,EQ3,EQ4,EQ5,EQ6,EQ7,EQ8,EQ9,EQ10,EQ11,EQ12,EQ13,EQ14,EQ15
EQ16,EQ17,EQ18,EQ19(I),EQ20(I),EQ21(I),EQ22(I),EQ23(I),EQ24(I),EQ25(I),EQ26(I),EQ27(I),EQ28(I),EQ29(I),EQ30(I),EQ31(I),EQ32(I)
,EQ33(I),EQ34(I),EQ35(I),EQ36(I),EQ37(M),EQ38(M),EQ39(M),EQ40(M),EQ40,EQ41(I),EQ42(I),EQ43(I),EQ44(I),EQ45(I),EQ46(I),EQ47(I)
,EQ47(I),EQ48(I),EQ49(I),EQ50(I),EQ51(I),EQ52(I),EQ53(I),EQ54(I),EQ55(I),EQ56(I),EQ57(I),EQ58(I),EQ59(I),EQ60(I),EQ61(I)
,EQ62(I),EQ63(I),EQ64(I),EQ65(I),EQ66(I),EQ67(I),EQ68(I),EQ69(I),EQ70(I),EQ71(I),EQ72(I),EQ73(I),EQ74(I),EQ75(I),EQ76(I),EQ77(M)
,EQ78(M),EQ79(M),EQ80(M),EQ81(M),EQ82(M),EQ83(M),EQ84(M),EQ85,EQ86,objective;
EQ1…C1 =E= 0.1142 - (0.0893X1);
EQ2…C2 =E= 0.1935 - (0.1702X1);
EQ3…C3 =E= 0.2595 - (0.1687X1);
EQ4…C4 =E= 0.6198 - (0.2409X1) - (0.2942X2);
EQ5…C5 =E= 0.9472 - (0.3062X1) - (0.5618X2);
EQ6…C6 =E= 1.2433 - (0.3651X1) - (0.8042X2);
EQ7…C7 =E= 1.3230 - (0.3628X1) - (0.7992X2);
EQ8…C8 =E= 1.8327 - (0.4149X1) - (1.0150X2) - (0.2524X3);
EQ9…C9 =E= 2.2948 - (0.4620X1) - (1.2095X2) - (0.4828X3);
EQ10…C10 =E= 2.7140 - (0.5041X1) - (1.3862X2) - (0.6923X3);
EQ11…C11 =E= 3.0919 - (0.5418X1) - (1.5453X2) - (0.8821X3);
EQ12…C12 =E= 3.1175 - (0.5361X1) - (1.5289X2) - (0.8734X3);
EQ13…C13 =E= 3.6006 - (0.5691X1) - (1.6690X2) - (1.0412X3) - (0.1538X4);
EQ14…C14 =E= 4.0345 - (0.5980X1) - (1.7928X2) - (1.1937X3) - (0.2935X4);
EQ15…C15 =E= 4.4259 - (0.6238X1) - (1.9039X2) - (1.3309X3) - (0.4211X4);
EQ16…C16 =E= 4.7756 - (0.6462X1) - (2.0023X2) - (1.4538X3) - (0.5366X4);
EQ17…C17 =E= 5.0877 - (0.6656X1) - (2.0894X2) - (1.5635X3) - (0.6413X4);
EQ18…C18 =E= 5.3635 - (0.6823X1) - (2.1652X2) - (1.6611X3) - (0.7354X4);
EQ19(I)…LAMBDA =L= ((CH(I) - C1)/(CH(I) - CD(I))) ;
EQ20(I)…LAMBDA =L= ((CH(I) - C2)/(CH(I) - CD(I)));
EQ21(I)…LAMBDA =L= ((CH(I) - C3)/(CH(I) - CD(I)));
EQ22(I)…LAMBDA =L= ((CH(I) - C4)/(CH(I) - CD(I)));
EQ23(I)…LAMBDA =L= ((CH(I) - C5)/(CH(I) - CD(I)));
EQ24(I)…LAMBDA =L= ((CH(I) - C6)/(CH(I) - CD(I)));
EQ25(I)…LAMBDA =L= ((CH(I) - C7)/(CH(I) - CD(I)));
EQ26(I)…LAMBDA =L= ((CH(I) - C8)/(CH(I) - CD(I)));
EQ27(I)…LAMBDA =L= ((CH(I) - C9)/(CH(I) - CD(I)));
EQ28(I)…LAMBDA =L= ((CH(I) - C10)/(CH(I) - CD(I)));
EQ29(I)…LAMBDA =L= ((CH(I) - C11)/(CH(I) - CD(I)));
EQ30(I)…LAMBDA =L= ((CH(I) - C12)/(CH(I) - CD(I)));
EQ31(I)…LAMBDA =L= ((CH(I) - C13)/(CH(I) - CD(I)));
EQ32(I)…LAMBDA =L= ((CH(I) - C14)/(CH(I) - CD(I)));
EQ33(I)…LAMBDA =L= ((CH(I) - C15)/(CH(I) - CD(I)));
EQ34(I)…LAMBDA =L= ((CH(I) - C16)/(CH(I) - CD(I)));
EQ35(I)…LAMBDA =L= ((CH(I) - C17)/(CH(I) - CD(I)));
EQ36(I)…LAMBDA =L= ((CH(I) - C18)/(CH(I) - CD(I)));
EQ37(M)…LAMBDA =L= ((XM(M) - X1)/(XM(M) - XL(M)));
EQ38(M)…LAMBDA =L= ((XM(M) - X2)/(XM(M) - XL(M)));
EQ39(M)…LAMBDA =L= ((XM(M) - X3)/(XM(M) - XL(M)));
EQ40(M)…LAMBDA =L= ((XM(M) - X4)/(XM(M) - XL(M)));
EQ41(I)…C1 =G= CD(I);
EQ42(I)…C2 =G= CD(I);
EQ43(I)…C3 =G= CD(I);
EQ44(I)…C4 =G= CD(I);
EQ45(I)…C5 =G= CD(I);
EQ46(I)…C6 =G= CD(I);
EQ47(I)…C7 =G= CD(I);
EQ48(I)…C8 =G= CD(I);
EQ49(I)…C9 =G= CD(I);
EQ50(I)…C10 =G= CD(I);
EQ51(I)…C11 =G= CD(I);
EQ52(I)…C12 =G= CD(I);
EQ53(I)…C13 =G= CD(I);
EQ54(I)…C14 =G= CD(I);
EQ55(I)…C15 =G= CD(I);
EQ56(I)…C16 =G= CD(I);
EQ57(I)…C17 =G= CD(I);
EQ58(I)…C18 =G= CD(I);
EQ59(I)…C1 =L= CH(I);
EQ60(I)…C2 =L= CH(I);
EQ61(I)…C3 =L= CH(I);
EQ62(I)…C4 =L= CH(I);
EQ63(I)…C5 =L= CH(I);
EQ64(I)…C6 =L= CH(I);
EQ65(I)…C7 =L= CH(I);
EQ66(I)…C8 =L= CH(I);
EQ67(I)…C9 =L= CH(I);
EQ68(I)…C10 =L= CH(I);
EQ69(I)…C11 =L= CH(I);
EQ70(I)…C12 =L= CH(I);
EQ71(I)…C13 =L= CH(I);
EQ72(I)…C14 =L= CH(I);
EQ73(I)…C15 =L= CH(I);
EQ74(I)…C16 =L= CH(I);
EQ75(I)…C17 =L= CH(I);
EQ76(I)…C18 =L= CH(I);
EQ77(M)…X1 =G= XL(M);
EQ78(M)…X2 =G= XL(M);
EQ79(M)…X3 =G= XL(M);
EQ80(M)…X4 =G= XL(M);
EQ81(M)…X1 =L= XM(M);
EQ82(M)…X2 =L= XM(M);
EQ83(M)…X3 =L= XM(M);
EQ84(M)…X4 =L= XM(M);
EQ85…LAMBDA =G= 0;
EQ86…LAMBDA =G= 1;
objective…obj =E= LAMBDA;
MODEL EQ /ALL/
SOLVE Eq USING LP MINIMIZING obj;
–
Thanks,
Best Regards
Sohom Mandal
M.tech
Center for Enviornmental Science and Engineering
IIT Bombay, Powai, Mumbai
Pin 400076
Mobile: 9930065368
sohomiitb@gmail.com
sohomiitb@iitb.ac.in
–
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.