V
b
V
a
C
a
1+[]
+
H
K
a
+
H
K
w
[]
+
H
C
b
1+[]
K
w
+
H
K
b
+
H
K
w
[]
+
H
In[]:=
(*Setupparameters*)
In[]:=
Ca=0.1;
In[]:=
Cb=0.1;
In[]:=
Ka=1.75*10^-5;
In[]:=
Kb=0.63;
In[]:=
Kw=1.00*10^-14;
In[]:=
Va=10;
In[]:=
(*Definefunctions*)
In[]:=
H[pH_]:=10^-pH
In[]:=
(*Ka[pKa_]:=10^-pKa*)
In[]:=
Vb[pH_,Ca_,Cb_,Ka_,Kb_,Kw_,Va_]:=Va*((Ca/(1+H[pH]/Ka))-H[pH]+Kw/H[pH])/((Cb/(1+Kw/(H[pH]*Kb)))+H[pH]-Kw/H[pH])
In[]:=
(*Vb[pH_,Ca_,Cb_,pKa_,Kb_,Kw_,Va_]:=Va*((Ca/(1+H[pH]/Ka[pKa]))-H[pH]+Kw/H[pH])/((Cb/(1+Kw/(H[pH]*Kb)))+H[pH]-Kw/H[pH])*)
In[]:=
Vb[11.9]
Out[]=
11.8865
In[]:=
Vb[8.4]
Out[]=
9.99827
In[]:=
Vb[8.2]
Out[]=
9.99674
In[]:=
(*ChangeCbfrom0.1to0.2*)
In[]:=
Vb[11.9,0.1,0.2,1.75*10^-5,0.63,1.*^-14,10]
Out[]=
5.69422
In[]:=
Table[{x,Vb[x]},{x,3,12.5,0.2}]
Out[]=
{{3.,0.0712774},{3.2,0.205479},{3.4,0.379748},{3.6,0.624624},{3.8,0.976981},{4.,1.47788},{4.2,2.16366},{4.4,3.04834},{4.6,4.10262},{4.8,5.24513},{5.,6.362},{5.2,7.34889},{5.4,8.14599},{5.6,8.74433},{5.8,9.16925},{6.,9.45927},{6.2,9.65188},{6.4,9.7775},{6.6,9.85845},{6.8,9.91023},{7.,9.94318},{7.2,9.9641},{7.4,9.97735},{7.6,9.98575},{7.8,9.99108},{8.,9.9945},{8.2,9.99674},{8.4,9.99827},{8.6,9.99942},{8.8,10.0005},{9.,10.0016},{9.2,10.0031},{9.4,10.0052},{9.6,10.0085},{9.8,10.0135},{10.,10.0216},{10.2,10.0342},{10.4,10.0544},{10.6,10.0863},{10.8,10.1372},{11.,10.2184},{11.2,10.3485},{11.4,10.5583},{11.6,10.9005},{11.8,11.4683},{12.,12.4382},{12.2,14.1803},{12.4,17.6107}}
In[]:=
Plot[Vb[pH,0.1,0.2,1.75*10^-5,0.63,1.*^-14,10],{pH,3,12.5}]
Out[]=
In[]:=
Manipulate[Vb[pH,Ca,Cb,Ka,Kb,Kw,Va],{pH,3,12.5},{Ca,0.01,0.1},{Cb,0.05,0.15},{Ka,1.0*10^-5,2.5*10^-5},{Kb,0,1},{Kw,10^-14,10^-14},{Va,5,50}];
In[]:=
Out[]=

