Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
KINETICS
PROJECT ONE
GROUP;
[1] NWAZOJIE CHUKWUDALU CLARE 40499
[2] OSAWEMWENZE AMEN LILIAN 40503
1
40499 and 40503
Problem 1: Solve the ODE below for concentration ( C ) as a function of reactor volume (VR ).
Develop a MATLAB m-file. Plot concentration versus volume label the axes and provide a
graph title. Discuss the solution.
= 0 < VR 2000
( )
c(0) = 2;
Data : Q = 50; k = 0.198; v = 3.8
Solution
The ordinary differential equation (ODE) is solved for concentration as a function of reactor volume, the
equation is already represented in the form that is recognised by MATLAB, therefore the equation was
solved directly using ode45. The matlab code is shown below;
MATLAB CODE:
function [VR,c]=ODEproblem1(N)
Vrspan=[0 N]; %define the volume interval on which to solve the problem
c0=2; %define the initial condition
% Call on ode45 to solve the problem, RHS is a function that defines the
% right hand side of the ODE, The @ symbol tells me that the RHS is a
% function and not a variable
[VR,c]=ode45(@RHS,Vrspan,c0);
figure
plot (VR,c,'m'); grid on %plot concentration c versus Volume VR
xlabel ('VR'); %This is the x-axis
ylabel ('c');%This is the y-axis
title ('This is plot of Concentration, c versus Volume, VR');
end
2
40499 and 40503
1.8
1.6
1.4
1.2
c
1
0.8
0.6
0.4
0.2
0 200 400 600 800 1000 1200 1400 1600 1800 2000
VR
Figure 1: A plot of Concentration against reactor volume
Discussion 1:
The Fig. 1 shows the solution to the ordinary differential equation obtained from Matlab. The graph
shows that the initial condition was satisfied, the concentration was two (C=2) when the reactor volume
was zero (Vr = 0). The graph also shows that as the volume of the reactor increases, the concentration
decreases. At Vr = 1000, the concentration was 0.93 and at Vr = 2000, the concentration was 0.38. Since
the initial conditions are satisfied and the concentration tends to zero as the volume increases, the graph
can be said to be the solution of the equation. This shows that concentration has an inverse relationship
with the reactor volume.
Problem 2: Solve the following two-point BVP using Matlab. Provide the Matlab file as well as
a discussion of the solution.
+ = 0 < r <1
|r=0= 0 c(1) =1 = 5 K = 2
3
40499 and 40503
Solution 2:
Matlab does not recognize the form in which the equation is written since it is a second order equation,
therefore the equation will be written in the form matlab recognises by writing it in the form of first order
equation as shown below;
+ = .(1)
bl(2) + c(2) =
( )
bl(2) = - b(2).Second ODE equation
( )
Matlab Code 2:
4
40499 and 40503
0.95
0.9
c 0.85
0.8
0.75
0.7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
r
Figure 2: Plot of C against r.
5
40499 and 40503
Discussion 2:
The Fig. 2 gives the plot for the two - point Boundary Value Problem (BVP) using Matlab. bvp4c was
called on to solve the equation, the resulting graph shows that the boundary conditions were satisfied. The
BVP = 0 on the left hand side of the graph is satisfied as this shows that the change of 'c' with
respect to 'r' is zero. At r = 0, c=0.74 and at r = 1, c = 1 this shows that 'c' increases as 'r' increases. The
two boundary conditions are satisfied therefore the graph is a solution and has a reasonable interpretation
to the two - point Boundary Value Problem (BVP).
Problem 3:
To solve a steady state problem that combines diffusion with convective transport and chemical reaction
which is shown in the equation below;
+ = 0 ...................................... (1)
0< =2
=1 =0 = 0.5 0 2
Solution 3:
Matlab does not recognize the form in which equation (1) is written since it is a second order equation,
therefore the equation will be written in the form matlab recognises by writing it in the form of first order
equation as shown below;
0.5 + = 0 . . (2)
but = , = 1 , therefore;
= (3)
0.5 = 0 (4)
2 2 =0
6
40499 and 40503
=2 +2
Let;
CA = y(1)
= (2)..............................................................................(5)
Therefore;
= =2 +2
Matlab will be used to solve the equations (5) and (6) which have been reduced into the form Matlab
understands.
Matlab Code 3:
figure
plot(z,c(1,:)); grid on %plots first row of z and c
xlabel('z'); % x-axis label
ylabel('C'); % y-axis label
title('Graph of Concentration along the Length Z @ Uz = 0.5');
end
end
0.9
0.9
0.8
0.8
0.7
C C 0.7
0.6
0.6
0.5
0.5
0.4
0.4
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
z z
A B
Graph of Concentration along the Length Z @ Uz = 1.5 Graph of Concentration along the Length Z @ Uz = 2
1 1
0.95 0.95
0.9 0.9
0.85
0.85
0.8
0.8
C 0.75 C
0.75
0.7
0.7
0.65
0.65
0.6
0.55 0.6
0.5 0.55
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
z z
C D
Figure 3: Plot of Concentration against Z at (A) 0.5 (B) 1 (C) 1.5 (D) 2
The Fig. 3 shows the plot of concentration at various average velocity (Uz) which is for the convective
transport. Fig. 3a,3b,3c and 3d all satisfy the boundary condition of CA=1 at Z=0 at the right hand side of
the graph and = 0. The value of CA at Z=2 for varying values of Uz is shown below;
8
40499 and 40503
The table 1 shows concentration values extracted from the graphs at z=2. The values shows that as the
average velocity Uz is being increased, the concentration at z=2 increases indicating that as the velocity
is increased, the concentration of the reactant that is unused is increasing therefore the product formed at
z=2 is decreasing with increasing average velocity (Uz). This means that when velocity is increased, there
is insufficient time for complete conversion of to take place at constant L=2 as diffusion takes place.
Graph of Concentration along the Length Z @ Uz = 1
1 Graph of Concentration along the Length Z @ Uz = 1
1
0.9 0.9
0.8
0.8
0.7
C 0.7 C 0.6
0.5
0.6
0.4
0.5
0.3
0.4 0.2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.5 1 1.5 2 2.5 3 3.5 4
z z
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0 0
0 2 4 6 8 10 12 14 16 18 20 0 5 10 15 20 25 30 35 40
z z
Figure 4. Plot of C against z at varying L=Z at constant Uz=1 for second order reaction
9
40499 and 40503
The Fig. 4 shows that when the length L= Z is varied for a constant Uz = 1 the amount of unused reactant
decreases as concentration is decreasing at L= Z indicating that more product is formed therefore
increasing velocity with increase in the length of the reactor increase time for reaction to take place
thereby forming more product as concentration of reactant is tending towards zero which is seen when
L=4, C= 0.27, at L=20, C= 0.05 and at L=40, C= 0.03. The graph also shows that as diffusion propagates,
the concentration decreases. Therefore increasing the reactor length when Uz is varied will lead to
concentration decreasing and tending to zero as diffusion is taking place.
but = , = 1 , therefore;
= (3)
0.5 = 0 (4)
2 2 =0
=2 +2
Let;
CA = y(1)
= (2)..............................................................................(5)
Therefore;
= =2 +2
Matlab Code:
figure
plot(z,c(1,:)); grid on %plots first row of z and c
xlabel('z'); % x-axis label
ylabel('C'); % y-axis label
title('Graph of Concentration along the Length Z @ Uz = 0.5');
end
end
0.8
0.8
0.7
0.7
C 0.6
C 0.6
0.5
0.5
0.4 0.4
0.3 0.3
0.2 0.2
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
z z
A B
Figure5: Plot of Concentration against Z at (A) Uz=0.5 and (B) Uz = 1 for first order reaction
11
40499 and 40503
0.9 0.9
0.8 0.8
0.7
C 0.7
C
0.6
0.6
0.5
0.5
0.4
0.4
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
z z
C D
Figure5: Plot of Concentration against Z at (C) Uz=1.5 and (D) Uz = 2 for first order reaction
The Fig. 3 shows the plot of concentration at various average velocity (Uz) which is for the convective
transport. Fig. 5a,5b,5c and 5d all satisfy the boundary condition of CA=1 at Z=0 at the right hand side of
the graph and = 0. The value of CA at Z=2 for varying values of Uz is shown below;
The table 1 shows concentration values extracted from the graphs at z=2. The values shows that as the
average velocity Uz is being increased, the concentration at z=2 increases indicating that as the velocity is
increased, the concentration of the reactant that is unused is increasing therefore the product formed at
z=2 is decreasing with increasing velocity. This means that when velocity (Uz) for convective transport is
increased, there is insufficient time for complete conversion to take place when the length of Z is 2.
The table 3 shows the concentration at z=2 for varying Uz. The table shows that the concentrations for the
first order reaction at z=2 are lower than the concentrations for the second order reaction indicating that
more product is formed in the first order reaction than the second order reaction as the value of Uz is
increased because the concentration of the unused reactants are lower for the first order than in the second
order reaction. Since the concentration is lower for the first order reaction than the second order reaction
therefore the diffusion rate propagates faster and the rate of reaction to form a product is higher in the first
order than in the second order reaction. The convective transport is also higher in the first order reaction
than in the second order reaction since the final concentration at z=2 is lower in the first order reaction
than in the second order reaction.
Problem 4:
Solve the following PDE using the MATLAB function pdepe. Provide the Matlab
file as well as a discussion of the solution.
= - Da - ..1
= - Da - 2
C = x-m ( m
f)+s
C = 1; m = 0; f = ; s = - Da -
13
40499 and 40503
p + qf = 0
p+q =0
pl = - [1-c|(0,t)] and ql = -1
pl = -[1-c] and ql = -1
| (1,t) = 0.BC 2
pr = 0 and qr = Pe
pr = 0 and qr = 100
c0= 0 .. IC
Matlab Code 4:
ylabel('Time t')
zlabel('c')
figure
plot(x,c(1,:)); grid on
title('Plot of solution @ tf=2.5') %tf will be varied for 1,2 and 4
xlabel('Distance x')
ylabel('c(x,tf)')
figure
plot(t,c(:,end)); grid on
title('Plot of solution @ x=1')
xlabel('Time t')
ylabel('c(1,tf)')
end
function [C,f,s]=pdeFunc(x,t,c,dcdx)
%This defines c(x,t,u,dudx), s(x,t,u,dudx), f(x,t,u,dudx)
C = 1;
f = (1/100)*dcdx;
s = -(2*c/(c+2))-(dcdx);
end
function [pl,ql,pr,qr]=pdeBC(xl,cl,xr,cr,t)
%This defines the boundary conditions:i.e. left BC & right BC
%[pl,ql,pr,pl]==[pLeft,qRight,pRight,pLeft]
%[xl,xr]=[0,1]
%[xl,cl,xr,t]==[xleft,cleft,xright,time]
pl = -(1-cl);
15
40499 and 40503
pr = 0;
ql = -1;
qr = 100;
end
1.5
0.9
1
0.8
c
c(x,tf)
0.7 0.5
0.6
0
3
0.5 1
2
0.8
0.6
1 0.4
0.4 0.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0
Time t 0
Distance x Distance x
A B
Plot of solution @ tf=0.5
Plot of solution @ tf=1
1
1
0.9
0.9
0.8
0.8
0.7
0.6 0.7
c(x,tf) c(x,tf)
0.5 0.6
0.4
0.5
0.3
0.4
0.2
0.1 0.3
0 0.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Distance x Distance x
C D
Figure 7: Plot of C against X at (A) tf = 2.5 (B) Surf tf =2.5 (C) tf = 0.5 (D) tf = 1
16
40499 and 40503
0.9
0.9
0.8 0.8
c(x,tf)
0.7 c(x,tf)
0.7
0.6 0.6
0.5 0.5
0.4 0.4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Distance x Distance x
A B
Figure 8: Plot of C against X at (A) tf= 2 (B) tf = 4
Plot of solution @ x=1
0.5
0.45
0.4
0.35
0.3
c(1,tf)
0.25
0.2
0.15
0.1
0.05
0
0 0.5 1 1.5 2 2.5
Time t
17
40499 and 40503
Discussion 4:
The plot of the solution c versus x, distance is first obtained at final time, tf=2.5 and further varied at
times 0.5, 1, 2 and 4. The initial plot at tf= 2.5 gave a negative slope that indicates that the solution c
decreases as the distance, x increases. Subsequent plots such as @ tf=0.5, altered the regularity of the
previous plot at the maximum limit of x, solution of c remained constant with a value of zero until x
started decreasing and at point 0.8 of the x-axis, c gradually started to increase in a curve like manner
until at some point between 0.8 and 0.9 of c the slope disrupts a little and then continues. Plots of tf= 4
and tf=2 had no significant change compared with the initial plot of tf=2.5 and then plot of tf=1 had at the
maximum limit of x, c solution close to value 0.3 and then continued to increase almost uniformly
with decreasing values of x. It can now be deduced that at varying tf greater than 2 the plots remained
the same but at tf less than 2 the plots varied at different values of tf. Assuming the solution of c is
concentration of molecules in space and x is the distance the concentration moves, it now means that at a
lesser time such as 0.5, the concentration does not cover much distance but at a greater time interval the
concentration travels covering a greater distance.
In the last plot of c solution versus time, t which is a positive indicates that the latter remained at zero
until time of almost 0.5 where it increased continuously with time but at some point of time 1.25, the
solution of c remained constant with increasing time.
The plot of c solution versus time, t implies that concentration increased with time and got to a point the
concentration remained constant even with increase in time.
18