Você está na página 1de 3

Table of results

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Time
(minutes)

Concentration of A
(mol/ft^3)

Concentration of B
(mol/ft^3)

Temperature
(oF)

0
1
3
5
7
9
12
15
17
20
23
26
29
32
35
37
40
43
46
49

0.0165
0.0147
0.0171
0.0193
0.0212
0.0226
0.0237
0.0244
0.0249
0.0252
0.0254
0.0255
0.0256
0.0256
0.0256
0.0256
0.0256
0.0256
0.0257
0.0256

2.367
2.343
2.291
2.248
2.216
2.192
2.176
2.165
2.159
2.155
2.152
2.151
2.150
2.150
2.149
2.149
2.149
2.149
2.149
2.149

150.0
148.6
146.1
144.1
142.6
141.5
140.8
140.3
140.0
139.8
139.7
139.6
139.6
139.6
139.6
139.5
139.5
139.5
139.5
139.5

Matlab Code
Function File
% This function set up the initial conidtions of the cstr and can be called
% and used for further use and design of control and difference
% disturbances in the model.
%
% Prepared by Julian Montoya Zapata
function dy=cstr1(t,y)

% Parameters:
% Volumetric Flowrate (ft^3/sec)
q1 = 2.40626;
% Volume of CSTR (ft^3)
V = 100*0.133680556;
% Temperature of the inlet in Farenheigh
T1 = 115;
% Density of A-B Mixture (lb_mass/ft^3)
rho = 52;
% Concentration of A (mol/ft^3)

Ca1 = 1.1;
% Heat capacity of A-B Mixture (BTU/deg in farenheight*lb(mass))
C = 0.8;
% Heat of reaction for A->2B (BTU/mol)
Hrxn = -950;
% E - Activation energy in the Arrhenius Equation (J/mol)
% R - Universal Gas Constant = 8.31451 J/mol-K
a = 22500;
% Pre-exponential factor (1/sec)
k0 = 1.5e17;
dy = zeros (3,1);
dy(1) = ((q1/V)*Ca1) - ((q1/V)*y(1)) -(y(1)*k0*exp((-a)/(y(3)+460)));
dy(2) = (2*y(1)*k0*exp((-a)/(y(3)+460)))- ((q1/V)*y(2));
dy(3) = ((q1/V)*T1)-((q1/V)*y(3))-((y(1)*Hrxn*k0*exp((a)/(y(3)+460)))/(rho*C));

Main Code
%
%
%
%
%
%
%
%
%

The steady state conditions for the CSTR and other process using the
parameters of the maine fuction. Suppose a switch is made to a new feed
stream for reactant A with a concentration of 1.1 mol/ft3 and a
temperature of 115oF at a flow rate of 18 gal/min. Determine the effluent
stream concentrations for reactant A and product B as well as the CSTR
temperature as a function of time. Tabulate and plot the results.
The table should have a maximum of 15 to 20 rows of data at regular
intervals showing the solution from the initial time to the new
steady-state

% Initial Conditions
Ca = 0.01738;
cbo = 2.446;
To = 150;
% Solving for the differential equations
[t,y] = ode45(@cstr1,[0 50],[ Ca, cbo, To]);
% Ploting Results
% Plot for the Concentration of A
subplot(3,1,1), plot(t,y(:,1),'LineWidth', 2); grid on
xlabel('Time(mins)');
ylabel('Concentration of A');
% Plot for the Concentration of B
subplot(3,1,2), plot(t,y(:,2),'LineWidth', 2); grid on
xlabel('Time(mins)');
ylabel('Concentration of B');
% Plot for the time of the reaction
subplot(3,1,3), plot(t,y(:,3),'LineWidth', 2); grid on
xlabel('Time(mins)');
ylabel('Temperature of Reaction(F)');
% Estimation for diving get 20 results
i = length(y(:,1));
% Getting the results to organize a table
Time = t((1:26:512),1);
ConA = y((1:26:512),1);
ConB = y((1:26:512),2);

Temp = y((1:26:512),3);
% Printing the results
fprintf('
\n');
fprintf('
Time
Temperature \n')
fprintf('
(minutes)
\n')
n=1;

Table of Results
Concentration of A
(mol/ft^3)

for(n=1:length(Time));
fprintf('
%2.0f
%2.4f
%3.1f
\n',Time(n),ConA(n),ConB(n),Temp(n));
n=n+1;
end

Cocentration of B
(mol/ft^3)

%2.3f

(oF)

Você também pode gostar