A stratified model of pulmonary gas exchange

A stratified model of pulmonary gas exchange

8th IFAC Symposium on Biological and Medical Systems The International Federation of Automatic Control August 29-31, 2012. Budapest, Hungary A strati...

1MB Sizes 112 Downloads 278 Views

8th IFAC Symposium on Biological and Medical Systems The International Federation of Automatic Control August 29-31, 2012. Budapest, Hungary

A stratified model of pulmonary gas exchange Mads L. Mogensen*. Dan S. Karbing*. Kristoffer L. Steimle*. Stephen E. Rees*. Steen Andreassen*. 

*Center for Model-based Medical Decision Support, Aalborg University, DK 9920 Aalborg, Denmark (Tel: +45 9940 7458; email: [email protected])} Abstract: This paper describes a model of pulmonary gas exchange including CO2 and O2 storage and transport in the anatomical dead space, alveoli, capillaries, arterial and mixed venous blood. Model simulations of gas exchange, ventilation and perfusion for an average healthy adult were in general in good agreement with previously reported values. However, the model overestimates the heterogeneity of ventilation/perfusion ratios down the lungs. Results indicate that the model is able to simulate the pulmonary gas exchange in healthy human lungs but that modifications are required to counter the large degree of ventilation/perfusion heterogeneity currently simulated by the model. Keywords: Physiological models, distribution of ventilation and perfusion, lung mechanics, gas exchange. 

1. INTRODUCTION Ventilation and perfusion are non-uniformly distributed in the human lungs. In respiratory disease and injury this heterogeneity is augmented causing significant mismatch between ventilation and perfusion. The mechanisms behind the ventilation/perfusion ( V / Q ) mismatch and the effects of therapeutic measures such as mechanical ventilation are not fully understood. Mathematical physiological models may help to improve this understanding. Including the dynamics of pulmonary ventilation may be beneficial compared to the traditional steady state approach allowing interpretation of within breath changes in gas exchange (Hahn et al., 2003). Previous dynamic models of the respiratory system have either lumped the lungs as a single compartment neglecting V / Q distributions (Liu et al., 1998) or omitted major factors contributing to pulmonary mechanics such as the chest wall and pulmonary surfactant (Hardman et al., 1998).

gas exchange within each layer. Simulated volumes, flows and partial pressures are at body temperature (37 oC) and fully saturated with water (BTPS), unless otherwise noted. Table 2 in appendix A lists main model parameters. Appendix B describes a model of air flow in the anatomical dead space. Pulmonary ventilation is simulated by a previously published model (Mogensen et al., 2010)(Steimle et al., 2011), which incorporates surfactant, lung tissue, chest wall, hydrostatic effects, and airway resistance and viscoelasticity. The ventilation model has been modified to use the pressure exerted by respiratory muscles, PMus, as the driving model variable. PMus is modelled as stated in Eq. 1.  PPeak (1  et /  vi ) 0  t  t EndInsp PMus (t )   ( t t EndInsp) /  ve t EndInsp  t  t EndExp PPeak  e

(1)

where PPeak is peak pressure exerted by respiratory muscles, τVi and τVe are pressure rise and fall time constants, tEndInsp and tEndExp are inspiratory and expiratory end times.

This paper presents a mechanistic model of the dynamics of pulmonary gas exchange developed for simulating pulmonary ventilation, perfusion and gas exchange for an average human adult. 2. METHODS 2.1 The model Fig. 1 illustrates the model structure. The model describes O2 and CO2 flow between environment (E), anatomical dead space (AD), alveoli (A), capillaries (c), arterial blood (a), and mixed venous blood (v). The lungs are divided into layers distributed from non-dependent (i = 1) to dependent parts (i = NLayers), all containing equal number of alveoli. The model assumes a uniform distribution of perfusion, ventilation and 978-3-902823-10-6/12/$20.00 © 2012 IFAC

Fig. 1. Model structure The extraalveolar pressure at layer i (PEAi) is the sum of pressure due to chest wall elasticity (PCW), hydrostatic

