You are on page 1of 6

Lung/Airway Dynamic Model

Using ABM Elements and PSPICE


Francesc N. Masana
Engineering Consultant
S.M. Palautordera, Barcelona, Spain
fmasana@coiot.cat

Abstract—The aim of the present work is the construction of lumps, two capacitors (elastances) corresponding to lung and
a nonlinear dynamic model of lung/airway mechanics using collapsible airway segment and three resistors, corresponding
generic instead of specific software, in an attempt to offer an to lung, collapsible airway and upper airway, all of them
open simulation environment. Based on the analogy between defined by nonlinear analytical expressions. A significant
pneumatic and electric magnitudes, an electrical equivalent difference with the preceding models is that it will be defined
circuit of the lung/airway mechanics is derived. Then, the inside an electrical circuit solving environment (PSPICE) by
nonlinear circuit elements are constructed by means of the means of the so called Analog Behavioral Modeling (ABM)
powerful Analog Behavioral Modeling (ABM) building blocks building blocks that will allow an easy definition and
and the system is solved using PSPICE. Five lumps are defined:
parameterization of the nonlinear functions describing the
two capacitors (elastances) corresponding to lung and collapsible
airway segment and three resistors, corresponding to lung,
model lumps and will in addition provide a very powerful
collapsible airway segment and upper airway. The model does graphic interface for the output of results.
not attempt to mimic any particular system by adjusting a given Apart from the model itself and its components, we will
set of parameters but instead to provide a tool to explore the focus on the role of the system excitation. Although pleural
relationship between a given parameter or set of parameters and pressure will be used as usual, it cannot be considered an
the system response, in particular for the Forced Vital Capacity independent driving force in the sense that, as stated in [10], the
(FVC) maneuver.
system can only be completely described if all three variables,
Index Terms—Respiratory System Model, Analog Behavioral i.e., pressure, flow and volume are simultaneously defined. But
Modeling, Nonlinear model, Open simulation environment, the pneumatical to electrical analogy that allows us to use an
PSPICE, FVC maneuver. electrical circuit solver as a general solving environment will
use the standard voltage-current representation, whose
I. INTRODUCTION pneumatical equivalence is pressure-flow. Then, volume has to
The human respiratory system, as many other complex be calculated as the integral of flow and care has to be taken in
systems, requires its complexity to be reduced if we want to order to preserve coherence of the results.
analyze it and be able to draw sufficiently general conclusions. Once the model is built, we will work by calculating the
That is precisely the objective of any model. response to various excitations and parameter values, in a kind
Two different groups of models can be identified: of “what if” approach. All this will set on an open simulation
fundamental models that use some numerical method, usually environment allowing us to easily explore the relationship
finite differences or finite elements, to solve the system between any model parameter or set of parameters and the
fundamental differential equations, and functional models, that system response that may eventually lead to a deeper
simplify the system before trying to solve it, usually by some physiological insight into the respiratory mechanics.
spatial averaging or lumping of the original system that reduces
its complexity while still keeping some or all of its functional II. MODEL EQUATIONS
description. Fundamental models achieve a large amount of Our model will contain five lumps: two capacitors
detail that sometimes may hide the conclusions on system (elastances) corresponding to lung and collapsible airway
functionality and are complex to describe due to the large segment and three resistors, corresponding to lung, collapsible
number of input parameters involved. On the other side, they airway and upper airway. Fig. 1 shows the model elements and
offer a very detailed description of any particular system. its relationship with anatomy.
Functional models, although having in common the spatial
averaging or lumping of the system, can present a varying Node 1 will be the pleural cavity, node 2 the alveolar space,
degree of complexity by using more or less lumps and defining node 3 the output side of the trachea, node 4 the output of
them through linear or nonlinear expressions, according to the collapsible segment and node 0 the outside world at
degree of detail required. In the study of the human respiratory atmospheric pressure that will be the reference for pressures
mechanics, numerous models have appeared in the related and will be given the value of zero.
literature, both fundamental [1], [2] and functional [3]-[9].
All the model elements are nonlinear and their expressions
In this work, we present a lumped nonlinear dynamic model will be developed in the following paragraphs.
following the approach in [3], [4], [7] and [8] by defining five
Although in [7] the term BS is made dependent on pleural
pressure PPL, for the sake of simplicity we will use a constant
value instead. We consider the difference of second order to the
results.
To reduce the number of parameters and introduce PL as the
independent variable instead of VL, we will further manipulate
(6) as follows:
k SVL k V
 RS  AS  exp  exp * S R  BS   
V  VR
*
V  VR
 A  exp kVL  BS
where:

  k S VR  
