Process Modeling and Simulation
Process Modeling and Simulation
Assignment - 1
MPDE - 2014-16
Sumbission - 20.02.2015
Sample Solution
clc
clear all
%-----------------------------------------------------------------------%A tank of N CSTR's are chosen for computation
%-----------------------------------------------------------------------%-----------------------------------------------------------------------%This problem is attempted to find number of tanks in series given a
%conversion of "90%"
%-----------------------------------------------------------------------%Initiation of constants
%-----------------------------------------------------------------------xa=0.9;%conversion of A (-) no unit
cao=354; % in mol/litre
k1=354*10-3; % inverse of minute
k2=k1/2;% inverse of minute
k=k1/k2;%Equilibrium constant of reactant "A" ; no unit
m=0; % mole ratio of "A" and "B" at first instant
ca=cao*(1-xa);%concentration of reactant "A"
cb=cao*(m+xa); %concentration of reactant "B"
ra=(k1*ca)-(k2*cb) %rate of reaction of reactant "A"
tibar=(cao-ca)/(-ra) %mean residence time in every reactor; N times for N tanks. page
rat=ca/cao;% ratio of concentration of A; also= conversion
nguess=10;% guess for number of tanks
%-----------------------------------------------------------------------%Calling of function to plot
%-----------------------------------------------------------------------[T,C]=ode15s(@tankin func,[0 100],[354 0 0]);
%-----------------------------------------------------------------------%Actual plotting command
%-----------------------------------------------------------------------subplot(2,2,1)
plot(T,C(:,1))
title('Plot of concentration versus time for "A" ')
xlabel('time')
ylabel('conc of "A"')
subplot(2,2,2)
plot(T,C(:,2))
title('Plot of concentration versus time for "B" ')
xlabel('time')
ylabel('conc of "B"')
subplot(2,2,3)
plot(T,C(:,3))
title('Plot of concentration versus time for "C" ')
xlabel('time')
ylabel('conc of "C"')
%-----------------------------------------------------------------------Nre=fzero(@(N) (1-xa)-((1+k*tibar)/N)-N,nguess)
%this variable displays output of number tanks
totresidence=Nre*tibar
%this variable shows the total residence time in N reactors
%------------------------------------------------------------------------
MPDE - 2014-16
Sumbission - 20.02.2015