BME 9502A/ECE 4455A/MEDBIO 4455A
User Guide to Case Study 2 MATLAB Files
Download Instructions: See the Case Study 1 User Guide for a reminder of the download
procedure for MATLAB files. This case study consists of four *.m scripts.
Top-Level Scripts:
LVAD_model.m evaluates the electric circuit model of the cardiovascular system supported by a
continuous-flow LVAD that was developed during the October 15 discussion session and further
detailed during the October 18 lecture. The script simulates 10 seconds of cardiovascular
activity. Different cases can be simulated by editing the character string variables defined on
lines 8-11. Set cond (i.e., condition) to 'H' or 'F' on line 8 to model a healthy or failing left
ventricle, respectively. Set act (i.e., activity) to 'R' or 'E' on line 9 to model the cardiovascular
response to rest or exercise, respectively. Set lvad on line 10 to 'y' or 'n' to model a patient with or
without LVAD support, respectively. If an LVAD is used, set temp on line 12 to specify the
LVAD flow rate in L/min. Remember to save LVAD_model each time you change temp or one
of the character strings.
The script can be executed by entering LVAD_model at the MATLAB command prompt. The
script displays the LV pressure-volume loop for the final second of the simulation and outputs
the total (LV + LVAD) cardiac outflow in L/min, the stroke volume (SV) in mL, and the systolic
and diastolic arterial pressures (Pa_systolic and Pa_diastolic). Vectors containing the time
samples, the left ventricular elastance waveform, and all of the important pressure, flow, and
volume waveforms are accessible in the MATLAB workspace for plotting and analysis after a
simulation.
LVAD_batch.m runs LVAD_model2.m, a version of LVAD_model that does not produce
graphical output, while incrementing the LVAD flow rate from 0 to 10 L/min for both resting
and exercising subjects. Set cond (i.e., condition) to 'H' or 'F' on line 3 to model a healthy or
failing left ventricle, respectively. Remember to save LVAD_batch each time you change cond.
The script can be executed by entering LVAD_batch at the MATLAB command prompt. The
script produces two figures: average total (LV + LVAD) cardiac outflow in L/min versus LVAD
output in L/min and LVAD output in L/min versus end-diastolic LV pressure in mmHg. In each
figure, data for a resting subject is plotted in blue and data for an exercising subject is plotted in
red.
In the first figure, the identity (y = x) line, where the LVAD produces 100% of the total flow, is
superimposed as a black dashed line.
In the second figure, several realizations of the Starling law supervisory control function (Eq. 1
in Mansouri et al. 2015) are plotted as a family of black curves with the scaling factor, K,
increasing from 0.1 to 1.0 in steps of 0.1. This graph may be compared to Figs. 1 and 2 from the
Mansouri et al. paper.
Supporting Scripts
Both of these scripts must be saved in the same folder as LVAD_model.m and LVAD_batch.m for
the simulations to run properly.
init_vectors.m defines and allocates memory for all of the waveform vectors used in an
LVAD_model or LVAD_model2 simulation. The comments in the script identify each vector and
its units. init_vectors is provided as a stand-alone script to collect this information in one location
for the convenience of the user.
LVAD_model2.m is a modified version of LVAD_model that is compatible with LVAD_batch.m.