Volumetric Flow Rate Q 50 Total Volume V 2000 Concentration at Inlet C 2 Rate Constant K 0.198 Velocity V 3.8

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Assignmnet#4 Summiya Iftikhar Hafsa Afzal

(2015-pe-08) (2015-pe-10)

Question #1:
The schematics of a plug flow reactor are shown in fig.1. Solve for the
concentration distribution in a plug flow reactor governed by the following
equations using MATLAB
Given Data:
Volumetric flow rate=Q=50
Total volume=V=2000
Concentration at inlet=Cin=2
Rate constant=k=0.198
Velocity=v=3.8
Formula:
Qdc/dVr=-RC
C(0)=Cin
R(C)=k*c/c+v
Solution:
We use the MATLAB code to find the solution
MATLAB SCRIPT
Function file:
%Group # 13
%summiya iftikhar(2015-pe-08)
%Hafsa Afzal(2015-pe-10)
%question#1:
function y=plug(c,Q)
% plug flow reactor
global k v
R=(k*c)/(c+v);
y=-R/Q;
end
Run file:
%call file
global k v Cin Q
%given data :
k=0.198;%reaction rate constant
1
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

v=3.8;
Cin=2;%concentration in
C=2;%concentration
Q=50; %volumetric flow rate
V=[0 2000];%volume
[V,R]=ode45(@plug,V,C);
%graph plotation
plot(V,R)
xlabel('volume')
ylabel('concentration')
title('concentration vs volume of plug flow reactor')
Conclusion:
Results will be displayed by running this code

Fig: 1.1: graph of plug flow reactor


Question #2:
Solve for the concentration distribution in a plug flow reactor with the
following reaction rate expression and parameters using MATLAB.

Given Data:

Volumetric flow rate=Q=2.2


Total volume=V=50
Concentration at inlet=Cin=1
Rate constant=k=2
Rate constant=K1=4
Formula:

2
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

Qdc/dVr=-RC
C(0)=Cin
R(C)=k*c/(1+K1c)2
Solution:
We use the MATLAB code to find the solution
MATLAB Script
Function file:
%Group 13:
%summiya iftikhar(2015-pe-08)
%Hafsa Afzal(2015-Pe-10)
function y=flow(c,v )
global k K1 Q
R=(k*c)/((1+(K1*c))^2);
y=-R/Q;
end
Call File:
%call file
global k K1 V Cin Q
k=2;
K1=4;
Q=2.2;
V=[0 50];
Cin=1;
c=1;
[V,R]=ode45(@flow,V,c);
plot(V,R)
xlabel('volume')
ylabel('concentration')
3
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

title('volume vs concentration')

Conclusion:
Results will be displayed on execution

Fig: 1.2: graph between volume vs concentration

Question #3:
The schematics of a CSTR are shown fig 2.

The working of CSTR is governed by the following equation


Q(c − cin) = −VR(c)
Part a:
Given Data:
4
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

Volumetric flow rate=Q=50


Total volume=V=2000
Concentration at inlet=Cin=2
Rate constant=k=0.198
Velocity=v=3.8
Formula:
Q(c − cin) = −VR(c)
R(C)=k*c/c+v
Solution:
We use MATLAB code to solve this problem
MATLAB Script
Function file:
function y=cstr1_a(t,c)
Q=50;% flow rate
cin=2;%concentration in
V=2000;%total volume
k=0.198;%rate constnt
v=3.8;%velocity
y=-V*(k*c)/(c+v)-Q*(c-cin);
end

Call file:

c=1; %initial guess


tspan=[0 1];
[t,xc]=ode45(@cstr1_b,tspan,c);

5
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

plot(t,xc)
xlabel('time')
ylabel('concentration')
title('time vs concentration')

Conclusion:
Results will be displayed on execution of the code

Fig: 1.3: graph between time and concentration

Part b:
Given Data:
Volumetric flow rate=Q=2.2
Total volume=V=50
Concentration at inlet=Cin=1
Rate constant=k=2
Rate constant=K1=4

Formula:
R(C)=k*c/(1+K1c)2
Solution:
We use MATLAB code to solve the problem

6
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

MATLAB Script
Function file:
function y=cstr1_b(t,v)
Q=2.2;
cin=1;
V=50;
k1=4;
k=2;
y=-V*(k*c)/(1+k1*c)^2-Q*(c-cin);
end

Call file:
c=2; %initial guess
tspan=[0 1]
[t,xc]=ode45(@cstr1_a,tspan,c)
plot(t,xc)
xlabel('time')
ylabel('concentration')
title('time vs concentration')

Conclusion:
Results will be displayed on execution of the MATLAB code

7
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

Fig: 1.4: graph between time vs concentration

8
Assignmnet#4 Summiya Iftikhar Hafsa Afzal
(2015-pe-08) (2015-pe-10)

You might also like