You are on page 1of 6

1.

Model of the Respiratory System


1.1 System Properties
The lungs have a reciprocating airflow from the mouth, through the airways: trachea, main bronchi, smaller branching bronchi, down to bronchioles, then finally into the alveolar ducts and alveoli. The alveoli are small air sacks where oxygen and carbon dioxide can be exchanged with blood in adjacent capillaries. The air flow is initially turbulent, then laminar, and finally, in the very small airways which are only 10s to 100s of microns in diameter, airflow takes place by diffusion only. Obviously this is a non-linear system, but it can be treated as linear.

The difference between mouth pressure and pressure inside the chest, driving the air flow can be simulated by a voltage, V. Similarly air flow can be modelled as a current, I. The resistance to air flow through the airways can be represented as an electrical resistance, R. By Ohms law
V = RI

The storage of air in the lungs can be represented by electrical capacitance. Here the quantity of air is represented by electrical charge, q, and the mechanical storage of this air is referred to as compliance. In the same way as a spring stores potential energy, the lungs store energy when filled with air. When applying a force to a spring (or in storing air in the lungs), the extent to which the spring is compressed or extended or the extent to which the lungs are inflated depends on its compliance. The stiffer the lungs are, the more pressure required to store a given amount of air in them and the less compliant they are. So the electrical capacitance, C, representing them is less.
q = Idt
0 t

q = CV

dV I =C dt

1 V = Idt C0

As well as storing potential energy, systems can store kinetic energy. This property is known as inertance. The electrical equivalent is inductance, L.

V =L

dI dt

1.2 Lung Mechanics


Although the lungs are a non-linear system, a linear model is a reasonable place to start. We can assume that the airways in the lungs can be divided into the larger, central airways and smaller peripheral airways. The larger, central airways are the trachea, main bronchi and first few branches of bronchi. The smaller, peripheral airways are the smaller branches of the bronchi and the alveolar ducts. The airflow resistance of the larger, central airways is RC and the resistance of the smaller, peripheral airways is RP. The capacity of the alveoli is given by CL. The alveoli are surrounded by the chest wall, which is also expanded as air enters the lungs. This has a capacity, CW, that is in series with the alveoli.

PaO

RC

PaW

RP

PA

CL

CS

Ppl

CW P0
A small fraction of the air that enters the respiratory system does not reach the alveoli and remains in the airways where it does not take place in the exchange of oxygen and carbon dioxide between air and blood. This volume of air is referred to as dead space. It is represented by a shunt capacitance, CS, in the circuit diagram above. This becomes increasingly important at high breathing frequencies as its impedance drops and more air is shunted away from the alveoli, CL. The pressures developed in this model are PaO at the mouth (airway opening), PaW in the central airways, PA in the alveoli and Ppl in the pleural space between the lungs and the chest wall. These pressures are referred to the ambient pressure, P0, which may be set to zero. Air flows are Q through RC, QA through Rp and Q QA through CS. Applying Kirchoffs First Law to the second loop of the circuit:

RPQA + (

1 1 1 + ) QAdt = (Q QA)dt CL CW CS

Equation 1

Applying Kirchoffs First Law to the first loop:

PaO = RCQ +

1 (Q QA)dt CS

Equation 2

Differentiating Equations 1 and 2 and eliminating QA:


d 2 PaO RC 1 dPaO 1 1 1 d 2Q 1 dQ + = RC 2 ( + ) + ( + )Q 2 dt RP CT dt dt CS RP CLT dt RP CS C L CW
Equation 3

This approach is known as a lumped parameter model. An alternative is the distributed parameter model. The distributed parameter model uses partial differential equations and gives a more accurate picture of a model with respect to its spread in time or space. A distributed parameter model can be likened to a lumped parameter model that is divided into many, finer, lumps. Solving these models can be done in a number of ways. As they are linear, the principal of superposition can be used. The models can be examined for their steady-state and transient responses separately. La Place transforms can be used to convert differential equations into the s-domain and transfer functions can be derived to find the gain and phase response of the system with respect to frequency. The impulse response can be found and convolution (multiplication in the s-domain) can be used to find the timeresponse of the system to any input. Higher order differential equations can be broken into a series of first order equations to give a matrix of equations which is then amenable to state-space analysis. MATLAB and SIMULINK use a mixture of LaPlace transforms and state-space analysis in a graphical form to make these tasks simpler.

1.3 LaPlace Transform, MATLAB and SIMULINK


Assume that the patient represented by the circuit diagram above has normal lungs with the following parameters: RC = 1 cm H2O s L-1, RP = 0.5 cm H2O s L-1, CL = 0.2 L cm H2O-1, CW = 0.2 L cm H2O-1, and CS = 0.005 L cm H2O-1. (The medical profession is very conservative and has stuck to this old system of units and refused to change to SI units. Pressure is measured in centimetres of water or millimetres of mercury.) Equation 3 can be converted by a LaPlace transform:
s 2 PaO ( s ) + R 1 1 1 1 1 sPaO = RC s 2Q( s ) + ( + C ) sQ( s ) + ( + )Q( s ) RP CT CS RP CT RP CS C L CW

