Cabin gas is tracked as two independent masses — O₂ and N₂ — converted to partial pressure with the ideal gas law:
P_i = (m_i / M_i) · R·T / V
P_total = P_O2 + P_N2 (Dalton's law)
A hull breach loses gas by molecular effusion through the hole, at a rate set by kinetic theory — each species leaks in proportion to its own partial pressure and inversely to the square root of its molar mass:
ṁ_i = P_i · A_hole · M_i / √(2π·M_i·R·T)
The controller is a deadband loop, the same shape used by real station ECLSS pressure control: it opens the O₂ valve whenever ppO₂ drifts below the hypoxia margin, and opens the N₂ valve whenever total pressure sags below the leak-compensation setpoint — nitrogen is the diluent, so topping it up restores total pressure without pushing O₂ into the fire-risk band above ~23.5 kPa. Both valves draw down finite tanks; if a tank empties, that half of the loop stops responding.
- Leak hole diameter — sets the effusion area of the breach; effusion rate scales with hole area, not linearly with diameter.
- Crew size — each astronaut metabolizes O₂ at a steady real-world rate (~0.84 kg/day), a slow background drain the controller must also cover.
- Controller response gain — scales both valves' maximum makeup flow; too low and a large leak outruns the controller, dropping ppO₂ into the hypoxia band.
- Simulate Puncture — snaps the leak to a large hole instantly, the way a micrometeoroid strike would, so you can watch the control loop react in real time.
Real-world relevance: this is the same pressure-vs-composition control problem ISS and other crewed spacecraft solve continuously — total cabin pressure held near 101.3 kPa (Earth sea level) with ppO₂ kept in a narrow band that is neither hypoxic nor a fire hazard.