Setting values of the acid ionization
(
K
a
)
, the base ionization
(
K
b
)
, the water auto-ionization
(
K
w
)
, the initial molarity of acid
(
C
a
), the initial molarity of base
(
C
b
), the initial volume of acid
(
V
a
), the initial volume of base
(
V
b
), and the final volume of mixture
(
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
V
f
=
V
a
+
V
b
is only a [good] approximation. Also, for the sake of simplicity, I assume only monoprotic cases.
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[]=
{{ha0.0000455398,b0.0000461249,a0.0499545,bh0.0499539,oh1.66203×
-8
10
,h6.01674×
-7
10
}}
The above equations in NSolve, are, in order, as follows:​
[
+
H
][
-
A
]
[HA]
=
K
a
​​
[
-
OH
][
+
HB
]
[B]
=
K
b
​​[
+
H
][
-
OH
]=
K
w
​​[
-
A
]+[HA]=
C
a
V
a
/
V
f
​​[
+
BH
]+[B]=
C
b
V
b
/
V
f
​​[
-
A
]+[
-
OH
]=[
+
BH
]+[
+
H
]
​and of course, all concentrations should be positive.
Find pH:
In[]:=
-Log10[h]/.sol
Out[]=
{6.22064}