A  AS  exp
Figure 1. Lung/Airway Model
V *  VR

 kS  
A. Lung capacitance CL k
V  VR
*

The expression for lung capacitance CL is derived from the


lung pressure-volume relationship in [4] and [8]: Now, if we substitute VL for its value as a function of PL
calculated from (4) into the second term of (7) we get:
 PL  AL  expk L  VL   BL  
k
where PL is the transpulmonary pressure, VL the lung volume  P  kL
and AL, BL and kL are model parameters. To calculate the lung RS  A   L  1  BS  
capacitance is more convenient to put the volume as a function  AL 
of pressure so, from (1):
C. Collapsible airway capacitance CC
 1 P  BL  
VL   ln L When considering the collapsible airway capacitance we
kL AL have to keep in mind the structural properties of this particular
Then we have: airway segment. At high positive transmural pressure, the
airway can hardly stretch past its maximum volume so volume
dVL
  k L  PL  BL    is almost constant and capacitance is low. At high negative
1
CL 
dPL transmural pressure, the airway is completely collapsed and its
volume can hardly decrease below its minimum (fully
This expression yields negative CL values for PL<BL, which collapsed) value so capacitance is again low. This leads to a
has in fact no physical sense. Because the solving method starts sigmoid like volume to pressure curve. Accordingly, we will
its first guess at PL = 0 then we have to make sure that BL is use in our model a generic sigmoid curve of the form:
negative, which is not necessarily true if its value is the result
of an experimental value fitting as in [8]. To solve this problem  VC 1  

we will use the following expression instead of (1): VC max 1  exp PC  P0  P1 
 PL  AL  expk L  VL   1   where PC is the transmural pressure, VC is the collapsible
which yields the following result for CL: segment volume, VCmax is a parameter indicating the maximum
achievable volume of that segment and P0 and P1 are the
dVL sigmoid parameters. P0 gives the pressure value at half volume
  k L  PL  AL   
1
CL  and P1 adjusts the slope of the curve. From (11) the expression
dPL
for the collapsible airway capacitance turns to be:
In this way we solve the convergence problem and make
VL = 0 for PL = 0, which is coherent with physics. Moreover, dVC VCmàx
CC   
we spare one model parameter. dPC P1
 
B. Small airway resistance RS 1

The expression for small airway resistance RS follows from exp PC  P0  2 P1   expPC  P0  2P1 2
[7] and [8]:
  
RS  AS  exp k S  VL  VR  V *  VR  BS  
D. Collapsible airway resistance RC
We will use for the collapsible segment resistance the well
where once again VL is the lung volume, VR is the residual accepted expression from [3], [4] and [8]:
volume and AS, BS, kS and V* are model parameters.
V 
2 A remark has to be made concerning integrator 2 used to
 RC  kC   Cmàx    calculate the collapsible segment volume. Because this volume
 VC  is not zero for zero transmural pressure, an initial condition has
where VCmax has already been defined and kC is another to be introduced into CINT2. Its value can be calculated from
parameter. If we now substitute (11) into (13) we get: (11) for PC = 0.

 RC  kC  1  exp PC  P0  P1    VC max


2
 VC   
IC
1  expP0 / P1 
E. Upper airway resistance RU
The upper airway resistance will be modeled according to This value is not parameterized into the model so each time
[3], [4] and [8] as: VCmax, P0 or P1 are changed, it has to be reintroduced. This is
because the solving program does not allow to parameterize
 RU  AU  kU  IU   initial conditions.
