summaryrefslogtreecommitdiff
path: root/1709/CH11/EX11.8/11_8.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1709/CH11/EX11.8/11_8.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 '1709/CH11/EX11.8/11_8.sce')
-rwxr-xr-x1709/CH11/EX11.8/11_8.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/1709/CH11/EX11.8/11_8.sce b/1709/CH11/EX11.8/11_8.sce
new file mode 100755
index 000000000..39fe1e0e3
--- /dev/null
+++ b/1709/CH11/EX11.8/11_8.sce
@@ -0,0 +1,16 @@
+clc
+//Initialization of variables
+Kp=15.63
+y=Kp
+//calculations
+x=poly(0,"x")
+vec=roots(x^2 + y*x^2 - y)
+eps=vec(1)
+x1=(1-eps)/(1+eps)
+x2=eps/(1+eps)
+x3=eps/(1+eps)
+//results
+printf(" Equilibrium concentration of Cs = %.4f ",x1)
+printf("\n Equilibrium concentration of Cs+ = %.4f ",x2)
+printf("\n Equilibrium concentration of e- = %.4f ",x3)
+//the answers are a bit different due to approximation in textbook