512

10.3182/20120829-3-HU-2029.00053

8th IFAC Symposium on Biological and Medical Systems August 29-31, 2012. Budapest, Hungary

pressure at layer i (PHydroi), and PMus. The alveolar transmural pressure (PAlvTMi) is the difference between PEAi and alveolar pressure (PAi). PAlvTMi is matched by recoil pressures due to lung tissue elasticity (PEi), surface tension (PSi), and viscoelasticity (PVEi), as stated in Eq. 2. PAlvTM i  PAi  ( PCW  PHydroi  PMus )  PEi  PSi  PVEi

i

into each layer from the time where the volume of inspired air exceeds anatomical dead space, VAD. Cardiac output (Q) and capillary perfusion at layer i (Qi) are simulated by a previously published model (Mogensen et al., 2011a, 2011b), which describes capillary elasticity, resistance, number and length of capillaries, blood viscosity, pulmonary arterial pressure (Ppa), and constant arteriolar resistance. The fraction of cardiac output not involved in gas exchange (QShunt) is assumed constant. Q is the sum of Qi from the layers and QShunt. O2 transport equations are stated in Eqs. 3-5. Inspiration is positive flow direction i.e. from environment (E) towards capillaries (C). The notation n AD Ai O2 means O2 flow from anatomical dead space to alveoli at layer i. Gas flow between alveoli, capillaries, and arterial and venous blood is calculated for each layer, indicated by subscript i. (3)

N Layers

n a O2 

 n

ci a O2

 Q Shunt  C v O2  n av O2

i 1

  f ( V , n O ( r , z )) Ai AD 2 j k  n AD  Ai O2    VAi  PAi O2  R  TB 

(2)

Eq. 2 is solved numerically (Steimle et al., 2011). Alveolar ventilation at layer i ( VA ) is calculated by integrating flow

n Ai O2  n AD  Ai O2  n Ai ci O2

Appendix A describes VCF and the function f. Eq. 7 calculates flow between anatomical dead space and alveoli.

(4)

Inspiration Expiration

(7)

where flow is calculated from alveolar ventilation at layer i ( VAi ), alveolar partial pressure of O2 (PAiO2) and body temperature (TB). Partial pressures of O2 and CO2 are assumed always in equilibrium between alveoli and the arterial side of pulmonary capillaries (P ciO2 = PAiO2). O2 and CO2 flow between capillaries and alveoli in each layer are calculated using Fick’s law, as stated for O2 in Eq. 8. n Ai ci O2  Qi  (Cci O2 ( PAi O2 , PAi CO2 )  CvO2 ( PvO2 , PvCO2 ))

(8)

where PvO2 and CvO2 are O2 partial pressure and concentration at venous end of capillaries, and CciO2 is O2 concentration at the arterial end of capillaries. Venous concentration is assumed equal for all layers. CciO2 depends on O2 and CO2 partial pressures, PciO2 and PciCO2, due to the Bohr-Haldane effect (Lumb, 2003). CciO2 also depends on haemoglobins, 2,3-diphospoglycerate and non-bicarbonate buffers. A model of blood acid-base chemistry (Rees and Andreassen, 2005) calculates CciO2, capillary CO2 concentration (CciCO2), and arterial and venous O2 and CO2 concentrations. Equations 9-11 calculate O2 flow between blood compartments. The blood acid-base model calculates O2 concentrations from O2 and CO2 partial pressures. n ci a O2  Cci O2 ( Pci O2 , Pci CO2 )  Qi

(9)

na vO2  CaO2 ( PaO2 , PaCO2 )  Q  VO2

(10)

The flow of O2 between environment and anatomical dead space is stated in Eq. 6.

n vci O2  Cv O2 ( Pv O2 , Pv CO2 )  Qi

(11)

 VCF  V  PE O2  R  TE  n E  AD O2    f (V , n O (r , z )) AD 2 j k  

2.2 Model simulations

