The math behind the tools
The equations, constants, and references behind each calculator, so you can check the math. See also the tool overview.
Fundamentals
Shared models the tools build on. All internal math is SI (bar, metres, litres, °C); values convert to your chosen units only for display.
Units & constants
- Atmospheric pressure: 1.01325 bar (gauge = absolute − 1.01325).
- Air: O₂ = 0.209, N₂ = 0.791.
- Conversions: 14.5037738 psi/bar · 28.3168466 L/ft³ · 3.280839895 ft/m.
Depth ↔ pressure
d₀ = 10 m/bar (salt water), 10.3 m/bar (fresh) ATA = depth_m / d₀ + 1
ATA is the absolute pressure at depth in atmospheres. Reference: hydrostatic pressure (~1 bar per 10 m of seawater).
Real-gas compressibility (Z)
PV = Z·nRT (Z = 1 for an ideal gas) Z(P) = 1 + k·P (P in absolute bar) k_O₂ = -0.0002 k_N₂ = +0.0002 k_He = +0.00025 Z_mix = fO₂·Z_O₂ + fHe·Z_He + fN₂·Z_N₂ (fN₂ = 1 − fO₂ − fHe) gas content ∝ P_abs / Z
Applied when the global real-gas setting is on. At ~200 bar O₂ ≈ 0.96, N₂ ≈ 1.04, He ≈ 1.05, dry air ≈ 1.03 — so a nominal AL80 (11.1 L × 207 bar) reads ~77–79 ft³ rather than the ideal 81. Approximation: a first-order linear fit to published Z data near room temperature, not a full virial / NIST / AGA8 model. Reference: real-gas law, compressibility-factor tables for O₂/N₂/He.
Temperature & hot fills
Gay-Lussac (fixed volume): P / T = constant (T in kelvin, K = 273.15) Settle on cooling: P_cold_abs = P_hot_abs × (T_cold / T_hot) Fill hot to target: P_hot_abs = P_cold_abs × (T_hot / T_cold) Fill-rate heating: ΔT = 0.7 × fillRate(bar/min) (≥ 0)
With temperatures set, a fill is computed to the hot pressure that settles to your cold target; "simple" mode uses a flat overfill % instead. Approximation: the 0.7 °C per (bar/min) coefficient rolls cylinder thermal mass into one constant. Reference: Gay-Lussac's / combined gas law.
Blending tools
Cascade Fill
Fills a cylinder from a bank of storage bottles, lowest-pressure bottle first, by free equalization (no pump). Each bottle equalizes with the cylinder until pressures meet, or until the cylinder is up to the target pressure and the valve is closed.
Per bank (skipped if bank ≤ target), mole-weighted mean:
ideal: eqAbs = (P_target_abs·V_target + P_bank_abs·V_bank) / (V_target + V_bank)
real gas: w = V / Z(air, P_abs)
eqAbs = (P_target_abs·w_target + P_bank_abs·w_bank) / (w_target + w_bank)
if eqAbs > P_desired_abs the bank is only partly drawn:
P_bank_abs' = P_bank_abs − (P_desired_abs − P_target_abs)·w_target / w_bank
the fill stops at P_desired_abs and later banks stay untouched
P_final = eqAbs − 1.01325- Banks used lowest-pressure first to preserve high-pressure gas.
- The fill stops at the target pressure — it never overshoots.
- Air assumed (fO₂ = 0.209) for the compressibility weighting.
Reference: conservation of moles on free equalization; real gas via Fundamentals.
Nitrox Stick
Continuous blending: how much pure O₂ to bleed into an air stream for a target nitrox fraction, and the O₂ drawn from supply for a fill.
O₂ flow = airFlow × (targetFO₂ − 0.209) / (1 − targetFO₂) added (surface L) = tankVol × (finalP − startP) O₂ fraction = (targetFO₂ − 0.209) / (1 − 0.209) O₂ volume = added × O₂ fraction supply drop = O₂ volume / supplyVol
- Returns 0 when the target ≤ 0.209 (no enrichment needed).
Reference: partial pressure of O₂ added to air (Dalton's law).
Blend (PP)
Partial-pressure blend to a target O₂/He mix: solves for the pure-O₂ and pure-He pressures to add, then tops up with air or a chosen travel gas.
pi = start pressure pf = final pressure rem = pf − pi bHe = targetFhe·pf − startFhe·pi − topFhe·rem bO₂ = targetFo2·pf − startFo2·pi − topFo2·rem det = (1 − topFhe)(1 − topFo2) − (topFhe)(topFo2) pHe = ( bHe·(1 − topFo2) + topFhe·bO₂ ) / det pO₂ = ( (1 − topFhe)·bO₂ + topFo2·bHe ) / det real gas: pHe ×= Z(He, pf) pO₂ ×= Z(O₂, pf) (pf = final pressure) pTop = pf − pi − pHe − pO₂
- Infeasible if |det| < 1e-9 (top-up gas can't reach the target) or any of pHe / pO₂ / pTop < 0 (would require draining the cylinder).
Reference: Dalton's law of partial pressures; partial-pressure blending.
Topping Up
Given a starting gas and a top-up gas filled to a target pressure, the resulting mix — a mole-weighted blend of the two.
finalMix = r·startMix + (1 − r)·topMix
r = start gas's share of the final gas content
ideal: r = startAbs / finalAbs
real gas: content ∝ P_abs / Z
r = (startAbs / Z_start) / (finalAbs / Z_final)
solved by a 10-step fixed point (Z_final depends on the final mix)- If final ≤ start, nothing is added and the start mix is returned.
Reference: Dalton's law; real gas via Fundamentals.
Blending Cost
Prices a partial-pressure blend by multiplying each component's consumed gas volume (O₂, He, top-up) from the Blend (PP) result by its unit price. No separate dive-math model — see Blend (PP) for the volumes.
Booster
Models an air-driven O₂ booster pump: free equalization first, then the drive-air consumed, fill time, and cycle rate for the boosted portion.
maxOutput = ratio × driveP (stall ceiling; infeasible if target > maxOutput) free equalization (supply ⇄ receiver), mole-weighted like Cascade drive air for q surface L (trapezoidal integral, 400 steps): receiverAbs(x) = boostStart_abs + x / receiverVol inletAbs(x) = min(supplyStart_abs − x / supplyVol, cap) integrand(x) = (receiverAbs/inletAbs) × Z(inletAbs)/Z(receiverAbs) driveAirL = ∫₀^q integrand dx gasPerCycle = ((driveSwept/ratio) × (supplyAbs/1.01325)) / Z_supply boosterRate = maxCpm · gasPerCycle / receiverVol fillTime = equalization time + boost time (both rate-limited)
- Drive pressure ramps to only what the back-pressure needs.
- Fill is capped at the max O₂ fill rate; an undersized storage buffer + compressor can stall the pump.
- Approximation: trapezoidal numeric integration; geometric swept-volume estimate.
Reference: real-gas law; pump displacement ratio; mole balance on transfer.
Planning tools
MOD / END
Maximum Operating Depth for a ppO₂ ceiling, and Equivalent Narcotic Depth for a mix at a planned depth.
MOD (m) = (ppO₂_limit / fO₂ − 1) × d₀ (ppO₂ = fO₂ × ATA) END, N₂-only model: END (m) = (depth + d₀) × (fN₂ / 0.791) − d₀ END, O₂-narcotic model: END (m) = (depth + d₀) × (1 − fHe) − d₀ fN₂ = 1 − fO₂ − fHe
Reference: Dalton's law (ppO₂); narcotic-depth conventions (N₂-only vs O₂ also narcotic).
Best Mix
The richest O₂ fraction allowed at a depth, and the He fraction for a target END — the inverse of MOD/END.
bestFO₂ = min(1, ppO₂_limit / ATA) bestFHe = max(0, 1 − (targetEND + d₀) / (depth + d₀)) (N₂-only END) fN₂ = max(0, 1 − fO₂ − fHe)
Reference: inverse of MOD / END (Dalton's law; narcosis convention).
EAD
Equivalent Air Depth — the air depth with the same N₂ partial pressure, for looking up air decompression tables.
EAD (m) = (depth + d₀) × (fN₂ / 0.791) − d₀ (fN₂ = 1 − fO₂ − fHe)
Reference: standard Equivalent Air Depth formula.
Gas Density
Breathing-gas density at depth, flagging mixes over the recommended and hard limits.
component densities (0 °C, 1 atm): O₂ 1.42897, N₂ 1.2506, He 0.17846 g/L ρ_surface = fO₂·1.42897 + fN₂·1.2506 + fHe·0.17846 ρ_depth = ρ_surface × ATA depthForDensity = (ρ_target / ρ_surface − 1) × d₀ limits: recommended ≤ 5.2 g/L, hard ≤ 6.3 g/L
Reference: gas density scales with absolute pressure; the 5.2 g/L recommended and 6.3 g/L hard limits per Anthony & Mitchell, widely cited in technical-diving guidance.
CNS / OTU
Cumulative oxygen toxicity across a day: CNS clock percentage and pulmonary OTUs over multiple dive segments and surface intervals.
NOAA single-exposure CNS limits (ppO₂ ata → max minutes): 0.6→720 0.7→570 0.8→450 0.9→360 1→300 1.1→240 1.2→210 1.3→180 1.4→150 1.5→120 1.6→45 (linear interpolation between rows; < 0.6 → no limit; ≥ 1.6 → 45) segment CNS% = minutes / limit × 100 OTU = minutes × ((ppO₂ − 0.5) / 0.5)^0.83 (0 when ppO₂ ≤ 0.5) surface interval: CNS ×= 0.5^(surfaceMin / 90) (90-min half-time)
Reference: NOAA Diving Manual — oxygen exposure limits, the CNS clock and 90-minute half-time, and the OTU / UPTD power formula.
Gas Requirements
Surface gas consumption (SAC/RMV) from a logged dive (or entered directly), planned-segment gas, and the rock-bottom reserve to bring a team up safely.
SAC (bar/min) = (startP − endP) / minutes / ATA(avgDepth)
RMV (L/min) = SAC × tankVolume
gas needed (L) = RMV × ATA(depth) × minutes
rock-bottom (L) = teamSize × [ stressedRMV × ATA(depth/2) × (depth / ascentRate)
+ Σ stressedRMV × ATA(stopDepth) × stopMinutes ]
stressedRMV = RMV × stressFactor
min gas (bar) = minGasL / tankVolume- The stress factor multiplies RMV for the emergency ascent only.
Reference: standard SAC/RMV definitions; rock-bottom / minimum-gas reserve planning (technical-diving convention).
Approximations & limitations
- Real gas uses a first-order linear Z fit, not a virial / NIST model.
- Hot-fill heating uses a single 0.7 °C per (bar/min) coefficient.
- Fresh water uses d₀ = 10.3 m/bar; salt uses 10.
- The booster uses numeric (trapezoidal) integration and a geometric swept-volume estimate.
- All results are estimates — verify independently before diving.