Professional Documents
Culture Documents
Script file:
%Intial value
x0=10*ones(1,5);
x=fsolve(@tut4_2,x0);
fprintf('The temp of gases leaving the reactor = %7.4f\n C',x(4))
Problem (3)
(a)
Solution:
D.F table:
No. of variables 8
R 1
Q 1
T 3
MB 5
Basis 2
Relations 1
Give q 0
EB 1
GIVEN IND. COMP 1
GIVEN TEMPS 3
D.F 0
Selection table
Streams 1 2 3
No. of independed 0 0 5+r+Q
variables
Selection - - O,A3,Q,N,W,C,r
Equations:
MB:
(0.21*2.4)-5r-O=0
(0.79*2.4)-C=0
1-4r-A3=0
4r-N=0
6r-W=0
Conversion:
(1-A3)-0.9=0
Energy balance:
(-
903.6*103*r)+(71671.6*A3)+(67411.4*W)+(26062.4*C)+(2672
4.7*N)+(26295.1*O)-Q=0
Matlab Code:
Function file:
function f=problem3_4(x)
%Variables
A3=x(1); r=x(2); Q=x(3); N=x(4); W=x(5); O=x(6);
C=x(7);
%Equations
f(1)=(2.4)-(5*r)-O;
f(2)=(2.4+N-(0.79*N))-C;
f(3)=1-(4*r)-A3;
f(4)=(4*r)-N;
f(5)=(6*r)-W;
f(6)=(1-A3)-0.9;
f(7)=(-
903.6*(10^3)*r)+(71671.6*A3)+(67411.4*W)+(26062.4*C)+(26724.7*N)+(26295.1*O
)-Q;
end
script file:
%Intial value
x0=10*ones(1,7);
x=fsolve(@problem3_4,x0);
fprintf('the required rate of heat = %7.4f\n',x(3))
command window:
the required rate of heat = 19916.5861
Problem4:
D.F Table:
Number of variables 8
Temperatures 2
Heat transfer rate 1
Extent of reaction 3
MB 6
EB 1
Given temperatures 2
Heat transfer rate 0
Independent compositions 4
Flow rate 1
Relations 0
DF 0
Script:
W2=x(1); C2=x(2); H2=x(3); r1=x(4); r2=x(5); r3=x(6);
x0=10*ones(1,7);
x=fsolve(@tut4_4,x0);
T=550:30:700;
Q=(-22*r1-50*r2-10*r3)+((0.2*0.8*(700-25)+(0.01*0.9*(700-25))+(W2*0.8*(700-
25))+(C2*0.45*(700-25))+(H2*0.4*(700-25)))-((0.25*6.9*(550-
25))+(0.75*0.4*(550-25))));
plot(T,Q)
title('T vs Q')
xlabel('T')
ylabel('Q')
legend('T')
grid on
fprintf('Heat transfer rate is=%7.3f\n',Q)
Command window:
Heat transfer rate is=-5434.8