# gams equation

 0 the last lines i should have these: X21+X22+X23+X24=55 X11+X12+X13+X14=90  so it should go around j so I wrote it Barrel(i)..sum(j,X(i,j))=E=90;  But I should have 55 too then it is incorrect how can I write these 55 and 90? SETS i regions /shomal,jonub/ j cities /shiraz,esfahan,hamedan,yazd/ k Refineries /p1,p2,p3/; PARAMETERS S(k) initial investment /p1 400000,p2 600000,p3 950000/ H(k) refinary capacity /p1 20,p2 35,p3 50/; Table C(i,j) cost per 1million barrel shiraz esfahan hamedan yazd shomal 120 90 75 80 jonub 45 65 110 95; VARIABLES X(i,j) quantity in million barrel Y(k,j) 1 if pk choosed and 0 if not Z total cost; POSITIVE VARIABLE X ; BINARY VARIABLES Y(k,j); EQUATIONS COST define objective function City(j) capacities in each city Barrel(i) ; COST.. Z=E=sum((i,j,k),C(i,j)*X(i,j)+S(k)*Y(k,j)); City(j)..sum(i,X(i,j))=L=sum(k,H(k)*Y(k,j)); Barrel(i)..sum(j,X(i,j))=E=90; MODEL petrol /ALL/ ; SOLVE petrol USING MINLP Minimizing Z ; display X.l,Z.l,s;  asked 27 Jan '12, 02:10 nik 5●1●4 accept rate: 0% Marco Luebbecke ♦ 3.4k●1●6●15

 1 you need to make the right hand side of the equation a parameter dependent on i as well. is this a homework question? answered 27 Jan '12, 02:24 Marco Luebbecke ♦ 3.4k●1●6●15 accept rate: 16% honestly this is my project but I modeled it correctly in paper I should use it in Gams now.sorry I didn't got your mean.and I have another question is it correct to define here a binary? binary will have value 1 or zero? or it is incorrect? (27 Jan '12, 02:27) nik if I write it sum((i,j),x(i,j)) then how to assign 55 and 90? (27 Jan '12, 02:31) nik I got it I should use another variable which has 2 values 55 and 90 (27 Jan '12, 02:38) nik yes. actually, you use another parameter not a variable. (27 Jan '12, 02:49) Marco Luebbecke ♦ 1 G(i) region capacity /shomal 90,jonub 55/; yes my program is working Thank You so much Barrel(i)..sum(j,X(i,j))=E=G(i); (27 Jan '12, 02:55) nik
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

×127
×51
×18