Chemical Equilibrium
LMA – Law of Mass Action
Consider the chemical reaction between educts A, B and products C, D:
(1.1)  a A + b B ⟷ c C + d D 
with a, b, c, and d as the stoichiometric coefficients. The leftright arrow tells us that the reaction proceeds in both directions: forwards and backwards. It’s quite common to replace the leftright arrow with an equal sign.
When equilibrium is reached, the forward and the backward rates become equal, and the amount of educts and products obeys the fundamental law of mass action:
(1.2)  \(K \ = \ \dfrac{\{C\}^c\{D\}^d}{\{A\}^a\{B\}^b}\)  (Law of Mass Action) 
K is called the equilibrium constant. This law is so simple, yet universal and powerful. It describes aqueous speciation (including acidbase and redox reactions), solid phase and gas equilibria, ion exchange, surface complexation, and other phenomena. Thus, it’s not surprising that the massaction law forms the backbone of many approaches in hydrochemistry – including PhreeqC and aqion.
The ratio in 1.2 is often interpreted as a ratio of molar (mol/L) or molal (mol/kg) concentrations. This, however, only applies to infinitely diluted systems. In the case of real solutions, the concentrations should be replaced by activities. We emphasize this by using curly brackets {} for activities in 1.2, while square brackets [] are reserved for molar concentrations.
Equilibrium Constants
Our central quantity is the equilibrium constant K. Its value describes something like the degree of completeness of the reaction when equilibrium is established:
K  K  

1  0  ½ of the educts have changed into products (50 of the reaction is complete)  
10^{10}  10  reaction is very incomplete  
10^{10}  10  reaction is almost complete 
Since K varies over several orders of magnitude, it’s more convenient to work with the decadic logarithm of K rather than with K itself. Equation (1.2) then becomes:
(2.1)  lg K = c · lg {C} + d · lg {D} – a · lg {A} – b · lg {B} 
Note that outside the Englishspeaking world, the term “K” is used instead of K. Nevertheless, we will use K and K as synonyms.
Instead of K, the pK value is often used:
(2.2)  pK = – K 
which parallels the definition of pH as – {H^{+}}.
Simple Rules. The reaction formula in 1.1 determines the form of 1.2. Other reactions with more or with less educts and/or products lead to other formulas of K. Let’s consider the most simple reaction type A ⟷ B with K = {B}/{A} and what happens when we manipulate it:
(2.3a)  reaction  A ⟷ B  K  K  
(2.3b)  reverse reaction  B ⟷ A  1/K  – K  
(2.3c)  multiplication by 2  2 A ⟷ 2 B  K^{2}  2 K  
(2.3d)  division by 2  ½ A ⟷ ½ B  K^{½}  ½ K  
(2.3e)  twostep reaction  A ⟷ B (with K_{1})  K_{1} · K_{2}  K_{1} + K_{2}  
B ⟷ C (with K_{2}) 
Thermodynamic Data (log K Values)
Two things are necessary to perform an equilibrium calculation:
• the model:  LMA algorithm  (e.g. PhreeqC, aqion) 
• thermodynamic data:  lg K’s  (e.g. wateq4f^{1}) 
The role of the thermodynamic database cannot be overestimated. Models are empty shells unless thermodynamic data breathes life into them.
Today, dozens of hydrochemistry models/software exist. The vast majority of them are LMAbased and of high numerical accuracy. In other words, when using the same input solution and the same thermodynamic dataset the calculations will lead to exactly the same results. In reality, however, each model comes with its own thermodynamic database, so the same input solution will produce different results (i.e. speciation, saturation indices, etc.).
Model comparisons show that the cause for different results almost always lies in the differences between the thermodynamic databases used. The typical question, “Which model/software is used?” is incomplete. One should always ask additionally: “Which thermodynamic database is used?”
Inside the Database. The thermodynamic database^{2} comprises at least two items for each species: the reaction formula (stoichiometry) and the K value. Example: the 1^{st} dissociation step of sulfuric acid (at 25) is defined by the entry:
H+ + SO42 = HSO4
log_k 1.988
Note 1. The K value is only meaningful in context with the chemical reaction formula (1.1). For example, if you reverse the order in 1.1 to cC + dD ⟷ aA + bB, then K changes its sign from K to – K.
Note 2. The K is temperature dependent. The conversion of K from standard temperature (25) to other temperatures is described here.
Stoichiometric Coefficients
As we have learned above, the K value and the reaction formula are inseparable things. It’s a good idea to always put both together and write:
(3.1)  a A + b B ⟷ c C + d D  lg K 
This line contains three pieces of information:
 the stoichiometric coefficients (a, b, c, d)
 the names of the constituents (A, B, C, D)
 the equilibrium constant (in form of K)