where IU is the flow at the mouth and AU and kU are model In the section “PARAMETERS” all the model parameters
parameters. We will name the flow using the electric current are listed: five for the lung, four for the collapsible segment
symbol I throughout. As usual, upper airway resistance has a and two for the upper segment.
linear term AU plus a term proportional to air flow that takes Three more parameters are defined for the pleural pressure
turbulence into account. generator: the peak to peak amplitude Vval, the offset Voff and
the period TC.
III. SYSTEM EXCITATION
It has already been mentioned that we will use pleural V. SIMULATION RESULTS
pressure as system excitation. However, the flow that results Once the model is complete and parameterized, we will
from this pressure cannot take any value or form. In particular, start with simulations. The parameter values are extracted
it has to fulfill a condition: in steady state, the net volume from [8] and conveniently modified to the proposed model
increment that results from the integral of flow over one expressions and units. In particular, P0 and P1 have been
respiratory cycle has to be (approximately) zero, otherwise an adapted to fit the original (non-analytical) curve. Table 1 shows
unlimited lung inflation or deflation will result, which is of the values for four different subjects as in [8], along with the
course impossible. Thus, we have to make sure that the units. Pascal is used for pressure and liter for volume. For those
function we use for pleural pressure, apart of reasonably used to pressure in cm·H2O, the equivalence is approximately
emulating the respiratory cycle is consistent with that fact. 1cm·H2O ≈ 100 Pa (98.0665 to be more exact).
We will run some simulations to show the influence of
different parameter values on model elements and then proceed
with FVC maneuver.
TABLE I. PARAMETER VALUES
Subject nº
Param. Units
1 2 3 4
kL 1.00 1.00 1.00 0.80 l-1
AL 19.61 3.92 9.81 55.90 Pa
Figure 2. Pleural pressure generator
k -2.685 -1.198 -0.956 -0.940 l-1
A 6022 3166 1129 3228 Pa/l.s
The pleural pressure generator we will use in our model is BS 1.96 1.96 1.96 1.96 Pa/l.s
illustrated in Fig. 2. The generator VPL is a pulse generator of kC 20.59 48.05 49.03 23.54 Pa/l.s
which we can adjust both rise and fall times, pulse duration, P0 500.00 500.00 500.00 500.00 Pa
period and high and low voltage (pressure) values. P1 400.00 750.00 1200.00 1350.00 Pa
The network CPL-RPL is a high pass filter to remove any DC V Cmax 0.185 0.125 0.165 0.101 l
component from signal and guarantee that the positive and AU 33.34 30.40 30.40 30.40 Pa/l.s
negative areas are equal. VO is a DC generator to finally add a kU 45.11 39.23 31.38 19.61 Pa/(l.s)2
controlled amount of offset and E1 is a voltage controlled V* 5.30 10.30 8.41 7.37 l
VR 1.24 2.04 1.61 1.91 l
voltage source to isolate the simulated circuit from the high VT 5.19 8.27 6.34 7.20 l
pass network.
IV. THE COMPLETE MODEL We have to note at this point that lung volumes displayed
Now that we have described all the necessary elements, we are relative, that is, considering lung residual volume is zero.
can build the complete model. Fig. 5 shows the model We could add residual volume as an initial condition to the
schematics that include the five mentioned lumps, the pleural integrator but it has no much interest. Nevertheless, the small
pressure generator and two integrators to compute lung and airway resistance calculation is done taking into account
collapsible segment volumes. Numbered nodes correspond residual volume whose influence is included in A and k. On the
with those of Fig. 1. Also, both integrators are sampled by VINT other side, collapsible segment volume is the real volume
to skip the transient phase. More on that later. because in that case the initial condition is a must.
A. Model elements Fig. 4 shows the resulting spirometric curves relating lung
Fig. 6 shows the simulation results for: a) Lung volume and flow at the mouth. Subject #4 has the lowest
compliance, b) Small airway resistance, c) Collapsible segment volume due to the low lung elastance and the highest flow due
compliance and d) Collapsible segment resistance. The to the lower upper airway resistance. Subject #1 has a slightly
excitation applied is the same as in the FVC maneuver. lower flow-volume curve than subjects #2 and #3 due to lower
lung elastance affecting the volume whereas the flow is quite
In Fig. 6a we see the influence of AL on the lung volume at similar.
a given pressure. In the curve of Subject #4 it can also be seen
a higher slope, i.e., higher lung elastance due to a lower kL
value. In Fig. 6b, the y axis is in logarithmic scale for more
clarity. The lower the value of k, the smoother the knee
whereas the value of A sets the maximum RS value. In Fig. 6c,
the value of P1 sets the slope and thus the elastance. In Fig. 6d,
the value of P1 sets again the slope and kC the value of
resistance when segment is not collapsed, i.e., when transmural
pressure is high and positive.
B. FVC maneuver
To simulate the FVC maneuver, the excitation parameters
are set as listed in table 2 whereas Fig. 3 displays the excitation
waveform for pleural pressure.

Figure 4. Simulated spirometric curves for FVC maneuver

TABLE II. EXCITATION VALUES FOR FVC

Param. Value Units

tr 500.00 ms
tf 100.00 ms
pw 500.000 ms
TC 10 s
Vval -7000.00 Pa
Figure 3. Pleural pressure waveform for FVC Voff 0.00 Pa
CPL 1.00 l/Pa
RPL 0.70 Pa/l·s

Figure 5. Complete model schematic


Figure 6. Simulation results for: a) Lung compliance, b) Small airway resistance, c) Collapsible segment compliance, d) Collapsible segment resistance.

