$Title Refinery planning (TP1G04) $ontext G4 Bruno Pedro Nº42107 Mafalda Barros Nº42110 João Garcias Nº42902 $offtext $ontext Refinery one-day planning The refinery in study produces three types of fuel: Fuel oil - FO Gasoline 95 - G95 Gasoline 98 - G98 The cost factors (cost of production and taxes) are as follows: FO G95 G98 Total cost of production (€/liter) 0.30 0.5 0.65 The selling factors are as follows: FO G95 G98 Selling price (€/liter) 1.15 1.2 1.5 The production of at least two parts of fuel oil for each unit of gasoline. The anticipated demands will be a maximum of 300.10^6 of fuel oil a day and minimum of 140.10^6 of gasoline a day. The result will be the amount of each type of fuel to be produced to maximize profit. $offtext Set a declaration of type of fuels /FO, G95, G98/ ; Parameters costs(a) costs of production for each type of fuel in € per liter revenue(a) revenue of selling each type of fuel in € per liter mindemandgasoline minimum anticipated demand of gasoline (per day) maxdemandfueloil production limit of fuel oil (per day) ; *Import of the numerical data of the problem (input data file must be in project directory): $call GDXXRW.exe i=data_input.xlsx o=data_input.gdx par=costs rng=Refinery!B2:C5 rdim=1 par=revenue rng=Refinery!B7:C10 rdim=1 par=maxdemandfueloil rng=Refinery!B13 dim=0 par=mindemandgasoline rng=Refinery!B16 dim=0 $GDXIN data_input.gdx $LOAD costs, revenue, maxdemandfueloil, mindemandgasoline $GDXIN Positive Variables totalrevenue total revenue in € totalcosts total costs in € ; Free Variables totalprofit total profit in € z(a) decision variable in kg per each paper type ; Equations objfunction objective function totalrevenuecalc revenue calculation totalcostscalc costs calculation restriction1 restricting the minimum demand of gasoline per day restriction2 restricting the maximum demand of fuel oil production per day restriction3 restricting two parts of fuel oil for units of gasoline; totalrevenuecalc ..totalrevenue =e=(sum(a,revenue(a)*z(a))); totalcostscalc ..totalcosts =e=(sum(a,costs(a)*z(a))); objfunction ..totalprofit=e=((sum(a,revenue(a)*z(a)))-((sum(a,costs(a)*z(a))))); *Profit equals revenue minus costs restriction1..((z("G95"))+(z("G98")))=g= mindemandgasoline; *restricts the production of gasoline to a minimum demand value given restriction2..(z("FO"))=l= maxdemandfueloil; *restricts the maximum production of fuel oil restriction3..(z("FO"))=g=(2*(z("G95")+z("G98"))); *restricts the amount of gasoline to at least half the amount *fuel oil Model Refinery /all/ ; * Chosing of the minos solver for this solution Option lp=minos; File opt 'Minos option file' /minos.opt/; *Output file configuration in following code: putclose opt 'Iteration limit 10000'/ 'Feasibility tolerance 1.0E-5'/; File Dispatch this is the internal .doc /refinery_outputdata.doc/; puttl Dispatch, "Economical evaluation of production refinery"///; puthd "Products are the following:"/; put @10,"Fuel oil - FO"/ @10,"Gasoline 95 - G95"/ @10,"Gasoline 98 - G98"// ; Solve Refinery using lp maximizing totalprofit ; put Dispatch, "The optimal solution will have the following data: "// ; put Dispatch "Optimum decision:"// ; put Dispatch "Type of fuel", @30, "Liters of production per type of fuel"// ; loop (a,put Dispatch , a.tl," = ", @30,z.l(a):8:2/); put // ; put Dispatch "Optimum profit:", @16,totalprofit.l:10:2,@24," €"// ; put Dispatch "Optimum revenue:", @16,totalrevenue.l:10:2,@24," €"// ; put Dispatch "Optimum cost:", @16,totalcosts.l:10:2,@24," €"// ; putclose Dispatch; Display a,z.l,costs,revenue, totalprofit.l, totalrevenue.l, totalcosts.l, mindemandgasoline, maxdemandfueloil; *Display in software of the variabales and parameters