You are on page 1of 5

Murtada Mohammed Abd Allah

Index: 152054

Simulation & Optimization


Hw.NO(7)
3-PROBLEM (3):
a- objective function (in this case it is “profit”)?
Profit+ sales – (raw cost+processing cost)
Assume : crude A = Xa , crude B =Xb
Sales = 36*(0.8Xa+.44Xb)+24*(0.05Xa+0.1Xb)+21*(0.1Xa+0.36Xb)+10*(0.5Xa+0.1Xb)
So sales = 32.6Xa+26.8Xb (1)
Raw cost= 24Xa+15Xb (2)
Processing cost= 0.5Xa+Xb (3)
Profit = 8.1Xa+10.8Xb ( objective function)
b- Constraints for refinery:
Gasoline: 0.8Xa+0.44Xb<= 24000
Kerosine: 0.05Xa+0.1Xb<=2000
Fuel oil: 0.1Xa+0.36Xb<=6000
The MATLAB code :
F=[8.1 10.8];
A=[0.8 0.44; 0.05 0.1; 0.1 0.36];
B=[24000; 2000;6000 ];
LB=[0 0];
UB=[inf inf];
[x,FVAL]=linprog(F,A,B,[],[],UB,LB)
PROBLEM 4:
Total annual variable cost= column variable cost + condenser variable cost +reboiler variable cost+
cooling water variable cost + steam variable cost

finding (cooling water & steam) equation's coefficients by using matlab :

SCRIPT FILE & COMMAND WINDOW:

THEN THE cooling water variable cost equation:

(9.1464*R^2 +6.6024*R +0.5191)*10^3

steam variable cost equation:

(5.8413*R^2 + 6.7522*R – 0.2099)*10^4

THEN the total annual variable costs = (1.23*R^2 -1.24*R +0.35)*10^5 + (3.82*R^2+ 1.68*R -
0.086)*10^3 +(7.68*R^2 +4.16*R – 0.4)*10^3 + (9.1464*R^2 +6.6024*R +0.5191)*10^3
+(5.8413*R^2 + 6.7522*R – 0.2099)*10^4

THEN the total annual variable cost equation = 202.039*R^2 – 44.0356*R + 32.9341

THE CODE:
function f= MURTA74(x)
f=202.039*x^2 -44.0356*x + 32.9341;
end

COMMAND WINDOW:
>> murta741

>> x

x=

0.1090

>> FVAL

FVAL =

30.5346

FUNCTION FILE:

SCRIPT FILE:

COMMAND WINDOW:

You might also like