Next: Software Installation and Compilation
Up: Source Code
Previous: Flowchart and Functions
Although the human cardiovascular model upon which RCVSIM is
based accounts for a wide variety of hemodynamic behaviors, it
certainly cannot address arbitrary cardiovascular research objectives.
For example, if the researcher is interested in analyzing how stroke
volume is compromised at very high heart rates (150 bpm) in
the absence of cardiovascular regulation, the model, as described in
Section 2, would not be adequate because contracting atrial
compartments are not explicitly included. In such cases, the
researcher may utilize the RCVSIM source code as a basis for
facilitating the construction of a model which can address his
research objective. An outline of the major steps necessary for the
researcher to create different lumped parameter pulsatile heart and
circulation models and add new bandlimited regulatory systems (e.g.,
arterial chemoreflex) and resting physiologic perturbations (e.g.,
central oscillator) is provided below. Note that additional steps may
also be necessary depending upon the particular extension.
- Creating lumped parameter models of the pulsatile heart and
circulation.
- Name the new lumped parameter model (preparation) and
assign a unique number to it. This number will be used in
conditional statements which must be added to the code in order to
distinguish the desired preparation to be executed from the other
possible preparations (see, for example, the rk4.m source
code).
- Extend the MATLAB parameter vector (th) to include any
additional, necessary parameters. Add the new parameters (in the
correct format) to the parameter file (see Section 5.2).
Expand the function read_param.m so that it can read these
new parameters. If the researcher would like to implement the new
preparation in the MATLAB environment, the function header_def.m must also be altered accordingly (see
Appendix A).
- Create a function called preparation_init_cond.m to
generate the initial pressures, volumes, and flow rates. Call
this newly created function at the same point in simulate.m
as the function call for intact_init_cond.m.
- Create a function called preparation_eval_deriv.m to
calculate the derivative of the pressure values at a desired time
step. Call this newly created function from rk4.m analogous
to the function calls for intact_eval_deriv.m.
- Add code for calculating volumes and flow rates at the point
in simulate.m in which these waveforms are computed for the
other preparations.
- If necessary, pre-allocate additional memory for the simulated
data in simulate.m, expand matrices to be written in MIT
format in simulate.m and rcvsim.m, and extend code for
generating the MIT format header file in rcvsim.m.
- Adjust parameter update code in simulate.m including
conserve_vol.m.
- Add preparation_init_cond.m and preparation_init_cond.m to the make files (make.m and
makem.m) and recompile the code.
- Adding bandlimited regulatory system/resting physiologic
perturbation.
- Name the new regulatory system/resting physiologic
perturbation. This name will serve as a flag indicating whether
the new addition is to be activated or not. The MATLAB vector
flag at the start of simulate.m should be extended to
incorporate this name.
- Extend the MATLAB parameter vector (th) to include any
additional, necessary parameters. Add the new parameters as well
as the new flag name (in the correct format) to the parameter file
(see Section 5.2). Expand the function read_param.m so that it can read these new parameters and flag
name. If the researcher would like to implement the new model in
the MATLAB environment, the function header_def.m must also
be altered accordingly (see Appendix A).
- Initialize the necessary variables at the beginning of simulate.m.
- Create a function to compute the mandated change to the
adjustable parameter. Call this function every 0.0625 s. If this
function requires a simulated waveform as input, then this
waveform must be averaged over the previous 0.25 s every 0.0625 s
prior to the function call.
- If a parameter other than , , , and
is adjusted, then the following steps must be
undertaken:
- Pre-allocate additional memory for the adjustable parameter
matrix ap in simulate.m.
- Expand the thc vector in simulate.m to include
the new parameter to be adjusted.
- Linearly interpolate the newly adjustable parameter.
- Assign the mandated adjustment to the ap matrix in
simulate.m.
- Expand the ap matrix to be written in MIT format in
simulate.m and rcvsim.m.
- Adjust the parameter update code in simulate.m
accordingly.
- Extend code for generating the MIT format header file in
rcvsim.m to include the newly adjustable parameter.
- Add the new function to the make files (make.m and makem.m) and recompile the code.
Next: Software Installation and Compilation
Up: Source Code
Previous: Flowchart and Functions
Ramakrishna Mukkamala (rama@egr.msu.edu)
2004-02-03