summaryrefslogtreecommitdiff
path: root/249/CH3/EX3.2
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /249/CH3/EX3.2
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '249/CH3/EX3.2')
-rwxr-xr-x249/CH3/EX3.2/3_02.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/249/CH3/EX3.2/3_02.sce b/249/CH3/EX3.2/3_02.sce
new file mode 100755
index 000000000..a2a1ef1b6
--- /dev/null
+++ b/249/CH3/EX3.2/3_02.sce
@@ -0,0 +1,26 @@
+clear
+clc
+CA=[10;8;6;5;3;2;1];//mol/litre
+T=[0;20;40;60;120;180;300];//sec
+//plot(T,CA)
+//xlabel('Time(sec)');ylabel('CA(mol/litre)');
+//From graph y=-dCA/dt at different points are
+y=[-0.1333;-0.1031;-0.0658;-0.0410;-0.0238;-0.0108;-0.0065];
+//Guessing nth rate order
+//rA=kCA^n
+//log(-dCA/dt)=logk+nlogCA
+for i=1:7
+log_y(i)=log10(y(i));
+log_CA(i)=log10(CA(i));
+end
+plot(log_CA,log_y)
+xlabel('logCA');ylabel('log(-dCA/dt)')
+coeff1=regress(log_CA,log_y);
+n=coeff1(2);
+k=-10^(coeff1(1));
+printf("\n After doing linear regression,the slope and intercept of the graph is %f , %f",coeff(2),coeff(1))
+printf("\n The rate equation is therefore given by %f",k)
+printf("CA^1.375 mol/litre.sec")
+disp('The answer slightly differs from those given in book as regress fn is used for calculating slope and intercept')
+
+