summaryrefslogtreecommitdiff
path: root/1709/CH11/EX11.8/11_8.sce
blob: 39fe1e0e3f7777847f825f800c52f9af5186fde4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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