0% found this document useful (0 votes)
45 views3 pages

Example 9-5: Type LEP - 9 - 5

This MATLAB code defines a system of ordinary differential equations to model an example chemical process over time. It defines variables like temperature (T), concentrations of different chemicals (ca, cb, etc.), and rates of change (xdot). The ODEs are integrated numerically over time to generate plots showing how T and ca vary with time and each other.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Example 9-5: Type LEP - 9 - 5

This MATLAB code defines a system of ordinary differential equations to model an example chemical process over time. It defines variables like temperature (T), concentrations of different chemicals (ca, cb, etc.), and rates of change (xdot). The ODEs are integrated numerically over time to generate plots showing how T and ca vary with time and each other.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

Example 9-5

type LEP_9_5
%
%
%
%
%
%
%
%
%

"LEP_9_5"
m-file to solve example 9-5
x(1)=ca
x(2)=cb
x(3)=cc
x(4)=cm
x(5)=T
xdot(1)=d(ca)/dt, xdot(2)=d(cb)/dt, xdot(3)=d(cc)/dt, etc.

function xdot=LEP_9_5(t,x)
UA=16000;
Ta1=60;
Fao=80;
To=75;
k=16.96e12*exp(-32400/1.987/(x(5)+460));
Fbo=1000;
Fmo=100;
ra=-k*x(1);
rb=-k*x(1);
rc=k*x(1);
Thetacp=35+Fbo/Fao*18+Fmo/Fao*19.5;
vo=Fao/0.923+Fbo/3.45+Fmo/1.54;
V=500/7.484;
tau=V/vo;
cao=Fao/vo;
cbo=Fbo/vo;
cmo=Fmo/vo;
Na=x(1)*V;
Nb=x(2)*V;
Nc=x(3)*V;
Nm=x(4)*V;
mc=1000;
NCp=Na*35+Nb*18+Nc*46+Nm*19.5;
Ta2=x(5)-((x(5)-Ta1)*exp(-UA/(18*mc)));
Q=mc*18*(Ta1-Ta2);
xdot(1,:)=1/tau*(cao-x(1))+ra;
xdot(2,:)=1/tau*(cbo-x(2))+rb;
xdot(3,:)=1/tau*(0-x(3))+rc;
xdot(4,:)=1/tau*(cmo-x(4));
xdot(5,:)=(Q-Fao*Thetacp*(x(5)-To)+(-36000)*ra*V)/NCp;
ic=[0;3.45;0;0;75]; tspan=[0 4];
[t,x]=ode45('LEP_9_5',tspan,ic);

T=x(:, 5);
plot(t,T); title('Example 9-5');xlabel('t');ylabel('T');
E x a m p le 9 . 4
160
150
140
130

120
110
100
90
80
70
0

0 .5

1 .5

2
t

2 .5

3 .5

ca=x(:, 1);
plot(t,ca);title('Example 9-5');xlabel('t');ylabel('ca');

E x a m p le 9 . 4
0 .1 6
0 .1 4
0 .1 2

ca

0 .1
0 .0 8
0 .0 6
0 .0 4
0 .0 2
0

0 .5

1 .5

2
t

2 .5

3 .5

plot(T,ca);title('Example 9-5');xlabel('T');ylabel('ca');
E x a m p le 9 . 4
0 .1 6
0 .1 4
0 .1 2

ca

0 .1
0 .0 8
0 .0 6
0 .0 4
0 .0 2
0
70

80

90

100

110

120
T

130

140

150

160

You might also like