Professional Documents
Culture Documents
152066
TUT 3
REACTING SYSTEMS
Solution:
1. DF Table:
Stream 1 2 3 4 5 6 Total
Number of unknownsIndependent 2 0 5 2 1 2 12 +
Variables 2=14
Selected Variables E1,O1 _ E3,O3, C4,W4 EO5 E6,O6
EO3,C3
W3
3. Equations in Terms of Independent Unknowns:
Material Balance = 12
Mixer relations:
C2H4: E1 + E6 = 75 O2: O1 + O6 = 25
Reactor relations:
C2H4: 75 – 2r1 – r2= E3 O2: 25 - r1– 3r2 = O3
C2H4O: 0 + 2r1= EO3 CO2: 0 + 2r2 = C3
H2O: 0 + 2r2 = W3
Separator relation:
C2H4: E3 = E6 O2: O3 = E6
C2H4O: EO3 = EO5 CO2: C3 = C4
H2O: W3 = W4
Yield relation = 1
actualyeild × 100 %
Yield =
theoreticalyeild
EO 3
0.9 =
75
EO3 = 75 * 0.9
Chemical Conversion = 1
Reactantinreactor −reactantinreactoroutlet
Conversion =
reactantinreactor
75−E 3
0.2 =
75
0.2 * 75 = 75 – E3
4. Matlab code:
Function file:
function f = tut3(x)
E1 = x(1); O1 = x(2); E3 = x(3); O3 = x(4); EO3 = x(5); C3 = x(6); W3 = x(7); C4 = x(8);
W4 = x(9); EO5 = x(10); E6 = x(11); O6 = x(12); r1 = x(13); r2 = x(14);
f(1) = E1 + E6 - 75;
f(2) = O1 + O6 - 25;
f(3) = 75 - 2*r1 - r2 - E3;
f(4) = 25 - r1 - 3*r2 - O3;
f(5) = 0 + 2*r1 - EO3;
f(6) = 0 + 2*r2 - C3;
f(7) = 0 + 2*r2 - W3;
f(8) = E3 - E6;
f(9) = O3 - O6;
f(10) = EO3 - EO5;
f(11) = C3 - C4;
f(12) = W3 - W4;
f(13) = 75 * 0.9 - EO3;
f(14) = 0.2 * 75 - 75 + E3;
end
Script file:
x0 = 10*ones(1,16);
x = fsolve(@tut3,x0);
feed = x(1)+ x(2);
fprintf (' The product flow rate of co2 = %6.2f\n',x(8));
fprintf (' The product flow rate of h2o = %6.2f\n',x(9));
fprintf (' The product flow rate of c2h4o = %6.2f\n',x(10));
fprintf (' The product flow rate of c2h4 = %6.2f\n',x(11));
fprintf (' The product flow rate of o2 = %6.2f\n',x(12));
fprintf (' The value of r1 = %6.2f\n',x(13));
fprintf (' The value of r2 = %6.2f\n',x(14));
fprintf (' The feed steam flow rate = %6.2f\n',feed);
Command Window:
>> run_tut3
Equation solved.
fsolve completed because the vector of function values is near zero as measured by the
default value of the function tolerance, and the problem appears regular as measured by
the gradient.
Problem (3) :
MB 5
Independent compositions 4
Basis 1
DF 0
Stream 1 2 Total
Unknown - 2 2+3=5
variables
selection - A,B
A= H2 , B=CO2
Reaction equations:
CO+2H2 ـــــCH3OH
CO+3H2 ـــــــCH4+H2O
CO+H2O ـــــCO2+H2
3CO+2H2OـــــCH3OH+2CO2
number of independent Material Balance = 5
number of unknown variables =5
DF=5-5=0
Equations of unknown variables H2 , CO2 :
75-A2-2*r1-3*r2=0
-B2+2*r4=0
25-(0.2*(A2+B2))/0.67=0
-0.08*(A2+B2)/0.67=0
-0.05*(A2+B2)/0.67=0
MatlabCode:
Function file :
function f =prob3(x)
A2=x(1);B2=x(2); r1=x(3);r2=x(4);r4=x(5);
%material balance for H2:
f(1)=75-A2-2*r1-3*r2;
%material balance for Co2:
f(2)=-B2+2*r4;
%material balance for Co:
f(3)=25-(0.2*(A2+B2))/0.67;
%material balance for CH3OH:
f(4)=-0.08*(A2+B2)/0.67;
%material balance for CH4:
f(5)=-0.05*(A2+B2)/0.67;
end
//script file :
%initial guesses of 15 for all 5 variables
x0=15*ones(1,5);
x=fsolve(@prob3,x0);
%check
N2=(x(1)+x(2))/0.67;
Comp1= x(1)/N2;
Comp2= x(2)/N2;
fprintf('flowrate of stream 2=%6.2f \n',N2)
fprintf('Composition of H2=%6.2f \n',Comp1)
fprintf('Composition of Co2=%6.2f \n',Comp2)
command window
FLOWRATE_4= 11.51
FLOWRATE_5= 25.14
FLOWRATE_6= 48.73
FEED STREAM FLOWRATE= 51.50