Skip to content

Medical Breathing

This page summarizes the mathematical models used by ACE Medical Breathing. For the numerical methods used to apply the differential equations, see General Considerations.

The model uses two gas reservoirs: alveoli and blood, connected as follows:

Surroundings⇄Vent.Alveoli⇄Perf.Blood

Ventilation exchanges gas with the surroundings and perfusion drives exchange of gas between alveoli and blood. O2 in blood gets continuously converted to CO2. Gas exchanges are simplified as continuous flows. No simulation of actual breathing cycles is done.

Tidal and capacity volumes of the lungs are scaled by pneumothorax (PTX):

VT=VT,0⋅(1−ξPTX)VC=VC,0⋅(1−ξPTX)
  • VT [ml]: Tidal volume.
  • VC [ml]: Lung capacity.
  • VT,0=500⋅2/3 ml: Default tidal volume.
  • VC,0=6000⋅2/3 ml: Default lung capacity.
  • ξPTX∈[0,1]: PTX progress, expressed as the fraction of lung volume lost.

The factors of 2/3 account for dead space.

Respiratory rate RR increases to compensate for the loss of lung volume:

RR=min⁡(RRmax⁡, RR01−ξPTX)
  • RR [min−1]: Respiratory rate in breaths per minute.
  • RR0 [min−1]: Default respiratory rate (m_fDefaultRespiratoryRateBPM).
  • RRmax⁡ [min−1]: Maximum respiratory rate (m_fMaxRespiratoryRateBPM).

The volume-fraction-based ventilation rate is given below:

kV=RR60 s/min⋅VTVC
  • kV [s−1]: Fractional ventilation rate.

Ventilation equilibrates partial gas pressures between alveoli and surroundings:

ΦV,O2=kV⋅(pO2max⁡−pO2)ΦV,CO2=kV⋅pCO2
  • pO2, pCO2 [kPa]: Alveolar O2 and CO2 partial pressures.
  • pO2max⁡ [kPa]: Supplied O2 pressure, normally 19.925 kPa.
  • ΦV,O2 [kPa/s]: Ventilation rate of increase in alveolar O2 partial pressure.
  • ΦV,CO2 [kPa/s]: Ventilation rate of decrease in alveolar CO2 partial pressure.

The CO2 partial pressure of the surroundings is currently approximated as 0 kPa. An equipped O2 mask raises pO2max⁡ to 95 kPa and enforces kV≥0.015 s−1.

O2 is consumed by cellular respiration and CO2 is produced in return. The ratio between production and consumption depends on the chemical reactions that take place (i.e. aerobic vs anaerobic conditions) and the ratio is given by the respiratory exchange rate RER. The values are adjusted through linear interpolation between hypoxic and normal SpO2 values:

φCR,O2=lerp(φCR,O2hypo, φCR,O20, λ)RER=lerp(RERhypo, RER0, λ) λ=clamp⁡(SpO2−SpO2,hypoSpO2,0−SpO2,hypo, 0, 1) φCR,CO2=φCR,O2⋅RER
  • φCR,O2 [mmol/s]: O2 consumption rate.
  • φCR,O20, φCR,O2hypo [mmol/s]: Normal and hypoxic consumption rates (m_fDefaultOxygenConsumptionMMOLPS and m_fHypoxicOxygenConsumptionMMOLPS).
  • RER, RER0, RERhypo [⋅]: Current, normal, and hypoxic respiratory exchange ratios (m_fDefaultRER and m_fHypoxicRER).
  • SpO2 [%]: Peripheral blood O2 saturation.
  • SpO2,0, SpO2,hypo [%]: Normal and hypoxic saturation levels (m_fDefaultSpO2 and m_fHypoxicMetabolismSpO2).
  • λ [⋅]: Interpolation fraction.
  • φCR,CO2 [mmol/s]: CO2 production rate.

Note that both consumption and production rates are defined as positive values. The sign convention will be important later for the correct signs in the ODEs.

Reduced saturation lowers consumption, which simulates the body prioritizing vital organs.

Perfusion Q is driven by cardiac output:

Q=CO60 s/min⋅(1−ξPTX)2/3
  • Q [ml/s]: Lung perfusion.
  • CO [ml/min]: Cardiac output.

The ξPTX-based term accounts for loss of surface area through pneumothorax. The exponent of 2/3 comes from converting a volume-based quantity to an area-based quantity.

O2 binding to hemoglobin at the alveolar pressure follows a Hill function:

Salv=(pO2/KD)γ1+(pO2/KD)γ
  • Salv∈[0,1]: Equilibrium O2 saturation at the alveolar O2 pressure.
  • KD=3.6 kPa: Hemoglobin O2 dissociation constant.
  • γ=2.7: Hill coefficient for hemoglobin.

The saturation level for venous blood is derived by subtracting consumed O2 from SpO2:

Sv=SpO2100%−60 s/minCO⋅cheme⋅φCR,O2
  • Sv∈[0,1]: O2 saturation of venous blood.
  • cheme=0.0098 mmol/ml: Heme concentration in blood.

The flux for loading hemoglobin at alveoli is calculated as follows:

φQ,O2=Q⋅cheme⋅clamp⁡(ks⋅(Salv−Sv), ΔSmin⁡, ΔSmax⁡) ΔSmin⁡=−SvΔSmax⁡=max⁡(Salv−Sv, 0)
  • φQ,O2 [mmol/s]: O2 transfer flux from alveoli to blood.
  • ks [⋅]: Saturation equilibration rate scale.
  • ΔSmax⁡ [⋅]: Bound for saturation increase.
  • ΔSmin⁡ [⋅]: Bound for saturation decrease.
  • HR0 [min−1]: Default heart rate (m_fDefaultHeartRateBPM).
  • SV0 [ml]: Default stroke volume (m_fDefaultStrokeVolumeML).

The fluxes are scaled by perfusion and capped by the loading capacity of hemoglobin.

CO2 exchange is driven by an imbalance between venous concentration cv and alveolar partial pressure pCO2. The equilibrium is given by Henry’s law:

KH=cvpCO2
  • KH=0.000225 mmol/(ml⋅kPa): Henry constant for CO2 in blood.
  • cv [mmol/ml]: Venous blood CO2 concentration.

The flux for equilibration is calculated as follows:

φQ,CO2=Q⋅min⁡(min⁡(kc, kcmax⁡)⋅(cv−KH⋅pCO2), Δcmax⁡) Δcmax⁡=cv+cHCO3−
  • φQ,CO2 [mmol/s]: CO2 transfer flux from blood to alveoli.
  • kc [⋅]: Carbonate dehydration rate scale. Determines how fast equilibration takes place.
  • kcmax⁡ [⋅]: Maximum rate scale preventing overshoot of Henry’s law equilibrium.
  • Δcmax⁡ [mmol/ml]: Bound for forward concentration change from blood to alveoli.
  • cHCO3−=0.024 [mmol/ml]: Fixed blood HCO3− concentration.

The flux is scaled by perfusion and capped by total CO2 content of blood. The equilibration is furthermore prone to overshooting, which is why a cap kcmax⁡ is imposed on the rate scale:

kcmax⁡=1QΔt⋅(1Vv+RTKHVC)−1
  • Δt [s]: Time step of the simulation.
  • T [K]: Body temperature.
  • R [kPa⋅ml/(mmol⋅K]): Universal gas constant.
  • Vv [ml]: Venous blood volumes (70% of total blood volume).

Net Evolution of Gas Pressures and Concentrations

Section titled “Net Evolution of Gas Pressures and Concentrations”

Ventilation, perfusion, and cellular respiration are combined in ODEs. For evolution of alveolar partial pressures:

dpO2dt=ΦV,O2−RTVC⋅φQ,O2 dpCO2dt=RTVC⋅φQ,CO2−ΦV,CO2

Peripheral blood O2 saturation:

dSpO2dt=100%Va⋅cheme⋅(φQ,O2−φCR,O2)

CO2 concentration in venous blood:

dcvdt=1Vv⋅(φCR,CO2−φQ,CO2)
  • t [s]: Simulation time.
  • Va [ml]: Arterial blood volumes (30% of total blood volume).

Conversion between partial pressure p and amount of substance n is done through the ideal gas law:

p=nRTV

Tongue-based obstruction and vomit-based occlusion completely shut down any ventilation. Cardiac arrest additionally shuts down perfusion. Cellular respiration still keeps consuming O2 from stale blood, leading to SpO2 depletion and acidosis from CO2 accumulation. CPR can partially restore exchange with chest compression-induced blood flow and passive ventilation (m_fCPRPassiveVentilationRateBPM). An equipped O2 mask additionally increases ventilation as described in Ventilation.

An elevated respiratory rate raises the base heart rate target:

ΔHRbase=2⋅max⁡(RR−RR0, 0)
  • ΔHRbase [min−1]: Shift added to base heart rate target.