N Layers

n v O2  n a v O2  QShunt  C v O2 



n vci O2  VO2

i 1

(5)

Inspiration Expiration

(6)

where flow during inspiration is calculated from total ventilation ( V ), O2 partial pressure in the environment (PEO2), the gas constant (R), and environment temperature (TE). V is calculated as previously described (Steimle et al., 2011). A volume conversion factor (VCF) transforms total ventilation at BTPS to ventilation from environment at ambient temperature (20oC) saturated with water (ATPS). During expiration, O2 flow is a function of V and a matrix of state variables ( n AD O2 (r j , z k ) ), representing radial (rj) and longitudinal (zk) O2 distribution in the anatomical dead space.

Table 2 in appendix A includes default values for model parameters representing an average healthy adult human subject in supine posture at rest. Default values have been used unless otherwise noted. Simulations were performed until equilibration defined as differences in end-tidal O2 and CO2 partial pressure between subsequent breaths of less than 0.001 kPa. Anatomical dead space was assumed constant. 3. RESULTS 3.1 Model simulations of gas exchange Simulated tidal volume was 590 ml (BTPS) with a minute ventilation of 7.1 l/min and alveolar ventilation of 5.3 l/min. For a supine subject simulated Q was 6.0 l/min.

513

8th IFAC Symposium on Biological and Medical Systems August 29-31, 2012. Budapest, Hungary

Fig. 2-A and B show flow between alveoli and capillaries for O2 and CO2, respectively. O2 and CO2 flows are pulsatile, reflecting perfusion variations during cardiac cycles. Gas exchange also varies over the breathing cycle. For example, CO2 exchange in the most dependent layer during the first heartbeat is half as big as during the second heartbeat. Fig. 3-A and B show simulated PAO2 and PACO2 during a tidal breath. Within-breath changes of PAO2 ranged from 0.41.4 kPa with largest changes in the most-dependent layer. For PACO2 within breath changes ranged from 0.4-0.7 kPa. Oscillations of about 0.15 kPa due to pulsatile blood flow were superimposed upon the breathing fluctuation.

Table 1. Simulated gas partial pressures (kPa) Gas O2 CO2

Non. Dep. 15.7 4.6

Alveoli Dep. 10.3 5.7

Arterial Endtidal 13.9 5.1

12.0 5.3

Mixed venous 5.4 5.9

3.2 Model simulations of V / Q -distribution Fig. 4 shows simulated V , Q and V / Q with PET studies of V / Q -distribution in healthy subjects during quiet breathing in supine position (Brudin et al., 1994) and (Rhodes et al., 1989). Simulated ventilation and perfusion were calculated as ml/min/cm3 lung parenchyma (including air). The number of alveoli and capillaries per cm3 lung tissue increase by a factor of 2.2 from the non-dependent (i =1) to the most dependent layer (i = 20). The simulated ratio of perfusion per cm 3 between dependent and non-dependent layer (Q20/Q1) was 3.85 (Fig. 4-B). The simulated V / Q -distribution decreased by a factor of 3.63 from 1.60 in the non-dependent layer to 0.44 in the dependent layer (Fig. 4-C).

Fig. 2. O2 (A) and CO2 (B) flow between alveoli and capillaries for layers 1, 7, 14 and 20 (most dependent, dotted line). B) Horizontal lines mark inspiratory gas flow variation. Dotted vertical lines separate inspirations from expirations.

Fig. 4. Simulated ventilation and perfusion (solid lines) according to lung depth with measurements by (Brudin et al., 1994) (dots) and (Rhodes et al., 1989) (crosses). A: Alveolar ventilation per cm3 (line). B: Perfusion per cm3. C: Ventilation/perfusion distribution. Fig. 3. Distribution of alveolar O2 (A) and CO2 (B) partial pressures. Dashed lines indicate the most dependent layer. Dotted vertical lines separate inspirations from expirations. End-tidal partial pressures of O2 and CO2 are indicated. Table 1 shows average simulated partial pressures of O2 and CO2 for dependent and non-dependent layers, end-tidal expired gas and for arterial and mixed venous blood.

