Professional Documents
Culture Documents
By:
Shubham Mittal
14001005052
Chemical Engg.
8th Semester
Batch:2014-18
CONTENTS
EXPERIMENT NO-1
ISOTHERMAL CSTR
PROGRAMME
function Ca_dot = cstr(t,Ca,Ca_in)
q=1;
v=1;
k1=1;
Ca_dot = (q/v*(Ca_in-Ca))-k1*Ca;
PROGRAMME
function xdot=cstr1(t,x)
global u
% Input (1):
% Temperature of cooling jacket (K)
Tc = u;
% States (2):
% Concentration of A in CSTR (mol/m^3)
Ca = x(1,1);
% Temperature in CSTR (K)
T = x(2,1);
% Parameters:
% Volumetric Flowrate (m^3/sec)
q = 100;
% Volume of CSTR (m^3)
V = 100;
% Density of A-B Mixture (kg/m^3)
rho = 1000;
% Heat capacity of A-B Mixture (J/kg-K)
Cp = .239;
% Heat of reaction for A->B (J/mol)
mdelH = 5e4;
% E - Activation energy in the Arrhenius Equation (J/mol)
% R - Universal Gas Constant = 8.31451 J/mol-K
EoverR = 8750;
% Pre-exponential factor (1/sec)
k0 = 7.2e10;
% U - Overall Heat Transfer Coefficient (W/m^2-K)
% A - Area - this value is specific for the U calculation (m^2)
UA = 5e4;
% Feed Concentration (mol/m^3)
Caf = 1;
% Feed Temperature (K)
Tf = 350;
% Compute xdot:
xdot(1,1) = (q/V*(Caf - Ca) - k0*exp(-EoverR/T)*Ca);
xdot(2,1) = (q/V*(Tf - T) + mdelH/(rho*Cp)*k0*exp(-EoverR/T)*Ca +
UA/V/rho/Cp*(Tc-T));
% Step test for Model 1 - CSTR
global u
% Steady State Initial Conditions for the States
Ca_ss = 0.87725294608097;
T_ss = 324.475443431599;
x_ss = [Ca_ss;T_ss];
% Steady State Initial Condition for the Control
u_ss = 300;
% Open Loop Step Change
u = 290;
% Final Time (sec)
tf = 5;
[t,x] = ode15s('cstr1',[0 tf],x_ss);
% Parse out the state values
Ca = x(:,1);
T = x(:,2);
figure(2)
plot(t,T,'g');
EXPERIMENT NO-
BATCH REACTOR
PROGRAM
function dC=Batch(t,C)
%%
k1 = 1.5;
k2 = 1;
k3=1;
k4=0.7;
dC=zeros(4,1);
PROGRAMME
function RungaKuttaMethod
%example of Runga-Kutta method of order 4.
%y* = y - t^2 + 1.
a = 0;
b = 4;
h = 0.1;
N=(b-a)/h;
t = zeros(1, N);
y = zeros(1, N);
y(1) = 0.5;
t(1) = a;
F = @(t,y) y - t^2 +1;
for i = 1:(N-1)
K1 = h*(F(t(i), y(i)));
K2 = h*(F(t(i)+0.5*h, y(i)+0.5*K1));
K3 = h*(F(t(i)+ 0.5*h, y(i)+ 0.5*K2));
K4 = h*(F(t(i) + h, y(i)+K3));
y(i+1) = y(i) + (K1 + 2*K2 + 2*K3 +K4)/6;
t(i+1) = a + i*h;
end
plot(t,y, 'r')
EXPERIMENT NO-