VII. CONCLUSIONS
In the preceding paragraphs we have set up a model for
Lung/Airway dynamics that is solved in PSPICE, a powerful
electric circuit solver. After developing analytical expressions
for the model elements we have shown how to implement them
by means of ABM building blocks and finally constructed a
complete model with five lumps: two capacitors (elastances)
and three resistors. Also we have worked out an excitation
Figure 7. Gated integrator circuit to mimic the best the pleural pressure waveform while
keeping consistency. Finally, a gated integrator has been built
VI. VOLUME CALCULATION to calculate the lung and collapsible segment volume in a
consistent way. Results from simulations have not been
It has been said that the simulation environment works on compared to other author’s because this is not the aim of this
the basis of pressure-flow variables and consequently volume work. The present model, as any general model, does not try to
has to be calculated as the integral of flow. This is the trickiest mimic any particular situation, so the fitting accuracy to a
part of the simulation. On one side, the value of a definite particular experiment is not the question. The question is
integral depends on the integration limits but, on the other side, consistency of results with physical facts. A good fitting could
the way the circuit solver works is by applying a time step and eventually be obtained by adjusting parameter values, as in [8].
calculating the next point as a function of the previous one, Being a general model that works in a standard solving
starting from zero. So the difficulty arises when we have to environment as PSPICE, anyone can use it to its own purposes
define integration limits because, unless something is done, the and even modify it at will to fit to a particular situation. Also,
lower limit will always be zero and this may not correspond to the fact that element functions can be defined through a table
the real situation. We have implemented a way around this allows the model to be adapted more precisely to a particular
problem with the use of what we call a “gated integrator”. The set of experimental data, not forgetting that convergence to a
schematic of such a device is shown in Fig. 7.
solution may impose some restrictions. Finally, the “what if” [5] K.R. Lutchen, F.P. Primiano, Jr. and G.M. Saidel. “A Nonlinear Model
approach can easily be implemented and will be especially Combining Pulmonary Mechanics and Gas Concentration Dynamics”.
IEEE Tr. On Biomedical Engineering, Vol. BME-29, No. 9, pp 629-641,
useful to investigate the influence of the different model Set. 1982.
parameters on the result and gain some insight into the way [6] S. Abboud, O. Barnea, A. Guber, N. Narkiss and I. Bruderman.
some characteristics of respiratory system can affect its “Maximum expiratory flow-volume curve: mathematical model and
functionality. experimental results”. Mod. Eng. Phys. Vol. 17, No5, pp 332-336, 1995.
[7] C.H. Liu, S.C. Niranjan, J.W. Clark, Jr., K.Y. San, J.B. Zwischenberger,
REFERENCES and A. Bidani. “Airway mechanics, gas exchange and blood flow in a
[1] Y. Fan, K. Cheung, M.M. Chong, H.D. Chua, K.W. Chow and C.H. Liu. nonlinear model of the normal human lung”. J. Appl. Physiol., Vol. 84,
“Computational Fluid Dynamics Analysis on the Upper Airways of pp 1447-1469, 1998.
Obstructive Sleep Apnea Using Patient-Specific Models”. Intl. Journal [8] A. Athanasiades, F. Ghorbel, J.W. Clark, Jr., S.C. Niranjan, J. Olansen,
of Computer Science. Vol 38, No 4. Advance Online Publication.. Nov. J.B. Zwischenberger, and A. Bidani. “Energy Analysis of a Nonlinear
2011. Model of the Normal Human Lung”. J. of Biological Systems, Vol. 8,
[2] K.S. Burrowes, A.J. Swan, N.J. Warren and M.H. Tawhai. “Towards a No 2, pp 115-139, 2000.
virtual lung: multi-scale, multi-physics modelling of the pulmonary [9] A.G. Polak and K.R. Lutchen. “Computational Model for Forced
system”. Phyl. Trans. Of The Royal Society A, Vol. 366, pp 3247-3263, Expiration from Asymmetric Normal Lungs”. Annals of Biomedical
July 2008. Engineering, Vol. 31, pp 891-907, 2003.
[3] J.F. Golden, J.W. Clark,Jr. and P.M. Stevens. “Mathematical Modelling [10] D.L. Fry and R.E. Hyatt. “A Unified Analysis of the Relationship
of Pulmonary Airway Dynamics”. IEEE Tr. On Biomedical Between Pressure, Volume and Gasflow in the Lungs of Normal and
Engineering, Vol. BME-20, No. 6, pp 397-404, Nov. 1973. Diseased Human Subjects”. American Journal of Medicine, pp 672-689,
[4] M.F. Olender, J.W. Clark, Jr. and P.M. Stevens. “Analog Computer Oct. 1960.
Simulation of Maximum Expiratory Flow Limitation”. IEEE Tr. On
Biomedical Engineering, Vol. BME-23, No. 6, pp 445-452, Nov. 1976.

You might also like