4. DISCUSSION 4.1 Simulated gas exchange Simulations of PAO2 and PACO2 during a tidal breath showed variations of up to 1.4 kPa and 0.7 kPa, respectively, with the

514

8th IFAC Symposium on Biological and Medical Systems August 29-31, 2012. Budapest, Hungary

most dependent layers showing largest variation. These changes are larger compared to the within breath changes of 0.6 kPa (4.5 mm Hg) for P AO2 and 0.4 kPa (2.65 mm Hg) for PACO2 simulated by (Hlastala, 1972). This may, in part, be due to model simulated low V / Q in dependent lung layers. (Banallal et al., 2002) tested a gas exchange model against measured of O2 and CO2 pressures in healthy men in supine position at rest, the model simulating end-tidal partial pressures at BTPS. We therefore assumed mean measured PETO2 and PETCO2 by Banallal were also reported at BTPS. These were 13.6 ± 0.6 kPa and 5.1 ± 0.4 kPa, respectively, being similar to model simulated PETO2 and PETCO2 in this study (table 1). In textbooks, P aO2 for young healthy adults are in the range 11.2-13.9 kPa with average PaCO2 being 5.3 kPa (Lumb, 2003), these values being in good agreement with model simulated values. Textbook reported values of PvO2 and PvCO2 are 5.3 kPa and 6.1 kPa, respectively (Despopulos and Silbernagl, 2003) (Lumb, 2003), with model simulated PvO2 and PvCO2 being similar. 4.2 Simulated V / Q -distribution The simulated ratio of perfusion per cm3 between dependent and non-dependent parts of the lungs of 3.85 (Fig. 4-B) is in good agreement with experimental data by (Brudin et al. 1994). However, the simulated ratio of decrease of 3.63 in V / Q from non-dependent to dependent parts of the lungs is in contrast to V / Q -ratios reported by by (Brudin et al., 1994) and (Rhodes et al., 1989) (Fig. 4-C) showing measured V / Q being almost independent of lung height. Part of the discrepancy between model simulated results and measurements reported by (Brudin et al., 1994) may be due to uncertainty regarding the exact conditions under which Brudin et al. performed the experiments, in particular the breathing pattern leading to difficulty in selecting tidal volume and airway pressure which may affect the ventilation distribution down the lungs. Whether experimental conditions, model limitations or both cause the discrepancy between model simulations and experimental data is a topic for future studies. 4.3 Model limitations Heterogeneity of ventilation and perfusion is in the presented model due only to hydrostatic effects. However, several other contributing factors exist. The effects of gravity may be compensated by anatomical factors, for example regional variations in the flow resistance of the vascular bed (Glenny 1991) or of the airways (Galvin et al, 2007) and the effects of gravity may be counteracted by active mechanisms, such as hypoxic pulmonary vasoconstriction (Moudgil et al., 2005) or hypoxic bronchodilation (Wetzel et al., 1992). It is evident from the presented results that modifications of the model are necessary, in particular with regards to distribution of ventilation. Whether the discrepancy between simulated ventilation and experimental data is due to

