You are on page 1of 3

Simulation & Optimization

TUT (5) solution


Question 1
DF table:
Number of variables + R 5+1
T 8
Q 4
MB 3
Composition 1 (water in boiler)
Basis 1
Conversion 1
EB 4
Given T 5
Given Q 4
DF 0

Selection Table:
Stream 1 2 3 4 5 6 7 8 9 Total
# of - 1 - 1 2 - - - 1 4+R
variables - S - O O,S w
T T5 T6 T7 3

MB + EB + Conversion = number of selected variables


Reaction equation:
2SO2 + O2  2SO3
Base = 100 gmol. (In stream 5)
Conversion 96%
Latent heat of saturated steam at 300 Pisa is 450 kCal/kg
MATLAB Code
Function file:
function f = tut5q1(x)
% s=SO2 , o=O2
% c=SO3 , r=extent of reaction
s2 = x(1); o4 = x(2);
s5 = x(3); o5 = x(4);
r = x(5);
t5 = x(6); t6 = x(7); t7 = x(8);
w9 = x(9); %water in boiler
HR = -46180 ; %cal/gmol
%Stream 5,6,7 & 8 have the same flow concentration
%Material Balance (only for the reactor)
f(1)= o4 - r - o5 ;
f(2)= s2 - 2*r - s5;
f(3)= 2*r - (100 - s5 - o5);
%Conversion
f(4)= 0.04*s2 - s5 ;
%Energy Balance for the reactor Tref = 425
f(5)= r*HR + (s5*11.8 - o5*7.8 + (100 - s5 - o5)*17.2)*(t5 - 425) - 10000;
%Energy Balance for the first heat exchanger Tref = 425
f(6)= (s5*11.8 - o5*7.8 + (100 - s5 - o5)*17.2)*(t6-425) - ((s2*11.8*(300-
425)) + (s5*11.8 - o5*7.8 + (100 -s5 - o5)*17.2)*(t5-425));
%Energy Balance for the second heat exchanger Tref = 425
f(7)= (s5*11.8 - o5*7.8 + (100 - s5 - o5)*17.2)*(t7-425) - (o5*7.6*(25*425)
+ (s5*11.8 - o5*7.8 + (100 -s5 - o5)*17.2)*(t6-425));
%Energy Balance for the boiler Tref = 400
f(8)= w9*450000 - (s5*11.8 - o5*7.8 + (100 - s5 - o5)*17.2)*(t7-400);

end
Script file:
i =10*ones(1,9);
x = fsolve(@tut5q1,i);

fprintf('water in the boiler =%8.4f \n',x(9));


fprintf('Temperature in stream 5 =%8.4f \n',x(6));
fprintf('Temperature in stream 6 =%8.4f \n',x(7));
fprintf('Temperature in stream 7 =%8.4f \n',x(8));
fprintf('flow of so2 in stream 5 =%8.4f \n',x(3));
fprintf('flow of o2 in stream 5 =%8.4f \n',x(4));
fprintf('flow of so3 in stream 5 =%8.4f \n',(100 - x(4)- x(3)));

Command window

water in the boiler = 0.3211


Temperature in stream 5 =558.3957
Temperature in stream 6 =497.4923
Temperature in stream 7 =499.1647
flow of so2 in stream 5 = 48.5217
flow of o2 in stream 5 = 0.0302
flow of so3 in stream 5 = 51.4481

You might also like