$Title Location - Simple biorefinery Location Model Sets sl 'supply locations' /sKamloops, sHinton, sQuesnel,sPrinceGeorge, sCastlega, sCrofton, sBoyle, sPeaceRiver, sPortMellon, sSkookumchuck, sMackenzie, sNanaimo, sGrandPrairie/ bioref 'bioref locations' /bKamloops, bHinton, bQuesnel, bPrinceGeorge, bCastlega, bCrofton, bBoyle, bPeaceRiver, bPortMellon, bSkookumchuck, bMackenzie, bNanaimo, bGrandPrairie/ m 'demand markets' /domestic, international/ cat 'categories for warehouse data'/lineara, linearb, capacity/; Parameters supply(sl) 'quantity available at each supply location (units)' / sKamloops 44250 sHinton 47500 sQuesnel 21250 sPrinceGeorge 137500 sCastlega 65000 sCrofton 47125 sBoyle 81250 sPeaceRiver 60000 sPortMellon 53125 sSkookumchuck 29250 sMackenzie 30000 sNanaimo 45625 sGrandPrairie 31250 / demand(m) 'quantity required at demand market (units)' /domestic 693125, international 0/ ; Table cost_sbioref(sl,bioref) 'transportation cost for supply location to bioref (dollars per tonne)' bKamloops bHinton bQuesnel bPrinceGeorge bCastlega bCrofton bBoyle bPeaceRiver bPortMellon bSkookumchuck bMackenzie bNanaimo bGrandPrairie sKamloops 0.00 17.75 16.34 20.70 17.74 13.83 32.09 30.98 15.63 17.05 26.89 15.14 25.69 sHinton 17.75 0.00 19.10 17.45 27.53 29.80 16.52 15.26 31.39 16.44 21.54 32.35 12.84 sQuesnel 16.34 19.10 0.00 4.66 30.96 24.25 33.58 25.64 25.83 29.36 11.71 28.46 22.23 sPrinceGeorge 20.7 17.45 4.66 0.00 31.17 32.88 29.83 21.54 31.34 25.36 7.06 32.58 18.13 sCastlega 17.74 27.53 30.96 31.17 0.00 21.19 32.68 39.44 22.78 9.93 36.67 23.74 34.85 sCrofton 13.83 29.80 24.25 32.88 21.19 0.00 40.27 39.25 4.76 29.79 35.53 3.63 36.90 sBoyle 32.09 16.52 33.58 29.83 32.68 40.27 0.00 16.18 41.64 24.36 28.50 42.52 18.95 sPeaceRiver 30.98 15.26 25.64 21.54 39.44 39.25 16.18 0.00 40.67 30.70 17.31 41.55 7.60 sPortMellon 15.63 31.39 25.83 31.34 22.78 4.76 41.64 40.67 0.00 29.51 36.96 3.71 34.50 sSkookumchuck 17.06 16.44 29.36 25.36 9.93 29.79 24.36 30.70 29.51 0.00 28.17 30.40 26.11 sMackenzie 26.89 21.54 11.71 7.06 36.67 35.53 28.50 17.31 36.96 28.17 0.00 32.24 15.78 sNanaimo 15.14 32.35 28.46 32.58 23.74 3.63 42.52 41.55 3.71 30.40 32.24 0.00 39.20 sGrandPrairie 25.69 12.84 22.23 18.13 34.85 36.90 18.95 7.60 34.50 26.11 15.78 39.20 0.00 ; Table data(bioref,cat) 'data for biorefinery coeficients and capacity in tonnes per year' lineara linearb capacity bKamloops 308.87 4000000 200000 bHinton 308.87 4000000 200000 bQuesnel 308.87 4000000 200000 bPrinceGeorge 308.87 4000000 200000 bCastlega 308.87 4000000 200000 bCrofton 308.87 4000000 200000 bBoyle 308.87 4000000 200000 bPeaceRiver 308.87 4000000 200000 bPortMellon 308.87 4000000 200000 bSkookumchuck 308.87 4000000 200000 bMackenzie 308.87 4000000 200000 bNanaimo 308.87 4000000 200000 bGrandPrairie 308.87 4000000 200000 ; Variables tcost 'total cost of shipping over all routes (dollars) plus capital investment' capitalcost 'total capital investment for all plants build (dollars)' transpcost 'total shipping cost for all routes (dollars)'; Binary Variables build(bioref) 'biorefinery selected to be build yes or no'; Positive Variables ship_sbioref(sl,bioref) 'amount shipped to biorefinery (units)' ship_biorefm(bioref,m) 'amount shipped to maket (units)'; Equations tcost_eq 'total cost (dollars)' supply_eq(sl) 'limit of available supply at supply location sl' demand_eq(m) 'minimum requirement at demand market m' balance_eq(bioref) 'biorefinery supply/demand balance' capacity_eq(bioref) 'biorefinery capacity' capitalcost_eq 'total capital cost linear equation' transp_cost_eq 'total transportation cost' ; tcost_eq.. tcost =e= transpcost + capitalcost ; capitalcost_eq .. capitalcost =e= sum((sl,bioref), ship_sbioref(sl,bioref)*data(bioref,"lineara")+ data(bioref,"linearb")/13 * build(bioref))/10; transp_cost_eq.. transpcost =e= sum((sl,bioref),ship_sbioref(sl,bioref)*cost_sbioref(sl,bioref)); supply_eq(sl).. sum(bioref, ship_sbioref(sl,bioref)) =l= supply(sl); demand_eq(m).. sum(bioref,ship_biorefm(bioref,m)) =g= demand(m); balance_eq(bioref).. sum(m, ship_biorefm(bioref,m)) - sum(sl, ship_sbioref(sl,bioref)) =e= 0; capacity_eq(bioref).. sum(m, ship_biorefm(bioref,m)) =l= build(bioref)*data(bioref,"capacity") ; Model biorefinery 'biorefinery location model' /all/; solve biorefinery using mip minimize tcost; display build.l; display supply_eq.l; display capitalcost_eq.l;