omission of one or more of the above mentioned factors or one of the individual components of the ventilation models describing pulmonary surfactant, chest wall elasticity or lung tissue elasticity is a topic for future studies. The model of gas mixing in the anatomical dead space presented in appendix B assumes gas mixing of air in the anatomical dead space is only determined by turbulence. However diffusion, distance and anatomy of the upper airways are also contributing factors (Engel and Paiva, 1985). 5. CONCLUSIONS A mechanistic model of the dynamics of pulmonary gas exchange was presented. For parameters set to describe an average healthy adult human subject in supine posture at rest, model simulations of O2 and CO2 partial pressures in alveolar air and arterial and mixed venous blood are in agreement with average healthy human values. However, the model simulates a large degree of ventilation/perfusion heterogeneity in comparison to previously reported results from PET studies, and future studies with the model should address this. REFERENCES Benallal, H., Denis, C., Prieur, F., and Busso, T. (2002). Modeling of end-tidal and arterial PCO2 gradient: comparison with experimental data. Med Sci Sports Exerc, 34, 622-9. Bock, K.R., Silver, P., Rom, M., and Sagy, M. (2000). Reduction in tracheal lumen due to endotracheal intubation and its calculated clinical significance. Chest, 118, 468-72. Brudin, L.H., Rhodes, C.G., Valind, S.O., Jones, T., and Hughes, J.M. (1994). Interrelationships between regional blood flow, blood volume, and ventilation in supine humans. J Appl Physiol, 76, 1205-10. Despopulos, A., and Silbernagl, S. (2003). Color atlas of physiology. Georg Thieme Verlag. Engel, L.A., and Paiva, M.M. (1985). Gas mixing and distribution in the lung. Informa Healthcare. Galvin, I., Drummond, G.B., and Nirmalan, M. (2007). Distribution of blood flow and ventilation in the lung: gravity is not the only factor. Br J Anaesth, 98, 420-8. Glenny, R.W., Lamm, W.J., Albert, R.K., and Robertson, H.T. (1991). Gravity is a minor determinant of pulmonary blood flow distribution. J Appl Physiol, 71, 620-9. Hahn, C.E., and Farmery, A.D. (2003). Gas exchange modelling: no more gills, please. Br J Anaesth, 91, 2-15. Hardman, J.G., Bedforth, N.M., Ahmed, A.B., Mahajan, R.P., and Aitkenhead, A.R. (1998). A physiology simulator: validation of its respiratory components and its ability to predict the patient's response to changes in mechanical ventilation. Br J Anaesth, 81, 327-32. Hlastala, MP. (1972). A model of fluctuating alveolar gas exchange during the respiratory cycle. Respir Physiol, 15, 214-32. Liu, C.H., Niranjan, S.C., Clark, J.W. Jr., San, K.Y., Zwischenberger, J.B., and Bidani, A. (1998). Airway

515

8th IFAC Symposium on Biological and Medical Systems August 29-31, 2012. Budapest, Hungary

mechanics, gas exchange, and blood flow in a nonlinear model of the normal human lung. J Appl Physiol, 84, 1447-69. Lumb, A.B. (2003). Nunn's Applied Respiratory Physiology. Butterworth-Heinemann. Mogensen, M.L., Thomsen, L.P., Karbing, D.S., Steimle, K.L., Zhao, Y., Rees, S.E., and Andreassen, S. (2010). A Mathematical Physiological Model of the Dynamics of the Pulmonary Ventilation. UKACC International Conference on CONTROL 2010 September 7-10th, Coventry, UK. Mogensen, M.L., Steimle, K.S., Karbing, D.S., and Andreassen S. (2011a). A model of perfusion of the healthy human lung. Comput Methods Programs Biomed, 101, 156-65. Mogensen, M.L., Karbing, D.S., and Andreassen, S. (2011b). The effect of arteriolar resistance on perfusion distribution in a model of the pulmonary perfusion. 18th World Congress of the International Federation of Automatic Control (IFAC) August 28 - September 2, Milano, Italy. Moudgil, R., Michelakis, E.D., and Archer, S.L. (2005). Hypoxic pulmonary vasoconstriction. J Appl Physiol 98, 390-403. Papamoschou, D. (1995). Theoretical validation of the respiratory benefits of helium-oxygen mixtures. Respir Physiol, 99, 183-90. Pedley, T.J., and Kamm, R.D. (1997). Dynamics of gas flow and pressure-flow relationships. In Crystal, R. and West, J. (ed.), The Lung: Scientific Foundations. Raven Press Ltd., New York. Rees, S.E., and Andreassen, S. (2005). Mathematical models of oxygen and carbon dioxide storage and transport: the acid-base chemistry of blood. Crit Rev Biomed Eng, 33, 209-64. Rhodes, C.G., Valind, S.O., Brudin, L.H., Wollmer, P.E., Jones, T., Buckingham, P.D., and Hughes, J.M. (1989). Quantification of regional V/Q ratios in humans by use of PET. II. Procedure and normal values. J Appl Physiol, 66, 1905-13. Saleh, J.M. (2008). Fluid flow handbook. McGraw-Hill. Steimle, K.L., Mogensen, M.L., Karbing, D.S., Bernardino de la Serna, J., and Andreassen, S. (2011). A model of ventilation of the healthy human lung. Comput Methods Programs Biomed, 101, 144-55. Streeter, V.L., and Wylie, E.B. (1985). Fluid Mechanics. Mcgraw-Hill College. Wetzel, R.C., Herold, C.J., Zerhouni, E.A., and Robotham, J.L. (1992). Hypoxic bronchodilation. J Appl Physiol, 73, 1202-6.

