You are on page 1of 3

Example 8-10

type LEP_8_10

% "LEP_8_10"
% m-file to solve example 8-10
%
% x(1)=fa
% x(2)=fb
% x(3)=fc
% x(4)=T
% xdot(1)=d(fa)/dv, xdot(2)=d(fb)/dv, xdot(3)=d(fc)/dv, etc.

function xdot=LEP_8_10(v,x)

ft=x(1)+x(2)+x(3);
k1a=10*exp(4000*(1/300-1/x(4)));
k2a=.09*exp(9000*(1/300-1/x(4)));
Cto=.1;
Ca=Cto*x(1)/ft;
Cb=Cto*x(2)/ft;
Cc=Cto*x(3)/ft;
r1a=-k1a*Ca;
r2a=-k2a*Ca^2;

xdot(1,:)=r1a+r2a;
xdot(2,:)=-r1a;
xdot(3,:)=-r2a/2;
xdot(4,:)=(4000*(373-x(4))+(-r1a)*20000+(-r2a)*60000)/
(90*x(1)+90*x(2)+180*x(3));

ic=[100;0;0;423]; vspan=[0 1];


[v,x]=ode45('LEP_8_10',vspan,ic);
T=x(:, 4);
plot(v,T);title('Example 8-10');xlabel('volume');ylabel('T')
Example 8.11
900

850

800

750

700

650
T

600

550

500

450

400
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
volume

plot(v,x(:,1:3)); title('Example 8-10');xlabel('volume');


ylabel('fa,fb,fc');
Example 8.11
100

80

60
fa,fb,fc

40

20

-20
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
volume

You might also like