diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /858/CH7/EX7.12 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '858/CH7/EX7.12')
-rwxr-xr-x | 858/CH7/EX7.12/example_12.sce | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/858/CH7/EX7.12/example_12.sce b/858/CH7/EX7.12/example_12.sce new file mode 100755 index 000000000..1cc918120 --- /dev/null +++ b/858/CH7/EX7.12/example_12.sce @@ -0,0 +1,21 @@ +clc
+clear
+printf("example 7.11 page number 316\n\n")
+
+//to find the initial conc of A and B
+Cp = 0.02;
+Cq = 0.02;
+K = 4*10^-2;
+Cb = 0.05;
+Cb_i = Cb+Cp;
+a = (Cp*Cq)/(K*Cb);
+funcprot(0)
+function[f] = F(x,a)
+ f = x-0.02-a;
+endfunction
+
+//initial guess
+x = 10;
+y = fsolve(x,F);
+printf("conc of A= %f mol/l",y)
+printf("\n\nconc of B= %f mol/l",Cb_i)
|