Appendix A. Model parameters Table 2. Model parameters Parameter NLayers VTLC

Value

Description

20 6.8 l

Number of lung layers Total lung capacity

VAD RArt PPeak τVi τVe tEndInsp tEndExp Shunt VO2 VCO2 CBHb CBDPG

150 ml 0.50 kPa.s.nl-1 0.55 kPa 0.06 s 0.06 s 2.0 s 5.0 s 0.02 256 ml.min-1 206 ml.min-1 9.3 mmol.l-1 5 mmol.l-1

NSE

100

NTu

50

rtrachea

1.235 cm

Anatomical dead space volume Arteriolar resistance Peak inspiratory pressure Inspiratory flow acceleration speed Expiratory flow deceleration speed Inspiration time Total breath time Shunt fraction Oxygen consumption at STPD CO2 production at STPD Haemoglobin concentration in blood 2,3 diphospoglycerate concentration in blood Number of tube segments in anatomical dead space Number of cylindrical tubes in anatomical dead space Radius of Trachea

Appendix B. Anatomical dead space model Fig. 5 shows the anatomical dead space model. O2 flow in the anatomical dead space is a function of V , and a matrix ( n AD O2 (r j , z k ) ) representing radial (rj) and longitudinal (zk) distribution of O2 over a number of cylindrical tubes (NTu) and longitudinal segments (NSe).

Fig. 5. The anatomical dead space model. Each piece, Pi(j,k), is represented by a radial (j) and longitudinal (k) coordinate. Environment and alveolar ends are defined at k = 1 and k = NSe, respectively. It is assumed that each cylindrical tube has its own velocity of air and that no mixing among individual tubes occurs. All pieces are assumed to have equal volume (VPi). Cross sectional areas (Aj), of the cylindrical tubes are assumed equal. The shape of the velocity profile is determined by a friction factor, f, estimated from the amount of turbulence (Pedley and Kamm, 1997)(Streeter and Wylie, 1985). VPi, Aj, length of the anatomical dead space (LAD), and radii of the cylindrical tubes (rj), are calculated from cylindrical shape formulas. Velocity at radius r is estimated by Eq. 12 (Saleh, 2008).

516

8th IFAC Symposium on Biological and Medical Systems August 29-31, 2012. Budapest, Hungary

1/ n

r r  VAD ( r )  VAvg   AD   rAD 

 ( 1  n )( 1  2n )     2n2  

N Layers   n AD  Ai O2  V     Pi   V A i   i 1    N Layers n AD O2 ( j , k )    n AD  Ai O2    (1   j )  n AD O2 ( j , N Se )   j  V Pi     VA i  i 1     (1   )  n O ( j , k  N j AD 2 Full , j )   j  n AD O2 ( j , k  N Full , j  1 ) 



(12)



where VAvg is average flow and n is calculated from the Darcy friction factor f in Eq. 13. f can be approximated by Eq. 14 (Bock et al., 2000)( Papamoschou, 1995). n

f 

1 f

(13)

RAW   2  rAD 4 VTotal   Air  115

 V