To emphasize the similarity with an algebraic equation, we replace the rightleft arrow in the reaction formula by an equals sign and move all terms to the right side of the equation:
(3.2)  0 = c C + d D – a A – b B 
or, more generally:
(3.3)  0 = Σ_{i} ν_{i} A_{i} 
where A_{i} (= A, B, C, D) denotes the i^{th} chemical constituent and the small Greek letter ν_{i} symbolizes the corresponding stoichiometric coefficient with the convention: ν_{i} > 0 for products and ν_{i} < 0 for educts. Stoichiometric coefficients are often overlooked, but they play an important role (along with the sign convention for educts and products).
Conditional Equilibrium Constants
There is some relaxed version of the massaction law based on concentrations alone (rather then activities). In contrast to 1.2, it relies on a socalled conditional or apparent equilibrium constant:
(4.1)  \(^cK \ =\ \dfrac{[C\,]^c \,[D\,]^d}{[A\,]^a \,[B\,]^b}\) 
Since concentrations are converted to activities by {i} = γ_{i} [i], the conditional equilibrium constant ^{c}K is related to the thermodynamic equilibrium constant K by.
(4.2)  \(^cK \ =\ \left[ \dfrac{\gamma_c \,\gamma_d}{\gamma_a \, \gamma_b} \right]^{1} \ K\) 
For sufficiently dilute solutions, i.e. when activity coefficients are γ_{i} = 1, both equilibrium constants become equal: ^{c}K = K.
Again, the conditional equilibrium constant ^{c}K can be abbreviated by p^{c}K = – ^{c}K, which yields the relation:
(4.3)  p^{c}K = pK – ( lg γ_{a} + lg γ_{b} – lg γ_{c} – lg γ_{d} ) 
log K as an “Energy”
There is a fundamental relationship between the equilibrium constant K and the Gibbs energy change:^{3}
(5.1)  ΔG^{0} = – RT ln K 
where R = 8.314 J mol^{1 }K^{1} is the gas constant and T the absolute temperature in Kelvin. This equation can be rearranged to K:^{4}
(5.2)  \(\lg K = \dfrac{\Delta G^{0}}{\ln 10 \,\cdot RT} \, = \dfrac{\Delta G^{0}}{2.3 \,\cdot RT}\) 
These equations apply only to the thermodynamic equilibrium constant K (and not to ^{c}K). And, the log K value – in contrast to K itself – behaves like an “energy”, which according to (2.3e) is also additive.
The temperature dependence of ΔG^{0} and K is discussed here.
Gibbs Energy. Beginners sometimes have trouble with the notation “ΔG^{0}”. There are at least three questions. First question: why ΔG and not G itself? Principally, a characteristic of energy is that there is no absolute energy at all; only energy differences are meaningful (which are measurable quantities). In our case, ΔG is the difference between the energies of the products and the educts. Infinitesimally small changes are abbreviated by dG.
Second question: why this Gibbs energy? Of all energy types (internal energy U, enthalpy H, Helmholtz free energy A etc.) the Gibbs energy is tailored for chemical reactions in which the particle numbers change, i.e. dn_{i} ≠ 0. Under typical lab conditions (i.e. constant temperature and constant pressure), dG or ΔG are associated with the chemical potential μ_{i} of the species i:
(5.3)  dG = Σ_{i} μ_{i} dn_{i}  or  ΔG = Σ_{i} μ_{i} ν_{i} 
The first equation is the GibbsDuhem equation; the second equation is obtained after integration of the first one.^{5} In the last equation, the particle change dn_{i} is replaced by the stoichiometric coefficients ν_{i} (which are wellknown quantities taken from the reaction formula).
Third question: what is the meaning of the superscript “0” in ΔG^{0}? ΔG is the Gibbs energy change of any state, which may be a nonequilibrium state or an equilibrium state; ΔG^{0} refers exclusively to the equilibrium state. Both are related by:
(5.4)  ΔG = ΔG^{0} + RT ln Q  with  \(Q \ = \ \dfrac{\{C\}^c\{D\}^d}{\{A\}^a\{B\}^b}\) 
Here, Q is the reaction quotient – a sort of “nonequilibrium constant”. In fact, Q only becomes the equilibrium constant K in 1.2 if ΔG = 0.
For the very special case of equilibrium, 5.3 also reduces to:
(5.5)  ΔG^{0} = Σ_{i} μ^{0}_{i} ν_{i} 
where μ^{0}_{i} is the standard chemical potential of the species i (that can be looked up in tables).
Chemical Equilibrium from Two Perspectives
The concept of chemical equilibrium seems simple and obvious to us today. The way to understand this phenomenon, however, was long. Historically, there are two approaches to chemical equilibrium that came from opposite sides: from reaction kinetics and from classical thermodynamics.
From Reaction Kinetics. The kinetic approach relies on the temporal changes of educts and products. Experiments have shown that a forward reaction A ⟶ B is always accompanied by a backward reaction B ⟶ A. Over time, the forward and backward reaction rates converge. The chemical equilibrium is established when they become equal, k_{f} = k_{b}.^{6}
Reactions do not stop but come to equilibrium (which then lasts forever when undisturbed).
From Thermodynamics. The second approach was a physicomathematical approach. In 1873, Josiah Willard Gibbs introduced the idea of the chemical potential μ and its relationship to the free energy ΔG. It was the marriage of chemistry with classical thermodynamics.
Equilibrium is attained when the Gibbs energy is at its minimum value.
In fact, the first approach is easier to understand; it observes how educts and products evolve over time. In contrast, thermodynamics doesn’t know what “time” is. In thermodynamics, the physical quantity “time” is replaced by the abstract term “energy”.
The Effect of Temperature and Pressure
At this point a short but important statement: The K value is (strongly) temperaturedependent, but not dependent on pressure P.
In the thermodynamic jargon, it is expressed in this way:
The insensitivity of K to pressure results from the fact that the overall volume changes ΔV^{0} of liquids and solids are negligible in typical hydrochemical applications – in quite contrast to gases.
Remarks & References

Ball J.W. and D.K. Nordstrom: WATEQ4F – User’s manual with revised thermodynamic data base and test cases for calculating speciation of major, trace and redox elements in natural waters, USGS OpenFile Report 90129, 185 p, 1991. ↩

The thermodynamic database wate4f is a plaintext file (with about 3800 lines) located in the program’s subdirectory
LIB
. ↩ 
“Gibbs energy” is the recommended name; it should replace the old name “Gibbs free energy”. ↩

ln x is the abbreviation for the natural logarithm log_{e} x. ↩

The integration variable dn_{i} is replaced by ν_{i} dξ. Then, the socalled advancement variable ξ is integrated from ξ=0 to 1. ↩

This timespan can vary between a few milliseconds (in acidbase reactions) or many years (in redox reactions or mineral precipitation). ↩