The underlying mathematical models that produces data to simulate Harvard spirometer tracing will be explained in the following sections.


Since the aim is to build a 2D plot with x-and y-position in milimeter, it requires a function to generate y-axis data from x-axis data and other physiologic parameters.

Therefore, the goal here is to build a function \(f_{tracing}(x)\) that yields an output:

  • \(y\) = y-axis values (mm)

from inputs:

  • \(x\) = x-axis values (mm)

and physiologic parameters:

  • \(V_T\) = Tidal Volumes (ml)
  • \(f_R\) = Respiratory Rate (cycle/min)
  • \(\dot{V}_{O_2}\) = Oxygen consumption (L/hr)
  • \(v_{paper}\) = Paper Speed (mm/min)


\(f_{tracing}(x)\) can be decomposed into the sum of its 2 components: the respiratory waves function \(f_{wave}(x)\) and the oxygen line function \(f_{O_2line}\) that results from oxygen being consumed by the experimental subject (if the oxygen consumption (\(\dot{V}_{O_2}\)) is constant).


\[ f_{tracing}(x) = f_{wave}(x) + f_{O_2line}(x) \]


Next, I will provide methods to build \(f_{wave}(x)\) and then \(f_{O_2line}(x)\).

The Respiratory Waves Function

For simplicity, respiratory waves function \(f_{wave}(x)\) will be modeled from trigonometric sinusoidal function. In this case, I will use the cosine function cos().

The general form of cosine function that models position \(y\) as a function of the position \(x\) can be written as:


\[ y(x) = A \times cos(k x) \\ k = \frac{2\pi}{\lambda} \]

Where:

  • \(A\) = the amplitude of wave (mm)
  • \(k\) = the wave number (1/mm)
  • \(\lambda\) = wave length (mm)


To model respiratory waves,

the amplitude of wave (\(A\)) in mm can be expressed in terms of tidal volume (\(V_T\)) in ml, given that 1 mm in the y-axis = 30 ml.

\[ A = \frac{V_T}{2 \times 30} \]


And, the wave length (\(\lambda\)) in mm can be expressed in terms of respiratory rate (\(f_R\)) in cycle/min and paper speed (\(v_{paper}\)) in mm/min.

\[ \lambda = \frac{v_{paper}}{f_R} \]

Therefore, the respiratory waves function \(f_{wave}(x)\) can be written as:


\[ f_{wave}(x) = \frac{V_T}{60} \times cos(\frac{2\pi f_R}{v_{paper}} \times x) \]

Where:

  • \(V_T\) = Tidal Volumes (ml)
  • \(f_R\) = Respiratory Rate (cycle/min)
  • \(v_{paper}\) = Paper Speed (mm/min)

The Oxygen Line Function

Assuming that the rate of oxygen used by the subject is constant, the function that represents oxygen consumption \(f_{O_2line}\) could be modeled by the linear equation.

Since The simple linear equation is expressed in the following form:

\[ y(x) = \beta_0 + \beta_1 x \]

Where:

  • \(\beta_0\) = y-intercept
  • \(\beta_1\) = slope

Modelling slope (\(\beta_1\)) in terms of the oxygen consumption (\(\dot{V}_{O_2}\)) in L/hr and paper speed (\(v_{paper}\)) in mm/min can be written as follows.

\[ \beta_1 = \frac{ \dot{V}_{O_2} }{ v_{paper} \times 30 } \times \frac{1000}{60} = \frac{5 \dot{V}_{O_2} }{ 9 v_{paper} } \]

Therefore, the linear function \(f_{O_2line}\) which produces the oxygen line can be written as:


\[ f_{O_2line}(x) = \beta_0 + \frac{5 \dot{V}_{O_2} }{ 9 v_{paper} } \times x \]

Where:

  • \(\beta_0\) = y-intercept (mm)
  • \(\dot{V}_{O_2}\) = Oxygen consumption (L/hr)
  • \(v_{paper}\) = Paper Speed (mm/min)

The Harvard Spirometer Tracing Function

We have constructed the respiratory waves function \(f_{wave}(x)\):


\[ f_{wave}(x) = \frac{V_T}{60} \times cos(\frac{2\pi f_R}{v_{paper}} \times x) \]

and, the oxygen line function \(f_{O_2line}\).


\[ f_{O_2line}(x) = \beta_0 + \frac{5 \dot{V}_{O_2} }{ 9 v_{paper} } \times x \]

Since, the function that produces Harvard spirometer tracing \(f_{tracing}(x)\) can be written as the sum of \(f_{wave}(x)\) and \(f_{O_2line}\):

\[ f_{tracing}(x) = f_{wave}(x) + f_{O_2line}(x) \]

substituting \(f_{wave}(x)\) and \(f_{O_2line}(x)\) with above equations yields the final equation that produce Harvard spirometer tracing.


\[ y(x) = f_{tracing}(x) = \frac{V_T}{60} . cos(\frac{2\pi x f_R }{v_{paper}}) + \frac{5 x \dot{V}_{O_2} }{ 9 v_{paper} } + \beta_0 \]


Where:

  • Axis values:

    • \(y\) = y-axis values (mm)
    • \(x\) = x-axis values (mm)
  • Physiologic parameters:

    • \(V_T\) = Tidal Volumes (ml)
    • \(f_R\) = Respiratory Rate (cycle/min)
    • \(\dot{V}_{O_2}\) = Oxygen consumption (L/hr)
    • \(v_{paper}\) = Paper Speed (mm/min)
    • \(\beta_0\) = y-intercept

Last updated: 13 February 2022