summaryrefslogtreecommitdiff
path: root/249/CH18/EX18.5/18_05.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /249/CH18/EX18.5/18_05.sce
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/CH18/EX18.5/18_05.sce')
-rwxr-xr-x249/CH18/EX18.5/18_05.sce37
1 files changed, 37 insertions, 0 deletions
diff --git a/249/CH18/EX18.5/18_05.sce b/249/CH18/EX18.5/18_05.sce
new file mode 100755
index 000000000..deab73fbb
--- /dev/null
+++ b/249/CH18/EX18.5/18_05.sce
@@ -0,0 +1,37 @@
+clear
+clc
+CAo=0.1;
+eA=3;
+rA=[3.4;5.4;7.6;9.1];
+CA=[0.039;0.0575;0.075;0.092];
+XA=zeros(4,1);
+inv_rA=zeros(4,1);
+for i=1:4
+XA(i)=(1-CA(i)/CAo)/(1+eA*CA(i)/CAo);
+inv_rA(i)=1/rA(i);
+end
+//W=FAo*integral(dXA/-rA) from 0 to 0.35
+//Using Trapezoidal rule to find area,XA must be in increasing order
+//Sorting XA and accordingly inv_rA
+for i=1:4
+ small=XA(i);
+ for j=i:4
+ next=XA(j);
+ if small>next
+ temp=XA(i);
+ XA(i)=XA(j);
+ XA(j)=temp;
+ temp1=inv_rA(i);
+ inv_rA(i)=inv_rA(j);
+ inv_rA(j)=temp1;
+ end
+ end
+end
+plot(XA,inv_rA)
+xlabel('XA');ylabel('-1/rA');
+//extending points to include XA=0.35
+XA(5)=0.35;inv_rA(5)=0.34;
+Area=inttrap(XA,inv_rA);
+W=Area*2000;
+printf("Amount of catalyst needed(kg) is %f",W)
+disp('The answer slightly differs from those given in book as trapezoidal rule is used for calculating area')