-
Notifications
You must be signed in to change notification settings - Fork 0
/
carbonate_chemistry_equations.html
411 lines (382 loc) · 19.4 KB
/
carbonate_chemistry_equations.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Carbonate Chemistry Equations • microbialkitchen</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.4.0/simplex/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.4.1/js/bootstrap.min.js" integrity="sha256-nuL8/2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL+1ev4=" crossorigin="anonymous"></script><!-- bootstrap-toc --><link rel="stylesheet" href="../bootstrap-toc.css">
<script src="../bootstrap-toc.js"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css" integrity="sha256-mmgLkCYLUQbXn0B1SRqzHar6dCnv9oZFPEC1g1cwlkk=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/v4-shims.min.css" integrity="sha256-wZjR52fzng1pJHwx4aV2AO3yyTOXrcDW7jBpJtTwVxw=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><!-- headroom.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/headroom.min.js" integrity="sha256-AsUX4SJE1+yuDu5+mAVzJbuYNPHj/WroHuZ8Ir/CkE0=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/headroom/0.11.0/jQuery.headroom.min.js" integrity="sha256-ZX/yNShbjqsohH1k95liqY9Gd8uOiE1S4vZc+9KQ1K4=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Carbonate Chemistry Equations">
<meta property="og:description" content="microbialkitchen">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--><!-- Global site tag (gtag.js) - Google Analytics --><script async src="https://www.googletagmanager.com/gtag/js?id=UA-106138361-4"></script><script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-106138361-4');
</script>
</head>
<body data-spy="scroll" data-target="#toc">
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">microbialkitchen</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.4.3</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="../reference/index.html">Reference</a>
</li>
<li>
<a href="../articles/quantities.html">Quantities</a>
</li>
<li>
<a href="../articles/operations.html">Operations</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Carbonate Buffering
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/carbonate_chemistry_equations.html">Equations</a>
</li>
<li>
<a href="../articles/carbonate_chemistry_examples.html">Examples</a>
</li>
</ul>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/kopflab/microbialkitchen" class="external-link">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1 data-toc-skip>Carbonate Chemistry Equations</h1>
<h4 data-toc-skip class="date">2023-07-29</h4>
<small class="dont-index">Source: <a href="https://github.com/kopflab/microbialkitchen/blob/HEAD/vignettes/carbonate_chemistry_equations.Rmd" class="external-link"><code>vignettes/carbonate_chemistry_equations.Rmd</code></a></small>
<div class="hidden name"><code>carbonate_chemistry_equations.Rmd</code></div>
</div>
<p>This vignette describes the conceptual approach to carbonate
chemistry. See the <a href="carbonate_chemistry_examples.html">carbonate
chemistry examples vignette</a> for code examples using the relevant
functionality. For recommended primary literature on carbonate
chemistry, see <strong>CO2 in Seawater: Equilibrium, Kinetics, Isotopes.
Zeebe & Wolf-Gladrow, 2001</strong>.</p>
<div class="section level2">
<h2 id="co_2-solubility">CO<span class="math inline">\(_2\)</span> solubility<a class="anchor" aria-label="anchor" href="#co_2-solubility"></a>
</h2>
<blockquote>
<p>Key functions: <code>calculate_gas_solubility</code></p>
</blockquote>
<p><a href="carbonate_chemistry_examples.html#co2-solubility">See
examples</a>.</p>
<p>CO2 is slightly soluable in water with a Henry’s law solubility
constant of <span class="math inline">\(K_H^{cp} = 3.3 \cdot 10^{-4}
\frac{mol}{m^3 Pa} = 0.033 \frac{M}{bar}\)</span> at <span class="math inline">\(T^\theta = 298.15 K\)</span> (25C). Henry’s law
constants are typically more temperature sensitive than acid
dissociation constants so it’s worthwhile taking them into
consideration. The temperature dependence constant is <span class="math inline">\(\frac{d \ln{H^{cp}}}{d(1/T)} = 2400 K\)</span>
(Sander, 2015), which yields the following relationship:</p>
<p><span class="math display">\[
K_H(T) = K_H (T^0) \cdot e^{2400 K \cdot \left( \frac{1}{T} -
\frac{1}{T^0} \right)}
\]</span></p>
</div>
<div class="section level2">
<h2 id="speciation">Speciation<a class="anchor" aria-label="anchor" href="#speciation"></a>
</h2>
<blockquote>
<p>Key functions: <code>calculate_DIC</code>,
<code>calculate_carbonic_acid</code>,
<code>calculate_bicarbonate</code>,
<code>calculate_carbonate</code>.</p>
</blockquote>
<p><a href="carbonate_chemistry_examples.html#speciation">See
examples</a>.</p>
<p>The carbonate system has a couple of general equilibrium equations
that constrain species distribution in aquatic systems at equilibrium.
Note that the dissociation constants are also affected by physical
parameters (temperature and pressure), which is not discussed further
here.</p>
<p><span class="math display">\[
\begin{aligned}
\textrm{dissociation of carbonic acid: } &
H_2CO_3^* \rightleftharpoons H^+ + HCO_3^- \\
&\textrm{with dissociation constant }
\frac{[H^+][HCO_3^-]}{[H_2CO_3^*]} = K_1 = 10^{-6.3} \\
\textrm{dissociation of bicarbonate: } &
HCO_3^- \rightleftharpoons H^+ + CO_3^{2-} \\
&\textrm{with dissociation constant }
\frac{[H^+][CO_3^{2-}]}{[HCO_3^-]} = K_2 = 10^{-10.3} \\
\textrm{water dissociation: } &
H_2O \rightleftharpoons H^+ + OH^- \\
&\textrm{with dissociation constant } [H^+][OH^-] = K_w = 10^{-14}
\\
\textrm{dissolved inorganic carbon (DIC): } &
[DIC] = [H_2CO_3^*] + [HCO3^-] + [CO_3^{2-}] \\
&[DIC] = [H_2CO_3^*] \left( 1 + \frac{K_1}{[H^+]} + \frac{K_1
K_2}{[H^+]^2} \right) \rightarrow [H_2CO_3^*] =
\frac{[DIC]\cdot[H^+]^2}{[H^+]^2 + K_1 [H^+] + K_1 K_2} \\
&[DIC] = [HCO_3^-] \left( \frac{[H^+]}{K_1} + 1 + \frac{K_2}{[H^+]}
\right) \rightarrow [HCO_3^-] = \frac{[DIC]\cdot K_1 [H^+]}{[H^+]^2 +
K_1 [H^+] + K_1 K_2} \\
&[DIC] = [CO_3^{2-}] \left( \frac{[H^+]^2}{K_1 K_2} +
\frac{[H^+]}{K_2} + 1 \right) \rightarrow [HCO_3^-] = \frac{[DIC]\cdot
K_1 K_2}{[H^+]^2 + K_1 [H^+] + K_1 K_2} \\
\textrm{charge balance (carbonate system only): } &
[H^+] - [HCO_3^-] - 2\cdot[CO_3^{2-}] - [OH^-] = 0 \\
\textrm{charge balance (alkalinity): } &
TA = [HCO_3^-] + 2\cdot[CO_3^{2-}] + [OH^-] - [H^+] \\
&\hskip{1.5em} = \sum_i (\textrm{charge} \times \textrm{ion})_i =
[Na^+] + 2 \cdot [Mg^{2+}] + \,...\, - [Cl^-] - 2\cdot [SO_4^{2-}]-
\,... \\
\end{aligned}
\]</span></p>
<p>with <span class="math inline">\([H_2CO_3^*]\)</span> technically
comprising both dissolved CO<span class="math inline">\(_2\)</span> as
well as hydrated carbonic acid (the dissolved CO<span class="math inline">\(_2\)</span> is actually much more abundant with
only a small amount of carbonic acid - hydration is typically the
kinetically slowest step of CO<span class="math inline">\(_2\)</span>
dissolution). Dissociation constants are typically expressed in relation
to this equilibrium mixture <span class="math inline">\([H_2CO_3^*]\)</span> although technically only the
carbonic acid participates in the reaction directly. For aqueous system
at equilibrium with the gas phase (such as both the open and closed
systems discussed below), this pool can also be expressed relative to
the pressure of CO<span class="math inline">\(_2\)</span> using the
solubility discussed above.</p>
<p><span class="math display">\[
\begin{aligned}
\left[H_2CO_3^*\right] &= [CO_2 (aq)] + [H_2CO_3] = K_H \cdot
P_{CO_2} \\
\rightarrow DIC &= [H_2CO_3^*] + [HCO_3^-] + [CO_3^{2-}] \\
&= [H_2CO_3^*] \left(1 + \frac{K_1}{[H^+]} + \frac{K_1 K_2}{[H^+]^2}
\right) \\
&= K_H \cdot P_{CO_2} \left(1 + \frac{K_1}{[H^+]} + \frac{K_1
K_2}{[H^+]^2} \right)
\end{aligned}
\]</span></p>
</div>
<div class="section level2">
<h2 id="open-system">Open system<a class="anchor" aria-label="anchor" href="#open-system"></a>
</h2>
<blockquote>
<p>Key functions: <code>calculate_open_system_pH</code>,
<code>calculate_open_system_alkalinity</code></p>
</blockquote>
<p><a href="carbonate_chemistry_examples.html#open-system">See
examples</a>.</p>
<p>In an open system, there is an infinite reservoir of CO<span class="math inline">\(_2\)</span> available (e.g. from the atmosphere)
whose CO<span class="math inline">\(_2\)</span> concentration will NOT
change in response to exchange with the aqueous system.</p>
<div class="section level3">
<h3 id="co_2-only">CO<span class="math inline">\(_2\)</span> only<a class="anchor" aria-label="anchor" href="#co_2-only"></a>
</h3>
<p>Alkalinity (charge balance):</p>
<p><span class="math display">\[
[HCO_3^-] + 2\cdot[CO_3^{2-}] + [OH^-] - [H^+] = 0
\]</span></p>
<p>Overall polynomial to find pH:</p>
<p><span class="math display">\[
[H^+] - \frac{K_1 H \cdot P_{CO_2}}{[H^+]} - 2 \frac{K_1 K_2 K_H \cdot
P_{CO_2}}{[H^+]^2} - \frac{K_w }{[H^+]} = 0
\]</span></p>
</div>
<div class="section level3">
<h3 id="adjusting-ph-with-alkalinity">Adjusting pH with alkalinity<a class="anchor" aria-label="anchor" href="#adjusting-ph-with-alkalinity"></a>
</h3>
<p>A common scenario (especially in the lab) is that there are
additional sources of alkalinity in the system (a net difference in the
conservative cations and anions from the addition of bases/acids).
Conservative ions are those that do NOT get affected by changes in pH in
the pH range of interest (i.e. do not form any acids or bases or have
pKas far outside the pH range of interest). E.g. Na<span class="math inline">\(^+\)</span> that is added in the form of sodium
hydroxide (NaOH), sodium bicarbonte (NaHCO<span class="math inline">\(_3\)</span>), Cl<span class="math inline">\(^-\)</span> that is added as hydrochloric acid
(HCl) or SO<span class="math inline">\(_4^{2-}\)</span> added as
sulfuric acid (H<span class="math inline">\(_2\)</span>SO<span class="math inline">\(_4\)</span>). Ions from salts that are comprised
exclusively of conservative ions (e.g. NaCl, MgSO<span class="math inline">\(_4\)</span>) do not need to be included in the
alkalinity. Here we consider a scenario where NaOH or NaHCO<span class="math inline">\(_3\)</span> (same outcome) and HCl are the only
bases/acid used to adjust alkalinity.</p>
<p>Alkalinity (charge balance) becomes:</p>
<p><span class="math display">\[
[HCO_3^-] + 2\cdot[CO_3^{2-}] + [OH^-] - [H^+] = \sum_i (\textrm{charge}
\times \textrm{ion})_i = [Na^+] + [Cl^-]
\]</span></p>
<p>This yields the overall polynomial to find pH:</p>
<p><span class="math display">\[
[H^+] + [Na^+] - [Cl^-] - \frac{K_1 K_H \cdot P_{CO_2}}{[H^+]} - 2
\frac{K_1 K_2 K_H \cdot P_{CO_2}}{[H^+]^2} - \frac{K_w }{[H^+]} = 0
\]</span></p>
<p>Or in terms of the alkalinity / conservative ions Na<span class="math inline">\(^+\)</span> and Cl<span class="math inline">\(^-\)</span> (i.e. the net amount of sodium
bicarbonate / NaOH or HCl to add):</p>
<p><span class="math display">\[
\begin{align}
[Na^+] - [Cl^-] &= \frac{2\cdot K_1 K_2 K_H \cdot
P_{CO_2}}{[H^+]^2} + \frac{K_1 K_H \cdot P_{CO_2} + K_w}{[H^+]} - [H^+]
\\
&= K_H \cdot P_{CO_2} \left( 2 \cdot 10^{2 pH - pK_{a1} - pK_{a2}} +
10^{pH - pK_{a1}} \right) + 10^{pH - pK_w} - 10^{-pH}
\end{align}
\]</span></p>
</div>
<div class="section level3">
<h3 id="adjusting-ph-with-a-buffer">Adjusting pH with a buffer<a class="anchor" aria-label="anchor" href="#adjusting-ph-with-a-buffer"></a>
</h3>
<p>The next more complex scenario is an additional weak acid or weak
base pH buffer (besides the carbonate system) such as citrate,
phosphate, MOPS, etc. Let’s take the example of a weak acid <span class="math inline">\([A]\)</span> (or sodium salt) that can dissociate
to <span class="math inline">\([A-]\)</span>, with dissociation constant
<span class="math inline">\(K_{a}\)</span>. The dissociated ion of the
new weak acid needs to be included on the left side of the alkalinity
but it is important to note that if it is provided as a salt, it will
also add to the right side (e.g. by increasing net Na<span class="math inline">\(^+\)</span> if it’s the buffer is a sodium
salt).</p>
<p>Alkalinity (charge balance) becomes:</p>
<p><span class="math display">\[
[HCO_3^-] + 2\cdot[CO_3^{2-}] + [OH^-] + [A^-] - [H^+] = \sum_i
(\textrm{charge} \times \textrm{ion})_i = [Na^+] + [Cl^-]
\]</span></p>
<p>This yields the overall polynomial to find pH:</p>
<p><span class="math display">\[
[H^+] + [Na^+] - [Cl^-] -
\frac{K_a \cdot [A_T]}{K_a+[H^+]} -
\frac{K_1 K_H \cdot P_{CO_2}}{[H^+]} -
2 \frac{K_1 K_2 K_H \cdot P_{CO_2}}{[H^+]^2} -
\frac{K_w}{[H^+]} = 0
\]</span></p>
<p>Or in terms of the alkalinity / conservative ions Na<span class="math inline">\(^+\)</span> and Cl<span class="math inline">\(^-\)</span></p>
<p><span class="math display">\[
\begin{align}
[Na^+] - [Cl^-] &= \frac{2\cdot K_1 K_2 K_H \cdot
P_{CO_2}}{[H^+]^2} + \frac{K_1 K_H \cdot P_{CO_2} + K_w}{[H^+]} - [H^+]
+ \frac{K_a \cdot [A_T]}{K_a+[H^+]} \\
&= K_H \cdot P_{CO_2} \left( 2 \cdot 10^{2 pH - pK_{a1} - pK_{a2}} +
10^{pH - pK_{a1}} \right) + 10^{pH - pK_w} - 10^{-pH} + \frac{[A_T]}{1 +
10^{(pK_a-pH)}}
\end{align}
\]</span></p>
</div>
</div>
<div class="section level2">
<h2 id="closed-system">Closed system<a class="anchor" aria-label="anchor" href="#closed-system"></a>
</h2>
<blockquote>
<p>Key functions: <code>calculate_closed_system_pH</code>,
<code>calculate_closed_system_alkalinity</code>,
<code>calculate_closed_system_TIC</code>,
<code>calculate_closed_system_pCO2</code></p>
</blockquote>
<p><a href="carbonate_chemistry_examples.html#closed-system">See
examples</a>.</p>
<p>The above equations also hold for closed systems at equlibratium
except that mass balance constraints (total inorganic carbon =
<strong>TIC</strong>) must be taken into consideration for the gas phase
in addition to the liquid phase. This is rarely a relevant environmental
scenario but frequently applicable in laboratory settings.</p>
<p>Note: alkalinity is a conservative quantity so although TIC will
change with microbial production and consumption, the alkalinity will
stay the same as long as there is no mineral precipitation.</p>
<div class="section level3">
<h3 id="limited-volume-vessel">Limited volume vessel<a class="anchor" aria-label="anchor" href="#limited-volume-vessel"></a>
</h3>
<p>Note: this is a typical culturing scenario - certain amount of
headspace and liquid with an initial infusion of CO<span class="math inline">\(_2\)</span> that gets equilibrated in the vessel.
Note that at relatively high partial pressures and/or large headspaces,
this scenario is well approximated by the open system solutions. The
charge balance / alkalinity constraints remain the same as in the open
system:</p>
<p><span class="math display">\[
[H^+] + [Na^+] - [Cl^-] -
\frac{K_a \cdot [A_T]}{K_a+[H^+]} -
\frac{K_1 K_H \cdot P_{CO_2}}{[H^+]} -
2 \frac{K_1 K_2 K_H \cdot P_{CO_2}}{[H^+]^2} -
\frac{K_w}{[H^+]} = 0
\]</span></p>
<p>However, the mass balance (based on total moles of carbon in the
system) provides an additional constraint on the system:</p>
<p><span class="math display">\[
\begin{align}
C_{T} &= n_{CO_2(g)} + V_{liquid} \cdot DIC \\
DIC &= [H_2CO_3^*] + [HCO_3^-] + [CO_3^{2-}] = K_H \cdot P_{CO_2}
\left(1 + \frac{K_1}{[H^+]} + \frac{K_1 K_2}{[H^+]^2} \right) \\
n_{CO_2(g)} &= \frac{P_{CO_2} \cdot V_{gas}}{RT} \\
C_{T} &= P_{CO_2} \cdot \left[\frac{V_G}{RT} + V_L \cdot K_H \left(
1 + \frac{K_1}{[H^+]} + \frac{K_1 K_2}{[H^+]^2} \right) \right] \\
\rightarrow P_{CO_2} &= \frac{C_{T}}{\frac{V_G}{RT} + V_L \cdot K_H
\left( 1 + \frac{K_1}{[H^+]} + \frac{K_1 K_2}{[H^+]^2} \right)} \\
&= \frac{C_{T}}{\frac{V_g}{RT} + V_L\cdot K_H\cdot\left(1 +
10^{(pH-pK_1)} + 10^{(2\cdot pH-pK_1-pK_2)}\right)}
\end{align}
\]</span></p>
<p>This leads to the overall polynomial for find pH (plug mass balance
into charge balance):</p>
<p><span class="math display">\[
\begin{align}
[H^+] + [Na^+] -
\frac{K_a}{K_a+[H^+]} \cdot [A_T] -
\frac{\frac{K_1}{[H^+]} + 2\frac{K_1 K_2}{[H^+]^2}}
{\frac{V_g}{K_H\cdot RT} + \left( 1 + \frac{K_1}{[H^+]} +
\frac{K_1 K_2}{[H^+]^2} \right) V_l} \cdot C_T -
\frac{K_w}{[H^+]} &= 0
\end{align}
\]</span></p>
<p>Or with all the pX parameters instead of X:</p>
<p><span class="math display">\[
10^{-pH}
+ [Na^+]
- \frac{1}{1 + 10^{(pK_a-pH)}}\cdot [A_T]
- \frac{10^{(pH-pK_1)} + 2\cdot 10^{(2\cdot pH-pK_1-pK_2)}}
{\frac{V_g}{K_H\cdot RT} + \left(1 + 10^{(pH-pK_1)} +
10^{(2\cdot pH-pK_1-pK_2)}\right) V_l}
\cdot C_T
- 10^{(pH-pK_w)} = 0
\]</span></p>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="pkgdown-sidebar">
<nav id="toc" data-toggle="toc"><h2 data-toc-skip>Contents</h2>
</nav>
</div>
</div>
<footer><div class="copyright">
<p></p>
<p>Developed by Sebastian Kopf.</p>
</div>
<div class="pkgdown">
<p></p>
<p>Site built with <a href="https://pkgdown.r-lib.org/" class="external-link">pkgdown</a> 2.0.7.</p>
</div>
</footer>
</div>
</body>
</html>