This can be re-arranged to find the transfer function expressing airflow output as a function of pressure input:

1 s Q( s) RP CT = PaO ( s ) R s 2 + ( 1 + RC ) s + 1 ( 1 + 1 ) C CS RP CT RP CS C L CW s2 + = s 2 + 420 s s 2 + 620s + 4000

The model can now be implemented. Start MATLAB, then type simulink at the MATLAB prompt. Click on the Create a new model icon on the toolbar. A working window named untitled will open. Click on Continuous in the library window and this block will open on the right. Drag the Transfer Fcn block into the working window. Double click on the block to open the parameter window. Enter [1 420 0] into the numerator section and [1 620 4000] into the denominator section. Note that the square brackets and the 0 in the numerator are necessary. Click Apply and, if you wish, enlarge the transfer function block so you can see the full function. Click on the Sources block on the left of the library window and drag a Sine Wave block into the working window. Double click on this block to open its parameters window. Enter 2.5 for amplitude and 1.57 for frequency. Click Apply then OK. The amplitude is in zero-to-peak so the respiratory driving pressure (ventilator pressure) has a peak-to-peak swing of 5 cm H2O. The frequency of 1.57 radians per second gives 15 breaths per minute, about the average resting breathing rate. Click on the Sinks block and drag a scope onto the working window. Connect the components. Double click the scope and enter suitable ranges for the horizontal (time) and vertical axes. Click on Simulation in the working window, then on Parameters. Select a suitable time, then click Start and view the result on the scope. It is useful if you can view the input at the same time as the output, so add another scope and connect it to the sine wave source output. The volume of air delivered to the patient is critical when using a ventilator, so integrate the flow output and display it on another scope. It is desirable to store the results on a file so further processing can be done later. From the Sinks library block, drag a To file block and, through a multiplexor, send the input, output flow and volume to a file called lungmod1.mat. Create the file before you run the simulation. Double click on the multiplexor and set the number of inputs to 3. The final model should look something like the diagram below.

There was a lot of effort put into finding the transfer function of this model. In a more complex system this becomes a major task. Rather than calculate a transfer function, it is easier to model the circuit diagram of the lungs shown above. For a capacitor (or alveolar volume) the relationship between current (air flow) and voltage (pressure) is given by: I =C dV dt

In the model Q has been used instead of I and P instead of V. So the air flow into the lungs can be created by applying the pressure as an input signal to a simple amplifier (Math Operations gain) with a gain equal to the value of the alveolar compliance (capacitance). The output of the amplifier then feeds into a differentiator, whose output is then the air flow. So the model is constructed by working around the circuit diagram loops, in the same way as Kirchoffs Laws would be applied. The only problem that can arise is when all the blocks in a loop are all direct feedthrough blocks, such as amplifiers, differentiators and summers. In these cases MATLAB can become unstable and will not converge on a solution. To overcome this problem a memory block can be inserted in the loop to stabilise it. The memory block is found in the Discrete section of the library. Re-create the system above using this approach to replace the transfer function and verify that it performs the same as the previous model. Note in particular the phase of the air flow and volume with respect to the pressure and also note the amplitudes of the air flow and volume. Increase the ventilator cycle rate to 60 breaths per minute. Note what happens to the amplitudes and phases of the air flow and volume. Explain why there is a difference and what sort of effect it would have on the patient. People with asthma have an increase of their peripheral airways resistance. Change RP to 5.0 cm H2O s L-1 and repeat the experiment for ventilator cycle rates of 15 and 60 breaths per minute. Explain the result. People exposed to some noxious substances, such as the weed killer paraquat, develop pulmonary fibrosis, in which fibrous tissue replaces a lot of the lung tissue and the lungs

become stiffer. Restore RP to its normal value and change the alveolar compliance, CL to 0.02 L cm H2O-1 and repeat the experiment. Explain the result. After a few years, smoking is a bit like having severe asthma and inhaling paraquat at the same time. Change both RP and CL to their diseased values and repeat the experiment. What are your conclusions? This would be a person who has smoked 1 packet of cigarettes a day for about 20 years. How many years do you want to smoke for? Other diseases or accidents can affect the other parameters. For instance, inhaling food or an object can increase RC. A rare illness, ankylosing spondilitis, can sometimes cause the joints between the ribs and the spine to stiffen, so decreasing chest wall compliance. In this case CW decreases. In smokers, destruction of the normal bronchi causes an increase in dead space volume so that CS increases. If you wish, investigate the effects of these other diseases.
Reference: Michael C.K. Khoo: Physiological Control Systems. IEEE Press, New York, 2000.

1.4 Report
Write a report of about 5 pages. Include any additional material beyond that in the form of appendices. Ensure that your name and SID and the names of the other people in your group are on the front page of your report.

You might also like