Presets
Playback
Parameters
Camera
Layers
Quality
Model check
The science
What is modelled
The lungs and chest wall are treated as one elastic bag fed through a narrow tube: the respiratory muscles produce a pressure, the airways resist the flow and the lung and chest wall tissue store the energy like a spring. The page integrates this equation in time, moves the Blender ribcage, diaphragm and lungs with the computed volume, and then uses the breath size to work out how much fresh air reaches the alveoli and what that does to oxygen and carbon dioxide. Disease presets change only the resistance, the compliance, the effort or the dead space.
Equations
- Equation of motion:
Pmus(t) = V/Crs + R dV/dt, with lung and chest wall compliances in series,1/Crs = 1/CL + 1/Ccw(Ccw = 200 mL/cmH2O). The muscle pressure is a half-sine of peak Pmax during inspiration and zero afterwards, so expiration is passive. Passive emptying followsV = V0 e−t/τ,τ = R Crs, and about 95 % is out after 3 τ. - Pressures: alveolar
PA = −R dV/dt, pleuralPpl = −5 + V/Ccw − Pmus, transpulmonaryPA − Ppl. The work done by the muscles isW = ∫ Pmus dV; over a closed cycle it equals the resistive loss∫ R (dV/dt)² dt. - Gas exchange: alveolar ventilation
VA = (VT − VD) f;PACO2 = (PB − 47) VCO2/VA; alveolar gas equationPAO2 = PIO2 − PACO2/RQ,PIO2 = FIO2 (PB − 47). Barometric pressure falls with altitude asPB = 760 (1 − 2.26·10−5 h)5.26. - Haemoglobin saturation by the Hill equation
S = Pn/(Pn + P50n)with P50 = 26.6 mmHg and n = 2.7.
Checks run in the page
- Passive deflation stepped numerically against the exponential with τ = R Crs.
- Energy balance over one steady breath: muscle work against the integral of R V′².
- Breath-by-breath mixing of the alveolar CO2 pool against the closed-form alveolar equation.
Honest simplifications
One lung compartment with constant resistance and compliance; real lungs have thousands of units with different time constants, flow-dependent resistance, closing volumes and a compliance that changes with volume. Dead space is a fixed volume, ventilation-perfusion mismatch and shunt are lumped into one alveolar-arterial gradient, carbon dioxide dissolved in blood is not modelled and the Hill curve ignores pH, temperature and 2,3-DPG. The ribcage, diaphragm and lung movement in the 3D model follows the volume with simple scaling, not a mechanical model of the muscles. Educational model, not a clinical tool.
What to try
- Choose the asthma preset: the time constant grows, the expiration time is no longer enough and air is trapped (dynamic hyperinflation).
- Choose pulmonary fibrosis: the loop becomes steep and the breaths shallow and fast.
- Raise the altitude to 5 km, then breathe pure oxygen, and read the alveolar oxygen in the third graph.
- Increase the dead space and see why shallow fast breathing ventilates poorly.