Setting values of the acid ionization , the base ionization , the water auto-ionization , the initial molarity of acid ), the initial molarity of base ), the initial volume of acid ), the initial volume of base ), and the final volume of mixture ):
()
K
a
()
K
b
()
K
w
(
C
a
(
C
b
(
V
a
(
V
b
(
V
f
Ka=6.610^-4;Kb=1.810^-5;Va=100;Vb=100;Vf=Va+Vb;Ca=.1;Cb=.1;Kw=10^-14;
Note =+ is only a [good] approximation. Also, for the sake of simplicity, I assume only monoprotic cases.
V
f
V
a
V
b
In[]:=
sol=NSolve[{ha/ha==Ka,ohbh/b==Kb,hoh==Kw,ha+a==VaCa/Vf,b+bh==VbCb/Vf,h+bh==oh+a,h>0,oh>0,ha>0,a>0,b>0,bh>0},{h,oh,ha,a,b,bh},Reals]
Out[]=
{{ha0.0000455398,b0.0000461249,a0.0499545,bh0.0499539,oh1.66203×,h6.01674×}}
-8
10
-7
10
The above equations in NSolve, are, in order, as follows:==[][]=[]+[HA]=/[]+[B]=/[]+[]=[]+[]and of course, all concentrations should be positive.
[][]
+
H
-
A
[HA]
K
a
[][]
-
OH
+
HB
[B]
K
b
+
H
-
OH
K
w
-
A
C
a
V
a
V
f
+
BH
C
b
V
b
V
f
-
A
-
OH
+
BH
+
H
Find pH:
In[]:=
-Log10[h]/.sol
Out[]=
{6.22064}