User:Discoverator/sandbox

Derivation of the formulas
For a given nitrox mixture and a given depth, the equivalent air depth expresses the theoretical depth that would produce the same partial pressure of nitrogen if regular air (79% nitrogen) was used instead:
 * $$ppN_2(nitrox, depth) = ppN_2(air, EAD)$$

Hence, following the definition of partial pressure:
 * $$FN_2(nitrox) \cdot P_{depth} = FN_2(air) \cdot P_{EAD} $$

with $$FN_2$$ expressing the fraction of nitrogen and $$P_{depth}$$ expressing the pressure at the given depth. Solving for $$P_{EAD}$$ then yields a general formula:
 * $$P_{EAD} = {FN_2(nitrox) \over FN_2(air)} \cdot P_{depth} $$

In this formula, $$P_{EAD}\,$$ and $$P_{depth}\,$$ are absolute pressures. In practice, it is much more convenient to work with the equivalent equivalent columns of seawater depth, because the depth can be read off directly from the depth gauge or dive computer. The relationship between pressure and depth is governed by Pascal's law:
 * $$ P_{depth} = P_{atmosphere} + \rho_{seawater} \cdot g \cdot h_{depth}\,$$

Using the SI system with pressures expressed in pascal, we have:
 * $$ P_{depth}(Pa) = P_{atmosphere}(Pa) + \rho_{seawater} \cdot g \cdot h_{depth}(m)\,$$

Expressing the pressures in atmospheres yields a convenient formula (1 atm ≡ 101325 Pa):
 * $$ P_{depth}(atm) = 1 + \frac{\rho_{seawater} \cdot g \cdot h_{depth}}{P_{atmosphere}(Pa)} = 1 + \frac{1027 \cdot 9.8 \cdot h_{depth}}{101325}\ \approx 1 + \frac{h_{depth}(m)}{10}$$

To simplify the algebra we will define $$\frac{FN_2(nitrox)}{FN_2(air)} = R$$. Combining the general formula and Pascal's law, we have:
 * $$1 + \frac{h_{EAD}}{10} = R \cdot (1 + \frac{h_{depth}}{10})$$

so that
 * $$h_{EAD} = 10 \cdot (R + R \cdot \frac{h_{depth}}{10} - 1) = R \cdot (h_{depth} + 10) - 10$$

Since $$h(ft) \approx 3.3 \cdot h (m)\,$$, the equivalent formula for the imperial system becomes
 * $$h_{EAD}(ft) = 3.3 \cdot \Bigl(R \cdot \frac{h_{depth}(ft)}{3.3} + 10) - 10 \Bigr) = R \cdot (h_{depth}(ft) + 33) - 33$$

Substituting R again, we have the concrete formulas:


 * $$h_{EAD}(m) = \frac{FN_2(nitrox)}{FN_2(air)} \cdot (h_{depth}(m) + 10) - 10$$


 * $$h_{EAD}(ft) = \frac{FN_2(nitrox)}{FN_2(air)} \cdot (h_{depth}(ft) + 33) - 33$$