gigablochs.flow.exp_decay_train

gigablochs.flow.exp_decay_train#

gigablochs.flow.exp_decay_train(start=0, stop=2, num=1000, interbeat_interval=0.917, systolic_velocity=0.7, diastolic_velocity=0.08, decay=8, phase=0, **kwargs)[source]#

Generate a blood flow velocity waveform using an exponential decay train.

This is a very crude yet smooth model of blood flow in the carotids based on empirical blood flow velocity from Doppler Ultrasound measurements. Estimated from a figure in an anesthesiology textbook that I unfortunately lost the reference for :( See holdsworth_cca for a more accurate CCA model.

Parameters:
  • start (float, optional) – The starting time of the waveform in seconds. Default is 0.

  • stop (float, optional) – The stopping time of the waveform in seconds. Default is 2.

  • num (int, optional) – The number of time points to generate. Default is 1000.

  • interbeat_interval (float, optional) – The interval between heartbeats (the pulse period) in seconds. Default is 0.917.

  • systolic_velocity (float, optional) – The peak systolic velocity in m/s. Default is 0.7.

  • diastolic_velocity (float, optional) – The diastolic velocity in m/s. Default is 0.08.

  • decay (float, optional) – The unitless decay rate of the exponential function. Default is 8.

  • phase (float, optional) – The phase shift of the pulse train in radians. Default is 0.

  • **kwargs (dict) – Additional keyword arguments to pass to the integrate_trajectory function.

Returns:

  • time_steps (ndarray) – Array of time points in seconds.

  • velocity_waveform (ndarray) – Array of blood flow velocities in m/s corresponding to the time points.

  • position_waveform (ndarray) – Array of blood flow position for a sample bolus in m.

Notes

The exponential decay train is generated by convolving a pulse train (or dirac delta comb) with an exponential decay function.

See also

holdsworth_cca

Examples

from bokeh.plotting import figure, show
from bokeh.io import output_notebook
output_notebook()

from gigablochs import flow

time, velocity, position = flow.exp_decay_train()

plot = figure(title='Approximate Carotid Bloodflow Model', x_axis_label='Time (s)', y_axis_label='Bloodflow',
              width=680, height=400)
plot.line(time, velocity * 100, legend_label='Velocity (cm/s)', line_color='blue')
plot.line(time, position * 100, legend_label='Position (cm)', line_color='purple')
plot.legend.click_policy = 'hide'
show(plot)