Model of the Respiratory System

Lung Mechanics

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 10’s to 100’s of microns in diameter, airflow takes place by diffusion only. Obviously this is a non-linear system, but it can be treated as linear.

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.

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.


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 Kirchoff’s 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.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: