Solution (source code)

= Solution

At fixed temperature and pressure, a closed reacting system is in <thermochemical equilibrium> when its <Gibbs free energy> is minimal subject to elemental-abundance constraints. For every independent reaction,
$$
\boxed{\Delta_rG=\sum_i\nu_i\mu_i=0},
$$
with a positive second variation in every allowed direction.

An atmosphere can be driven into <disequilibrium chemistry in an exoplanet atmosphere> by vertical mixing faster than chemical conversion, which causes chemical quenching; ultraviolet <atmospheric photochemistry>; and atmospheric escape. Lightning, energetic particles, horizontal transport, condensation, and rainout provide further mechanisms.