Hello dear friends,
I am bit new to GAMS. I construct a model (with dummy data) and run in GAMS. But I am unable to understand the error.
I will be very much grateful to you , if any one can help;
I am pasting complete model here for your check and advice. (Copy and paste in GAMS, it will run)
I will be waiting for your help.
Thanks,
BAZMI
…
MODEL
Sets
r Raw material Locations / pm-1*pm-5 /
s Raw material Type / EF, Fib, She /
j Biomass Processing Technology / j-1 * j-4 /
k Products / k-1 * k-3 /
c Processing Capacity of Processing Technology Plant / Small, Medium, Large /
l Processing Plant Location / l-1, l-2 /
m Markets / FS-A, FS-B, FS-C, FS-D, FS-E / ;
Scalars
te trasportation expense in RM per case per km /10/
de distribution expense in RM per case per km /1/ ;
table d(l, r) travel distance bw r and l in km
pm-1 pm-2 pm-3 pm-4 pm-5
l-1 40 67 56 78 38
l-2 62 47 72 35 68 ;
table p(l, m) average distance of market m from plant l in km
FS-A FS-B FS-C FS-D FS-E
l-1 60 45 62 90 64
l-2 42 68 80 80 46 ;
table a(s, r) available material types at raw material sites in tons
pm-1 pm-2 pm-3 pm-4 pm-5
EF 3500 4526 437 2354 654
Fib 2543 2134 345 1875 453
She 1600 1235 254 986 148 ;
table q(k, m) demand of product k at market m in MW
FS-A FS-B FS-C FS-D FS-E
k-2 200 225 325 335 356 ;
table dmin(k, m) minimum demand of K at m in MW
FS-A FS-B FS-C FS-D FS-E
k-2 180 200 300 310 350 ;
table dmax(k, m) maximum demand of k at m in MW
FS-A FS-B FS-C FS-D FS-E
k-2 250 280 380 375 390 ;
table alpha(c, j) capcity of plant j ton per day
j-1 j-2 j-3 j-4
Small 50 40 40 15
Medium 180 120 120 25
Large 250 220 220 40 ;
table caq(s, r) acquisition cost of biomass types at sites in RM per ton
pm-1 pm-2 pm-3 pm-4 pm-5
EF 20 21 20 20 19
Fib 15 15 14 15 14
She 9 8 8 9 8 ;
table cac(c, j) Annualized capital cost in million of RM per case
j-1 j-2 j-3 j-4
Small 500 600 650 300
Medium 650 700 750 400
Large 800 850 900 500 ;
table beta(c, j) relative consumption of capacity (ton c per ton s)
j-1 j-2 j-3 j-4
Small .5 .5 .5 .5
Medium .25 .25 .25 .25
Large .1 .1 .1 .1 ;
table cop(c, j) operation cost in RM per ton
j-1 j-2 j-3 j-4
Small 100 120 125 80
Medium 130 155 160 125
Large 135 160 165 135 ;
table y(j, k) yield facotr
k-1 k-2 k-3
j-1 2 2.5
j-2 2.5 4 2.5
j-3 3 4 4.5
j-4 2 3.5 ;
parameters ctc(r, l, s) Transportation cost for raw material from sites r to plant location l in RM ;
ctc(r, l, s) = ted(l, r) ;
parameters cdc(l, m, k) Distribution cost in RM ;
cdc(l, m, k) = dep(l, m) ;
Variables
x(j, l, c) binary variable wether to place j of c at l
f(j, c, r, s, l) flowrate of s from r to j of c at l in ton per hour
fms(k, l,s, m) flowrate of k from l to m in ton per hpur
ctotal define objective function
ctan(j, l) total annualized fiexed cost for j at l in million of RM per case
ctpr(j, l) total processing cost for j at l in RM per ton
cttr(s) total transportation cost for s in RM per ton
cdis(k) total distribution cost for k at m
ctacq(s) total acquisition cost of s at r in RM per ton
lhsb lhs of rmflowl
rhsb rhs of rmflowl
lhsc lhs of supply
lhsd lhs of tprocost
lhse lhs of ttranscost
rhse rhs of ttranscost
rhsf1 rhs1 of tdistcost
rhsf2 rhs2 of tdistcost
rhsg rhs of tacqcost ;
binary variable
x(j, l, c) ;
Equations
EQB1 lhs of rmflowl
EQB2 rhs of rmflowl
EQC lhs of supply
EQD lhs of tprocost
EQE1 lhs of ttranscost
EQE2 rhs of ttranscost
EQF1 rhs1 of tdistcost
EQF2 rhs2 of tdistcost
EQG rhs of tacqcost
cost define objective function
rmflowr(r, s) raw material flow of s from site r
rmflowl raw material flow to j of c at l
supplymin minmum supply at m in MW
supplymax maximum supply at m in MW
capopt capacity options
tannfcost(j,l) total annualized fiexed cost for j
tprocost total processing cost for j
ttranscost total transportation cost for s
tdistcost(k) total distribution cost for k
tacqcost total acquisition cost of s ;
rmflowr(r, s)… sum((j, c, l), f(j, c, r, s, l)) =l= a(s, r) ;
EQB1(j,c,s,l)… lhsb =e= sum(r, f(j, c, r, s, l));
EQB2(l,c)… rhsb =e= sum(j, alpha(c, j) * x(j, l, c)) ;
rmflowl… sum((j,c), beta(c, j)) * lhsb =l= rhsb ;
EQC(s,m)… lhsc =e= sum((l, k), fms(k, l,s, m)) ;
supplymin(k,m)… lhsc =g= dmin(k, m) ;
supplymax(k,m)… lhsc =l= dmax(k, m) ;
capopt… sum((c, j, l), x(j, l, c)) =l= 1 ;
tannfcost(j,l)… ctan(j,l) =e= sum(c, cac(c, j)x(j, l, c)) ;
EQD(j)… lhsd =e= sum((c, s), cop(c, j)) ;
tprocost(j,l)… ctpr(j, l) =e= lhsd * lhsb ;
EQE1(r,l)… lhse =e= sum((j, s),ctc(r, l, s)) ;
EQE2(r,s,l)… rhse =e= sum((j, c), f(j, c, r, s, l)) ;
ttranscost(s)… cttr(s) =e= lhse rhse ;
EQF1(k)… rhsf1 =e= sum((l, m),cdc(l, m, k)) ;
EQF2(s,l,m)… rhsf2 =e= sum(k, fms(k, l,s, m)) ;
tdistcost(k)… cdis(k) =e= rhsf1 * rhsf2 ;
EQG(r,s)… rhsg =e= sum((c, j, l), f(j, c, r, s, l)) ;
tacqcost(s,r)… ctacq(s) =e= caq(s, r)* rhsg ;
cost… ctotal =e= sum((l, j),(ctan(j, l) + ctpr(j, l))) + sum(s, cttr(s)) + sum((r, s),ctacq(s)) + sum(k,cdis(k)) ;
Model rmscnetwork /all/ ;
option MIP = GAMSCHK ;
solve rmscnetwork using minlp minimizing ctotal ;
–
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.