blob: 0f9eb6da2c25ea5a413cd87f9744ecb3be521a53 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
clear
clc
//Given
//Volumetric flow rates(litre/hr)
vo=[10;3;1.2;0.5];
//Concentrations (millimol/litre)
CA=[85.7;66.7;50;33.4];
CAo=100;
//Volume(litre)
V=0.1;
//For the stoichiometry 2A-->R
//Expansion factor is
e=(1-2)/2;
//Initialization
XA=zeros(4,1);
rA=zeros(4,1);
//Relation between concentration and conversion
for i=1:4
XA(i)=(1-CA(i)/CAo)/(1+e*CA(i)/CAo);
//Rate of reaction is given by
rA(i)=vo(i)*CAo*XA(i)/V;
//Testing nth order kinetics
//-rA=k*CA^n
//log(-rA)=logk+nlog(CA)
m(i)=log10(CA(i));
n(i)=log10(rA(i));
end
//For nth order plot between n & m should give a straight line
plot(m,n)
coefs=regress(m,n);
printf("Intercept of the graph is %f\n",coefs(1))
printf("Slope of the graph is %f\n",coefs(2))
k=10^coefs(1)
n=coefs(2)
printf("\n Taking n=2,rate of equation(millimol/litre.hr) is %f",k)
printf("CA^2 \n")
disp('The sol slightly differ from that given in book because regress fn is used to calculate the slope')
|