Hello,

I’m making a problem to maximize the production in a certain refinery (college studies).

The software gives me the information that my problem is unbounded (badly scaled), what is the reason?

And the optimal solution is not correct.

The code is in attachment to this post.

Thank you in advance.

_Model:

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_

TP2.gms (4.42 KB)