Pulmonary Mechanics Lab (2D)

Sagittal chest schematic with live flow-volume and pressure-volume loops, an RC lung model and blood-oxygen loading along an alveolar capillary.

Switch to 3D

Presets

Playback

Mechanics

Compliance, resistance and breathing pattern of the respiratory system.

Gas exchange conditions

Altitude, inspired oxygen, metabolic rate, dead space and membrane thickness.

Layers

Model checks

The science

One-compartment respiratory mechanics

Lungs and chest wall are treated as one elastic bag (compliance C) fed through one airway (resistance R). The equation of motion is Pmus(t) = V/C + R dV/dt, where V is the volume above resting end-expiration (FRC, about 2.4 L). Inspiration is driven by a half-sine of muscle pressure of amplitude Pmax and duration Ti = fi T; expiration is passive. The step uses the exact exponential solution for a piecewise-constant Pmus, so it is stable for any R and C.

Time constant and air trapping

Passive emptying follows V = V0 exp(-t/tau) with tau = R C. If the expiratory time Te is shorter than about 3 tau the lung cannot empty before the next breath, gas is trapped and the end-expiratory recoil pressure (auto-PEEP, dynamic hyperinflation) rises: this is the asthma preset. In fibrosis C is small, so the same effort moves little air; in emphysema C is large but recoil is weak.

Pressures and loops

Alveolar pressure is Palv = V/C - Pmus = -R dV/dt; pleural pressure Ppl = -5 + V/(2C) - Pmus (cmH2O, lung and chest wall as equal springs). The pressure-volume loop opens by the resistive work R dV/dt; the flow-volume loop is the standard spirometry display.

Closed glottis (Boyle)

With no flow, gas of volume V0 + V obeys P (V0 + V) = Patm V0, so muscle pressure moves only about 16 mL. The quadratic is solved exactly and re-checked by bisection.

Gas exchange

Alveolar ventilation VA = f (VT - VD); PACO2 = 0.863 VCO2 / VA; PAO2 = FiO2 (Pb - 47) - PACO2 / RQ with RQ = 0.8 and the ICAO atmosphere Pb = 760 (1 - 2.2558e-5 h)^5.2559. Capillary blood loads oxygen by dC/dt = Dm (PA - Pc) with content C = 0.003 P + 1.34 Hb S(P), Hb = 15 g/dl and a Hill curve (n = 2.7, P50 = 26.8 mmHg), solved by implicit steps.

Simplifications

Single compartment, no ventilation-perfusion mismatch or shunt, no CO2 dissociation or acid-base chemistry, constant FRC, no control of breathing, linear mechanics (real airways collapse in emphysema). The chest drawing is schematic. Educational model, not for clinical use.

What to try
  • Pick Asthma attack: Te / tau falls below 3, auto-PEEP appears and the flow-volume loop collapses.
  • Pick Pulmonary fibrosis: compliance drops and the membrane thickens, so end-capillary PO2 falls even though the lungs are ventilated.
  • Pick Everest summit then raise inspired O2 to 40 %: saturation recovers.
  • Press Close glottis: the chest barely moves although the muscles still push (Boyle).
Volume and flow over two breaths
Pressure-volume loop
Flow-volume loop (spirometry)
Capillary blood PO2 along the transit