FV j 

AD

 2r  dr

AD

 2r  dr

r  r j 1 rNTu

 V

r  r0

N Full, j  floor(

FV j  VTotal VPi

)

(16)

where floor() rounds to nearest integer less than or equal to the argument. Eq. 17 calculates the fraction of air in a cylindrical tube that cannot be shifted in a full piece (Φj). j 

FV j  VTotal VPi

VCF 

 N Full, j

 V Pi  PE , BTPS O2  R  TB    V Pi  PE , BTPS O2 n AD O2 ( j , k )   (1   j )  n AD O2 ( j ,1)   j   R  TB    (1   j )  n AD O2 ( j , k  N Full, j )   j  n AD O2 ( j,k  N Full, j  1 ) 

, for k  N Full, j  1

, for k  N Full, j  1 , for k  N Full , j  1

(18) where R is the gas constant. PE,BTPSO2 is environment O2 partial pressure at BTPS. During expiration longitudinal segments starting at k = NSe are filled with alveolar air, one segment mixes gas with expired gas from the alveoli, and the rest shift their gas towards the environment (Eq. 19).

TE  ( PB  PA  PB H 2O ) TB  ( PB  PE  PE H 2O )

(21)

PE H 2O  PH 2O ( TE )  SE H 2O

(22)

where PH2O(TE) is saturated water vapour pressure at environment temperature calculated by the Arden Buck equation, SEH2O is relative humidity in the environment. Flow between environment and dead space can during inspiration be calculated via the gas equation stated in Eq. 6. If the number of full segments in tube number j (NFull,j) exceeds NSe between two simulated time steps at expiration, some alveolar air will enter the environment directly. Eq. 23 describes flow between environment and anatomical dead space during expiration. N Full , j  NTu      n AD O2 ( j , k )   j  n AD O2 ( j , N Full , j  1)     j 1  k 1   n E  AD O2   N Layers  NTu  N Se    n O     AD  Ai 2   n AD O2 ( j , k )   ( N Full, j  N Se   j )  V Pi      V  A  j 1  i  z 1 i 1    



(17)

During inspiration segments from k = 1 are filled with gas from the environment, one longitudinal segment mixes gas with inspired gas and the rest shift gas towards the alveoli. The gas equation is used to express the number of O2 molecules in a tube segment (nADO2(j,k)) (Eq. 18).

(20)

where V is ventilation at ambient temperature, pressure and environment humidity, PB is barometric pressure, PA is alveolar pressure and PE is pressure in environment. PBH2O and PEH2O are water vapour pressures in the body and environment, respectively, and are calculated as shown for the environment in Eq. 22.

(15)

For each time step, Eq. 16 calculates the number of full pieces that are necessary to move inspired or expired gases.

, for k  N se - N Full, j

V is at BTPS in contrast to environment air. A volume conversion factor (VCF) from BTPS to ATPS is defined in Eqs. 20 and 21.

(14)

rj

, for k  N se - N Full, j

(19)

VE  V  VCF

where ρAir is density of air and RAW is airway resistance. Eq. 15 must be solved to calculate the fraction of air that travels through tube number j between two time steps, FVj.

, for k  N se - N Full , j









, if N Full, j  N Se

, if N Full, j  N Se

(23) During inspiration, flow between anatomical dead space and alveoli is calculated from total amount of molecules in pieces pushed into the alveoli. Eq. 24 describes this flow. Flows of O2 and CO2 between the anatomical dead space and alveoli are during expiration calculated by Eq. 7. N Se  VA N Tu    i     j  n AD O2 ( j, N Se  N Full , j )   n AD O2 (j,k)  , if NFull,j  N Se k  N Se  N Full , j  1  VTotal j 1    n AD  Ai O2   N Se  VA N Tu  VPi  PE , BTPS O2   i    ( N Full , j  N Se   j )    n AD O2 (j, k)  , if NFull,j  N Se R  TB VTotal j 1  k 1  

517

(24)