Analytical Solution to a Simplified ... Model using Piecewise Linear Elastance ...

advertisement
Analytical Solution to a Simplified Circulatory
Model using Piecewise Linear Elastance Function
by
Jinn Jiau Spenser Chen
B.Eng., Electrical and Electronic Engineering (2002)
Imperial College London
Submitted to the Department of Electrical Engineering and Computer
Science
in partial fulfillment of the requirements for the degree of
Master of Science in Electrical Engineering and Computer Science
at the
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
September 2003
© Jinn Jiau Spenser Chen, MMIII. All rights reserved.
The author hereby grants to MIT permission to reproduce and
distribute publicly paper and electronic copies of this thesis document
in whole or in part.
A uthor .........................
Department of Electrical Engineering and Computer Science
July 13, 2003
Certified by........
..
George C. Verghese
--,Professor of Electrical Engineering
ksis
'pervisor
.........
Arthur C. Smith
Chairman, Department Committee on Graduate Students
Accepted by.......
MASSACHUSETTS INSTITUTE
OF TECHNOLOGY
OCT 15 2003
LIBRARIES
BARKER
Analytical Solution to a Simplified Circulatory Model using
Piecewise Linear Elastance Function
by
Jinn Jiau Spenser Chen
Submitted to the Department of Electrical Engineering and Computer Science
on July 13, 2003, in partial fulfillment of the
requirements for the degree of
Master of Science in Electrical Engineering and Computer Science
Abstract
Due to the strong analogy between electrical circuits and fluid systems, circuit-based
lumped parameter representations of the hemodynamic system are commonly used
in teaching and research to analyze the system-level behavior of the circulation over
time scales of a few to a few hundred beats. While efficient numerical methods
exist for integration of the governing differential equations, we present an analytical
solution of the pressure (voltage) waveforms in a simplified time-varying elastance
model, or pulsatile heart model. The pumping action of the heart is captured by the
ventricular compartment, which is primarily made up of a time-varying capacitor.
We define the time-varying capacitance as the inverse of a piecewise linear elastance
function that is a close fit to population-averaged hemodynamic data. The analytical
solution provides an explicit mathematical description of the circuit model dynamics
without the need for a numerical solver to integrate the differential equations, thereby
reducing computational complexity. A comparison of the analytical solution against
a numerical simulation of the pulsatile model in terms of steady-state and transient
responses showed that the maximum relative error is no more than 1.79% across the
waveforms. Moreover, it allows for the representation of the pressure waveforms by
a set of discrete-time points per cycle, which we term the discrete-time analytical
solution, without any loss of information. The discrete-time analytical solution is
shown to reduce the simulation time of the pulsatile model by a factor of 5000. The
analytical solution can potentially aid in developing procedures for estimating model
parameters. Extension of the approach outlined above to a dual chamber heart and
more elaborate peripheral circulatory model will constitute worthwhile directions for
further work.
Thesis Supervisor: George C. Verghese
Title: Professor of Electrical Engineering
Associate Supervisor: Thomas Heldt
Title: Doctoral Student, Harvard-MIT Division of Health Sciences & Technology
3
4
Acknowledgments
First, I would like to thank my thesis advisor, Professor George Verghese, for all
his invaluable help and patient guidance throughout the last year. He was always
available to guide me through the problems I encountered in the project, and to
offer advice on classes and life in MIT, which helped me settle down quickly into a
new environment here, having come from Imperial College in London. His insight,
experience and enthusiasm helped make this project possible.
Special thanks to Thomas Heldt who was always there to answer my questions
and I am grateful to him for all the help he rendered me with thesis writing, Latex
and C programming among many other things. In addition, I would like to thank
Professor Roger Mark for giving me the opportunity to work in the Laboratory for
Computational Physiology, where I had the chance to work with a group of brilliant
and highly motivated students and researchers.
I would also like to express my gratitude to the Singapore Armed Forces for their
financial support over the past four years, without which none of these would be
possible.
Finally but most importantly, special thanks to my parents, my sister and all the
friends I have made here for their unwavering support and encouragement throughout
my time here at MIT.
5
Contents
1
2
3
13
Introduction
1.1
Computational Modeling . . . . . . . . . . . . . . . . . . . . . . . . .
14
1.2
Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
...........
17
1.2.1
The Computational Hemodynamic Model
1.2.2
Piecewise Linear Elastance . . . . . . . . . . . . . . . . . . . .
19
1.3
Problem Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . .
21
1.4
Goals and Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
Pulsatile Model with Piecewise Linear Elastance
25
2.1
Pulsatile Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
2.2
Simulation in HSPICE . . . . . . . . . . . . . . . . . . . . . . . . . .
27
31
Deriving the Analytical Solution
3.1
Dividing into Subproblems . . .
31
3.1.1
Notation . . . . . . . . .
33
3.1.2
Approach Outline
33
3.1.3
Region I . . . . . . . . .
34
3.1.4
Region II
. . . . . . . .
36
3.1.5
Region III . . . . . . . .
38
3.1.6
Region IV . . . . . . . .
41
3.1.7
Region V
. . . . . . . .
41
3.1.8
Region VI . . . . . . . .
43
3.1.9
Region VII
.
.
45
. . . . . . .
7
3.2
3.3
4
6
46
Implementing the Analytical Solution . . . . . . . . . . . . . . . . . .
48
3.2.1
MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
48
3.2.2
C Programming Language . . . . . . . . . . . . . . . . . . . .
48
Discrete-time Analytical Solution
. . . . . . . . . . . . . . . . . . . .
50
Comparison of Simulations
53
4.1
Comparison of Steady-state Numerics . . . . . . . . . . . . . . . . . .
54
4.2
Comparison of Dynamic Responses
. . . . . . . . . . . . . . . . . . .
57
4.2.1
Changes in R 3 . . . . . . . . . . . . . . . . . . . . . . . . . . .
57
4.2.2
Changes in T . . . . . . . . . . . . . . . . . . . . . . . . . . .
60
Computational Efficiency . . . . . . . . . . . . . . . . . . . . . . . . .
64
4.3
5
3.1.10 Initializing the Next Cycle . . . . . . . . . . . . . . . . . . . .
Extension Work
65
5.1
Model Parameter Sensitivity . . . . . . . . . . . . . . . . . . . . . . .
65
5.2
Elastance Parameter Estimation . . . . . . . . . . . . . . . . . . . . .
67
Conclusion
71
A Mathematical Working
73
A.1
Deriving V2 1(t) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
73
A.2
Deriving Qh3(t)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
75
A.3
Deriving Qh6(t)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
77
A.4 Deriving Qh7(t)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
78
B Program Codes
79
B.1 Analytical Solution in MATLAB . . . . . . . . . . . . . . . . . . . . .
79
B.2 Analytical Solution in C . . . . . . . . . . . . . . . . . . . . . . . . .
86
B.3
96
Discrete-time Analytical Solution in C
Bibliography
. . . . . . . . . . . . . . . . .
105
8
List of Figures
.
1-1
The human heart [13] ..........................
1-2
Circuit-based hemodynamic model [4] . . . . . . . . . . . . . . . . . .
1-3
Piecewise linear elastance function vs. experimental elastance data [12]
14
18
of the left ventricle over 1 cardiac cycle . . . . . . . . . . . . . . . . .
20
2-1
Simplified three-compartment circulatory model . . . . . . . . . . . .
26
2-2
HSPICE simulation output of the pulsatile model using piecewise linear
elastance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3-1
29
Steady-state voltage waveforms (top) and piecewise linear elastance
function (bottom) divided into seven regions over 1 cycle . . . . . . .
32
3-2
Equivalent circuit model for Region I . . . . . . . . . . . . . . . . . .
34
3-3
Equivalent circuit model for Region II . . . . . . . . . . . . . . . . . .
36
3-4
a) Equivalent circuit model for Region III b) Modified circuit model
(R2 = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
38
3-5
Plot of function f(t) and the constant approximation c . . . . . . . .
40
3-6
Plot of function g(t) and the linear approximation h(t) . . . . . . . .
44
3-7
Voltage waveforms generated by the analytical solution in MATLAB .
49
3-8
Voltage waveforms generated by the analytical solution in C
. . . . .
49
3-9
Representation of full voltage waveforms by discrete-time points over
1 cycle (top); discrete-time voltage waveforms (bottom) . . . . . . . .
4-1
51
Steady-state voltage waveforms generated by circuit simulation (top)
and analytical solution (bottom) of the pulsatile model . . . . . . . .
9
55
4-2
Comparison of steady-state dynamics of V (top), V2 (middle) and Vh
(bottom ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4-3
Transient responses of circuit simulation (top) and analytical solution
(bottom) of the pulsatile model to changes in R 3 . . . . . . . . . . . .
4-4
59
Transient responses of circuit simulation (top) and analytical solution
(bottom) of the pulsatile model to changes in T
4-6
58
Comparison of transient dynamics of V (top), V 2 (middle) and Vh
(bottom) due to changes in R 3 . . . . . . . . . . . . . . . . . . . . . .
4-5
56
. . . . . . . . . . . .
62
Comparison of transient responses of V (top), V2 (middle) and Vh
(bottom) to changes in T . . . . . . . . . . . . . . . . . . . . . . . . .
10
63
List of Tables
17
1.1
Analogy of physiological and electrical variables
2.1
System parameters
3.1
Definition of the 7 regions
4.1
Characteristic variables of voltage waveforms . . . . . . . . . . . . . .
53
4.2
Comparison of steady-state responses . . . . . . . . . . . . . . . . . .
54
4.3
Comparison of transient responses to changes in R3 . . . . . . . . . .
58
4.4
Comparison of transient responses to changes in T . . . . . . . . . . .
60
4.5
Comparison of CPU times . . . . . . . . . . . . . .
. . . . . . . . . .
64
5.1
Numerical sensitivity analysis of model parameters
. . . . . . . . . .
66
.
. . . . . . . . . . . . . . . . . .
27
. . . . . . . . . . . . . .
32
11
12
Chapter 1
Introduction
The human circulatory or cardiovascular system circulates blood around the body,
in order to deliver oxygen and nutrients to all parts of the body and to remove
metabolic waste products; it also plays an important role in the functioning of the
immune system. The human cardiovascular system consists of two structurally distinct components: the heart, which is a muscular pump, and the blood vessels in
which the blood flows.
There are three varieties of blood vessels: arteries, veins and capillaries.
The
arteries carry blood away from the heart. The capillaries are very thin vessels where
the actual oxygen and nutrient exchange takes place, and which form the interface
between arteries and veins. Finally, the veins carry the blood back to the heart. The
arterial system is characterized by high resistance and low capacitance, while the
venous system has low resistive and high capacitive properties.
Figure 1-1 shows a schematic drawing of the human heart [13].
The heart is
primarily a muscular shell. There are four chambers inside the heart that fill with
blood. Two of these chambers, the atria, form the curved top of the heart, while
the other two, called ventricles, meet at the bottom of the heart to form a pointed
base. The left and right sides of the heart each houses one atrium and one ventricle,
with a valve connecting the atrium to the ventricle below it. De-oxygenated blood
returning from the body enters the heart in the right atrium. From the right atrium,
the blood passes through the tricuspid valve to enter the right ventricle. The blood is
13
then pumped into the pulmonary arteries, passing the pulmonary valve, from where
it goes to the lungs. After becoming oxygenated in the lung's capillaries, the blood is
carried by the pulmonary veins to the left atrium. It then passes through the bicuspid
or mitral valve into the left ventricle, from where it is pumped into the aorta through
the aortic valve. The aorta branches into smaller and smaller arteries that finally
lead to capillary beds in the tissue. Here oxygen is exchanged for carbon dioxide.
The blood eventually empties back into the right atrium via veins which join into the
inferior vena cava (veins coming from the lower body) and superior vena cava (from
the upper body).
Superior
\kmacava
ulmona
y
Artery
Figure 1-1: The human heart [13]
1.1
Computational Modeling
Computational models are widely used by engineers and researchers as quantitative
representations of physical and non-physical systems for simulation studies. Presently,
14
many computational models of the human body systems are becoming rapidly available as biomedical engineering researchers combine knowledge of the human anatomy
with the processing power of modern computers to construct simulations of the human
organs. Computational modeling and simulation studies can facilitate the advancement of biomedical research through the design and testing of new therapeutics,
including medical devices, pharmaceuticals and clinical procedures, because these
models, particularly of the heart, can accurately predict and simulate system responses to perturbations in physiological conditions at the molecular, cellular and
organ levels. Moreover, computational modeling in cardiovascular research offers a
more cost-effective alternative to clinical testing, which often involves highly invasive
measurement procedures that are both expensive and time-consuming.
As described earlier, the human circulatory system is a highly complex and dynamic system, which requires the interaction and independent functioning of the
heart, pulmonary circulation and systemic circulation to ensure its own proper functioning. Despite the complexity, biomedical engineering researchers have developed
computational models of the circulatory system, capable of simulating cardiovascular
dynamics over a broad range of biological levels and time scales, from molecular to
organ level and from a single heartbeat to several thousand cardiac cycles.
1.2
Background
Due to the strong analogy between electrical circuits and fluid systems, electrical
models are widely used in computational modeling of the cardiovascular system. In
general, for a closed fluid system, there is an electrical circuit whose behavior is identical (up to conversion factors).
Pressure differences in the circulatory system are
created by the pumping action of the heart, which moves the blood from a region
of high pressure to a region of low pressure.
Similarly, electric current flows from
regions of high potential to regions of low potential and is impeded by circuit resistances. Thus, in an electrical analog of the cardiovascular system, blood flow would
map to electric current, pressure differences to voltage, and flow resistance to ohmic
15
resistance.
At the organ level, description of the heart as a pump has been dominated by models based on a time-varying ventricular elastance, or its inverse, compliance. Elastance
is a measure of chamber stiffness and thus ventricular elastance is a measure of the
contractile state of the heart. The time-varying elastance-based ventricle models have
proven to be useful representations of the right and left heart, and when coupled to
appropriate models of the pulmonary and systemic circulations, allow for simulation
of realistic pulsatile pressure and flow waveforms.
The classical definition of (incremental) elastance E, relates a true differential
volume &U and pressure &P:
E=
(1.1)
In defining ventricular elastance, Suga (1969) opted for the definition of elastance as
the ratio of ventricular volume and pressure:
E(t) =
P(t)
U(t)
(1.2)
where E(t), P(t) and U(t) represent the instantaneous elastance, pressure and volume
respectively at time t. More precisely,
P(t)
U(t) - Uo
-> Ud(t) =
P(t)
Ud(t)
E(t)
(1.4)
where U0 denotes the zero-pressure volume, and Ud(t) denotes the distending volume.
A description of the charge Q(t) on a capacitor with capacitance C(t) and potential
difference V(t) in an electrical circuit is given by:
Q(t) = C(t)V(t)
(1.5)
Clearly, an analogy exists between Equation 1.4 and 1.5, where electric charge corresponds to distending blood volume, and elastance to the inverse of capacitance. Table
16
1.1 shows the correspondence between physiological and electrical elements that we
have identified thus far.
Physiological
pressure
flow
flow resistance
compliance
elastance
volume
P
F
R
C
E
U
[mmHg]
[ml/min]
[mmHg - min/ml]
[ml/mmHg]
[mmHg/ml]
[ml]
Electrical
voltage
current
ohmic resistance
capacitance
elastance
charge
V [V]
I [A]
R [Q]
C [F]
E [F- 1 ]
Q [C]
Table 1.1: Analogy of physiological and electrical variables
Based on these relations, several electrical models of the cardiovascular system
have been constructed in order to produce and analyze hemodynamic waveforms in
a controlled setting. In the next section, we will look at a circuit-based, lumped
parameter model of the human circulatory system, which has been developed by
Davis [4] to simulate short-term transient and steady-state hemodynamic responses
to various physiological conditions.
1.2.1
The Computational Hemodynamic Model
Figure 1-2 shows a closed-loop lumped parameter hemodynamic model that is mathematically formulated in terms of an electric analog model. The model consists of
six compartments, each of which is made up of linear resistors, ideal diodes, voltage sources and/or capacitors that can be linear or nonlinear, and time-invariant or
time-varying.
The pumping action of the heart is realized by the time-varying capacitors, which
represent the time-varying compliances of the right and left ventricles. The diodes
are in place to ensure unidirectional current flow, just as valves in the heart ensure
unidirectional flow of blood through the ventricles and parts of the venous system.
A time-varying voltage source simulates the changing transmural pressure across the
intrathoracic pressure variations, and assumes a simple sinusoidal function in the
model.
17
Pulmonary Circulation
Systemic Circulation
Figure 1-2: Circuit-based hemodynamic model [4]
18
A more detailed discussion on the model components, as well as assignment of
parameter values, is given by Davis [4] and Heldt [6].
In summary, the model is
a lumped parameter representation of the human circulatory system, without the
feedback control loops to model arterial and cardiopulmonary baroreflexes. The heart
is described using time-varying ventricular compliance models, which are primarily
made up of time-varying capacitors.
1.2.2
Piecewise Linear Elastance
While there is no formal specification of the time-varying elastance, several reasonable choices have been suggested and used in hemodynamic models. Warner (1959)
appears to have been the first to adopt a compliance description for a dynamic heart,
in which he assigned one compliance value during diastole and another smaller value
during systole. As a result, the ventricle is analogous to an elastic bag that becomes
stiffer in systole, thereby producing an increase in ventricular pressure over this time
period. Defares et al. (1963) avoided the stepwise transitions between diastolic and
systolic compliance values by making elastance a continuously varying function of
time. Today, computational models of the cardiovascular system assume a host of
definitions of the ventricular elastance, including Warner's "2-state" compliance function, which is widely used for its simplicity.
Experimental data taken from Sunagawa [12] shows that both left and right ventricles are typically characterized by time-dependent elastances that vary between a
minimum (diastolic) value Ed and a maximum (end-systolic) value E, as shown by the
discrete-time points in Figure 1-3, which represent normalised population-averaged
data values of the left ventricle's elastance over one cardiac cycle. The solid line plot
clearly shows that a piecewise linear function is a close fit to the data points and is
therefore a realistic definition of the time-varying elastance.
19
1.2
experimental data
1
pwl approximation
0.8
0 0.6
N
*.0
~i<i
CD 0.4
01
19
cc 0.2
U
0
-0.2
' ' '
0
I
0.5
' 'I '
1
I II
1.5
I' ' I
2
Time (normalized units)
'I
I
2.5
'
'
3
Figure 1-3: Piecewise linear elastance function vs. experimental elastance data [12
of the left ventricle over 1 cardiac cycle
20
The piecewise linear elastance E(t) is defined mathematically as
E( Eat + Ed
E(t)
)Tf
E~
Ed-Est
+ 3E, - 2Ed
Ed2
Ed
0
< <t
T
T, < t < 1T,
8 < <
T, < t < T
(1.6)
E(t) increases linearly from the diastolic value Ed at the start of the cardiac cycle until
it reaches the end-systolic value E. This period of increasing elastance is termed the
systolic time interval T, which is defined to be one-third of the cycle period T:
1
TS= -T
3
(1.7)
The end of the systolic time interval marks the onset of diastole, and the elastance
decreases linearly from E, back to Ed over a time interval TJ. This period is referred
to as the rapid relaxation phase of the cardiac cycle and is approximately half of the
systolic time interval, i.e., TJ = IT. Following this, E(t) is constant at Ed for the
rest of the cycle period, and the next cycle begins. Here, we note that the rise and fall
times of the elastance are not fixed, even for a body at rest, as they are determined
by the cycle period T, which generally varies from cycle to cycle.
The piecewise linear elastance has several advantages over other elastance representations. First, it closely mimics experimental elastance data, so we expect simulation output of the computational model to be realistic representations of the hemodynamic waveforms.
Furthermore, the piecewise linear properties of the elastanc
function simplify the integration of governing differential equations, and reduce the
computational complexity involved in the numerical simulation of the computational
model.
1.3
Problem Motivation
The hemodynamic model that we have seen in Section 1.2.1 is but one of several
circuit-based computational models that have been developed to simulate cardiovas21
cular variables. The use of electrical components such as capacitors (and sometimes
inductors) in these models to represent compliance (and inertance) leads to differential equations that describe the system dynamics. Numerical implementation of the
models therefore involves solving numerically these differential equations, which are
normally of first order. In general, the number of governing differential equations
is the same as the number of compartments that make up the model. Hence, the
six-compartment computational model by Davis [4] is described mathematically by
six coupled first-order differential equations.
While there exist several efficient numerical methods for integrating the governing
differential equations, we seek a closed-form analytical solution to the computational
model, which consists of a set of mathematical functions that describe the physical
quantities of the model, such as voltages and currents. The idea of an analytical
solution is motivated by the piecewise linear elastance function, which we have defined in the previous section. The linearity of the various segments of the function
simplifies the numerical solution of the governing differential equations, leading to
closed-form voltage and current functions under certain conditions. The analytical
solution provides an explicit description of the system dynamics without the need for
a numerical solver to integrate the differential equations. Therefore, we expect the
analytical solution to be more computationally efficient than the numerical simulation
of the computational model.
Another motivation is the current trend in cardiovascular research, which is progressively leaning towards parameter estimation by both invasive and (preferably)
non-invasive methods. The end-systolic value E, and diastolic value Ed of the timevarying elastance are important elastance parameters, as they provide a complete
characterization of the time-varying elastance. Several methods have been devised to
determine these parameters from hemodynamic data and/or waveforms. The analytical solution to a computational model based on a time-varying ventricular elastance,
is a function of E, and Ed, and can therefore aid in developing a method to estimate
the elastance parameters from hemodynamic observations.
22
1.4
Goals and Outline
In this thesis, we study a simplified circulatory model, referred to as the pulsatile
single-ventricle heart model, based on the computational hemodynamic model developed by Davis [4]. We implement a numerical simulation of the model in HSPICE,
a circuit analysis software tool, by assuming a piecewise linear ventricular elastance.
Next, we derive a closed-form analytical solution to the pulsatile model by numerically
solving the governing differential equations to obtain closed-form voltage functions,
which we implement in MATLAB to compare against the HSPICE simulation output
of the model. We then evaluate the computational efficiency of the analytical solution
by comparing its computation time against the simulation time of the pulsatile model.
A numerical sensitvity analysis is performed on the model parameters to understand
how changes in the parameters affect the voltage functions. Lastly, we make use of
the analytical solution to construct an estimator for the elastance parameters based
on hemodynamic waveforms.
23
24
Chapter 2
Pulsatile Model with Piecewise
Linear Elastance
2.1
Pulsatile Model
The pulsatile model shown in Figure 2-1 is a simplified version of the six-compartment
hemodynamic model by Davis [4]. This simple model is made up of three segments: a
venous, an arterial and a ventricular compartment. The time-varying compliance C(t)
of the ventricle is represented by the time-varying capacitor, where C(t) is defined as
the inverse of the piecewise linear elastance E(t):
C(t) =
1
1(2.1)
E(t)
The diodes D 1 and D 2 are assumed to be ideal and are in place to ensure unidirectional current flow from the venous to the ventricular compartment, and then
from the ventricular to the arterial compartment. The ohmic resistances R 1 , R 2 and
R 3 represent the resistance to venous return, the aortic outflow resistance and the
arteriolar resistance, respectively.
The pulsatile model will be the basis for our analysis work, and we will derive an
analytical solution to the model with a view to extending the results to a more elaborate circulatory model. The voltages V, V 2 and Vh are of interest here, because they
25
represent the venous, arterial and ventricular pressures, respectively. During systole,
the ventricular pressure exceeds the arterial pressure, causing the aortic valve to open
and ventricular ejection to take place. For the pulsatile model, this corresponds to the
period during which Vh is greater than V2, and D 2 is forced into conduction as current
flows out of the time-varying capacitor C via R 2 into the rest of the system. On the
other hand, V is much lower than Vh and D, is non-conducting, just like valves in
the heart prevent back-flow of blood into the atria during the ejection phase.
R3
V1
R1
D1
Vh
D2
R2
V2
Ca
Figure 2-1: Simplified three-compartment circulatory model
As blood flows into the aorta, the arterial pressure rises along with ventricular
pressure, and only a very small pressure difference exists between the ventricle and
aorta, because the aortic valve opening offers little resistance to flow. This explains
why the diodes are assumed to be ideal as we want the on-state potential difference
to be as close to zero as possible.
Systole is followed by a period of ventricular
relaxation, or diastole, during which the aortic valve closes to prevent reverse flow
and the bicuspid valve opens, allowing the ventricle to fill with blood from the atrium.
In the pulsatile model, Vh is forced low by the rapidly decreasing elastance E(t) until
D 1 is forced into conduction, and current flows via R 1 into C. D 2 becomes nonconducting as Vh drops below V2 during this phase.
26
Simulation in HSPICE
2.2
We implement the pulsatile model in HSPICE, a widely used device level circuit
simulator, using the system parameters given in Table 2.1, where Vi0, V2 and Vho
denote the initial values of the voltage functions, respectively. The initial conditions
are chosen as such in order to simulate realistic hemodynamic waveforms, in which the
arterial pressure normally varies between a maximum (systolic) value of 120mmHg
and a minimum (diastolic) value of 80mmHg. The initial conditions also ensure the
system starts off in the end-diastolic state, which corresponds to that at the start of
the piecewise linear elastance function.
Es
Ed
2.5
0.1
T
1
Ca
2
Cv
100
R1
0.03
R2
0.01
fR3
1
V1 (0)
15.0337
V2 (0)
91.2281
Vh(0)
12.7383
Table 2.1: System parameters
The HSPICE code for the circuit simulation of the pulsatile model is shown here:
Pulsatile Heart Model * title
.option ingold=1 abstol=le-12
.option post=2
.option probe
.op
*set initial conditions
.ic V(n2)=15.0337 V(n4)=12.7383 V(n6)=91.2281
*define voltage source Vcap as piecewise linear elastance
Vcap nc 0 PWL 0 0.1V, 0.3333 2.5V, 0.5 0.1V, 1 0.1V, R 0
Rgrd nc 0 1meg
*define circuit connection and component values
Cv n2 0 C=100
27
R3 n2 n6 R=1
R1 n2 n3 R=0.03
Ch n4 0 C='1/V(nc)' CTYPE=1 *define time-varying capacitance using Vcap
R2 n5 n6 R=0.01
Ca n6 0 C=2
D1 n3 n4 diodel
D2 n4 n5 diodel
.model diodel D level=1 IS=1 *simulation of ideal diode
*transient analysis for t=10s at time step of 0.Ois
.tran O.Ois 10s
.print tran V(n2) V(n4) V(n6) V(nc)
.end
The code consists of three main parts. The first part initializes the voltage functions using the initial conditions stated in Table 2.1. The second part "builds" the
circuit model by defining the time-varying capacitance, the circuit connection between the electrical components and the component values. The last part runs the
simulation for 10s with a time-step of 10-2s, and generates the voltage waveforms as
simulation output of the pulsatile model.
Figure 2-2 shows the voltage waveforms generated by the HSPICE simulation of
the pulsatile model using the piecewise linear elastance. The period of the voltage
waveforms is the same as the period T of the time-varying elastance E(t). The changes
in Vh relative to V and V2 set the on-off states of the diodes, which in turn modify
the circuit and lead to further changes in the voltages. We will discuss the waveforms'
characteristics in the next chapter when we study the waveforms in greater detail in
order to derive an analytical solution to the pulsatile model.
28
140
Vh
--
v1
-V2
120
\
\
100
,j
/
\/
I
.1
80
C,
0)
60
-
-
40
20
A
0
0.5
1
1.5
2.5
2
3
3.5
4
4.5
time (s)
Figure 2-2: HSPICE simulation output of the pulsatile model using piecewise linear
elastance
29
5
-n~er
--
- .
-f+M
i-
.422
- .,--;;--;,
m
~ewPdgaNi rwsir
Y 2-
--- -:i
-74
. -r:-
-.;;
e:ra;
-.".--..-
.- :'-..--ss::1
.
:.-::
-
.
.
.
aa a v w
3W. O4--:-e
-- : - ,,4 .-
.-'
-
m
Chapter 3
Deriving the Analytical Solution
Deriving a closed-form analytical solution to the pulsatile model is made possible
by the piecewise linear elastance definition, which simplifies the numerical solution
of the governing differential equations. Due to the periodic nature of the elastance
function, the steady-state voltage waveforms are periodic with the same period T.
This simplifies the problem of deriving the analytical solution, as we only have to solve
the problem over one cycle. The on-off switching of the diodes D, and D 2 , coupled
with the piecewise linear properties of the elastance function, segment each cycle
period into seven distinct regions, which correspond to different elastance functions
and diode states of the pulsatile model. As such, we will derive the analytical solution
by solving the governing differential equations for each region separately.
3.1
Dividing into Subproblems
Figure 3-1 shows the steady-state voltage waveforms and the piecewise linear elastance
function divided into seven regions over one cycle. The regions are demarcated such
that each region is defined by a different linear elastance function, and a different
circuit representation of the pulsatile model as determined by the on-off states of D 1
and D 2.
31
120
V
VII
100-
Vh
--V1
-
> 80600
40200
28
28.2
28.4
28.6
28.8
29
2.5
II
II
V
VII
2o1.5
0.50
28
28.2
28.4
28.6
28.8
29
time (s)
Figure 3-1: Steady-state voltage waveforms (top) and piecewise linear elastance function (bottom) divided into seven regions over 1 cycle
Region
D,
D2
E(t)
I
II
III
IV
V
VI
VII
on
off
off
off
off
on
on
off
off
on
on
off
off
off
linearly increasing
linearly increasing
linearly increasing
linearly decreasing
linearly decreasing
linearly decreasing
constant
Table 3.1: Definition of the 7 regions
32
3.1.1
Notation
To facilitate the mathematical derivation of the analytical solution, the following
notation is adopted for the nth region:
start time
tn
end time
time duration
elastance
1
;
tn;
fn;
En(t);
venous voltage
arterial voltage
ventricular voltage
charge on C
Vn(t)
V2 n(t)
Vhn(t)
Qhn(t)
The start time of Region I, which also corresponds to the start time of the cycle,
is set to zero without any loss of generality. The time duration fn of the nth region
is defined to be the difference between the start and end times of the region, i.e.,
fn = tn - tn_ 1. VI(t) is assumed to be constant over one cycle, as it has a very small
peak-to-peak ripple of about O.4V. Therefore,
Vn(t) = V1 (0) for n = 1, ... , 7
(3.1)
where V 1 (0) is the initial condition of V(t) for the current cycle.
3.1.2
Approach Outline
We outline the general approach to deriving the analytical solution for the nth region. First, the initial conditions are obtained directly from the end conditions of the
preceding region within the same cycle. The equivalent circuit model and elastance
function are defined for the region. The numerical solution of the first-order governing differential equations is simplified through making reasonable assumptions and
seeking polynomial approximations to complex integral functions, in order to derive
closed-form expressions for Vn(t), V2 n(t), Vh,(t) and Qhn(t). The time duration f,
is also computed to determine the end conditions for the region, which are used to
initialize the succeeding region.
33
V2
R3
A R'
V
-
Ca
Vh
C(t)
Figure 3-2: Equivalent circuit model for Region I
3.1.3
Region I
Region I begins with the initial conditions V2 1 (0) > V1I(O) > Vhl(O), and ends when
Vhl(t) rises to equal
11 (t).
Throughout this region, Vhl(t) is below both V11(t) and
V2 1 (t), which causes D1 to conduct and D 2 to be non-conducting. The equivalent
circuit model for this region is shown in Figure 3-2, where D 1 is replaced by a wire
and D 2 by an open circuit. V11 (t) is constant, and is represented by a DC voltage
source of magnitude V11 (0). The potential difference V, across a capacitor is related
to its capacitance C and the stored charge
Q by
- =QE
V= Q
C
(3.2)
where we already established that the elastance E is the inverse of capacitance. In
this region, the elastance is defined as a linearly increasing function:
El(t)
_
E
TS
t + Ed
(3.3)
The flow of current into the time-varying capacitor C increases the charge Qhl(t)
stored on it. With E1 (t) increasing linearly in this region, Vhl(t) increases according
to Equation 3.2. From Figure 3-1, we note that the time duration ti, which is defined
as the time taken for Vhl(t) to equal V1 1(t), is very short at about 0.002s. As such,
we assume the change in Qhi(t) to be small over this time interval, and Qhi(t) to be
34
constant:
E
Qhl(t)
_
Vhl(O)
(0)
1
E1(0)
Vhl(0)
(3.4)
Ed
Qhl(t)El(t)
Vh 1(0)(Es - Ed)t + Vhl(0)
EdTs
V(t) =
(3.5)
V2 1 (t) decreases exponentially with a time constant of CaR3, as current flows out of
the capacitor Ca into the rest of the system. From the equivalent circuit model, we
have a first-order governing differential equation in V2 1 (t):
CaV 21(t)
Vn1 (t) - V 21 (t)
=
R3
V 21 (t)
> V2 1(t)
-
I
CaR 3
V 2 1(t) +
V 1(0)
CaR 3
[V 21 (0) - V11 (0)] e CaR + V 1 (0)
=
(3.6)
(3.7)
The mathematical working in the numerical solution of the differential equation is
omitted here (see Appendix A.1). By assuming a constant Qhl(t), we have derived
closed-form voltage functions for Region I. The end conditions of the region is determined by the time duration fl, which is the time taken for Vhl(t) to equal Vii(t):
V 1(fi)
=
V7u(O)
1
Va(11)
h
Vhl(O)(Es - Ed) t+±V1(O)
EdT8
EdTs
[V11 (O) - Vhl(O)] EdTs
Vhl(O)(Es - Ed)
(3.8)
By substituting f into Equation 3.3, 3.5 and 3.7, we have the initial conditions
E 2 (0), Vh2(0), and
22(0), respectively, for Region II. Given that the region starts off
at t = Os, the end time t1 is equal to fi, i.e., ti = fl.
35
3.1.4
Region Il
V2
R3
V,
Vh
C(t)
Ca
Figure 3-3: Equivalent circuit model for Region II
Region II begins with Vh2 (t) just higher than V12 (t), and ends when Vh2 (t) rises
to equal V22 (t). Throughout this region, Vh2(t) lies between 1 22 (t) and V 12 (t), which
causes both D1 and D 2 to be non-conducting. The equivalent circuit model, when we
replace both diodes by open circuits, is shown in Figure 3-3. The initial conditions
of Region II map directly to the end conditions of Region I:
E 2 (0)
=
E1 (fi)
(3.9)
Vh2 (0)
=
Vhl(tl)
(3.10)
V22 (0)
=
V21(fl)
(3.11)
Qh2(0)
=
Qhi(fil)
(3.12)
In the equivalent circuit model, the time-varying capacitor C is disconnected from
the main circuit by the non-conducting diodes, and no current flows in or out of it.
The stored charge Qh2(t) therefore remains constant in this region:
Qh2 (t) = Qh2(0) = Vhl(0)
Ed
(3.13)
The elastance function is the same as that for Region I, except for the initial condition
E 2 (0):
E2(t) =
E TE t + E 2 (0)
36
(3.14)
Vh2(t) increases linearly with time according to Equation 3.2, since Qh2(t) is constant
and E2 (t) is linearly increasing.
_Vhl(0)
Vh2(t) =
[Es- Edt
(3.15)
t + E2(0)
E
V 2 2 (t) is always higher than V 12 (t) but decreases exponentially with a time constant of
CaR 3 , as current flows out of the capacitor Ca through the resistor R 3 into the voltage
source.
From the equivalent circuit model, we again have a first-order governing
differential equation in
22
(t):
CaV22 (t)
V22(t)
-
(3.16)
V22 (t) V 1 (t)
+
CaR 3
CaR3
(3.17)
(t)
=
-
22 (t)
=
[V22(0) - VI(0)1 e-
22
->
V12(t)
-
CaR3
(3.18)
+ V,1 (0)
where the last equality follows from applying the result in Equation 3.7 directly. Now,
we determine the end conditions for the region. The time duration t 2 , is defined as
the time taken for Vh2(t) to rise to V 22 (t):
Vh2 (f 2 )
Vhl(0)
Ed
V22(f
=
[22(0)
_
1
Es - Ed
TS
2)
=
2
+ E 2 (0)
-
Vj(0)] e
V
CaR3
+ V1(o)
(3.19)
Given the structure of Equation 3.19, solving for t 2 requires us to evoke the Lambert's
W function, which has the following mathematical definition:
w = lambertW(x)
given that we' = x
(3.20)
We implement Equation 3.19 in MATLAB and use the solve function to derive an
expression for f2 in terms of the Lambert W's function:
1
2
E)
V1((0)3(Es - E1)
[(V1(0)CaR 3 lambertW(a) (E - Ed) - Vhj(0)E 2 (0)T + V1 (0)ET s ]
(3.21)
37
where
1
a
Ts [Vhl()E2(0)-V11
Vhl(O)CaR 3 (Es
-
Ed) [EdTs(V 22 (0)
-
V(0)1
e
(O)Ed
Vhl ()CaR3(Es-Ed)
(3.22)
The initial conditions E3 (0), Vh3(0) and V23 (0) are obtained by substituting F2 into
Equation 3.14, 3.15 and 3.18, respectively. Lastly, the end time t 2 is given by
(3.23)
t 2 = f 2 + tl
3.1.5
Region III
Vh
R2
R3
V2
Vi
a
(t)-
Vh
=
V2 R
V
0(t)a
(a)
(b)
Figure 3-4: a) Equivalent circuit model for Region III b) Modified circuit model
(R 2 = 0)
Region III corrresponds to the period of ventricular ejection, or systole, which
begins when Vh3 (t) is just above V2 3 (t), and ends when the elastance function E 3 (t)
increases to the end-systolic value E,. Throughout the region, Vh3(t) is slightly higher
than V23 (t), thereby forcing D 2 into conduction while D1 remains non-conducting from
Region II. The equivalent circuit model is shown in Figure 3-4a. The initial conditions
are determined from the end conditions for Region II:
E3(0)
= E 2(f 2 )
(3.24)
Vh3(0)
=
Vh2 (T2 )
(3.25)
V23(0)
=
V22(T2)
(3.26)
Qh3(0)
=
Qh2 (f 2 )
(3.27)
38
The elastance is defined as a linearly increasing function:
E 3 (t) = E TE t + E 3 (0)
(3.28)
At the start of the region, current flows from C to Ca as Vh3(0) is greater than V23(0).
However, Vh3 (t) continues to increase despite the outflow of charge from C, because
E 3 (t) is increasing at a rate higher than that at which Qh3(t) is decreasing. V2 3 (t)
increases and tracks Vh3(t) very closely, as current continues to flow into Ca.
We
assume R 2 to be zero, as the potential difference between Vh and V2 is very small in
this reigon. However, this assumption does not allow for simulation of aortic stenosis.
The modified circuit model for the region is shown in Figure 3-4b, and V 2 3 (t) is equal
to Vh3 (t).
(3.29)
V23 (t) = Vh3(t)
Applying Kirchhoff's Current Law to the modified circuit model, we obtain a firstorder governing differential equation in Qh3(t):
Qh3(t) + Vh3 (t) R
QQ(
-
+
E3(t)Qh3(t) - V110)
3
1 3 (t) + CaVh3 (t)
=
(3.30)
0
+ Ca[E3 (t)QhU(t) + E(t)Qh3 (t)]
E 3 (t) + R 3 CaE3 (t)
Vn1(0)
R 3 [1 + CaE 3 (t)]
R 3 [1 + CaE 3 (t)]
(3-31)
0
(3.32)
Qh3 (t)
3t + y )CaR3~
t
Vj
CaR 3
((0))
#+
3T
R3
d
Qh3(0)
(3.33)
where /3=
-(E, - Ed) and -y
CaE 3 (0)
+ 1. The mathematical working of the
solution is omitted here (see Appendix A.2). However, Qh3(t) is clearly not in closedform, and we seek a polynomial approximation to the integral term in Equation 3.33
39
to simplify the solution. The end time of the region corresponds to the instant at
which the elastance function equals Es.
(3.34)
(3.35)
The function f(t)
= e
R3
( 1Ca
R3
is plotted in Figure 3-5 for the time interval
[0, f 3] using the system parameters from Table 2.1, and we see that the function is
well approximated by a constant c where
1
2
{
e
(-
- R
+
CaR 3
e Caa
1
(3.36)
r=O
2
function f(t)
-constant
1.8
c
1.6
1.4
1.2
C,
.
.
.................. .
. . ..
0.80.60.40.2-
t
0
0.05
0.1
0.15
0.2
0.25
t
Figure 3-5: Plot of function
f(t) and the constant approximation c
40
Putting c into Equation 3.33, we have
1-1
(jI
Qh3(t)
I
)aeR3
1
cV (O)t
C
CaR3-1
- Qh3(0)j
(3.37)
and we have derived a solution for Qh3(t) in closed-form. Subsequently, we make use
of Equation 3.37 to derive Vh3 (t) and
V23 (t)
3.1.6
23 (t):
=
Vh3 (t)
(3.38)
=
Qh3 (t)E3 (t)
(3.39)
Region IV
Region IV begins with both E(t) and Vh(t) at their peak values, and ends when Vh4(t)
decreases to
24
(t). However, from our assumption that R 2 = 0 in Region III, we have
the initial conditions Vh4(0) = V24(0) which implies that the region ends as soon as
it begins according to the definition of Region IV. As such, Region IV does not exist
in our analytical solution! This is still a reasonable result since the time duration of
the region is very short. For later discussion, we shall assume that Region V follows
immediately after Region III.
3.1.7
Region V
Region V begins with Vh5(t) just below V25 (t), and ends when Vh5(t) decreases to
V15 (t).
This region is similar to Region II in which both D 1 and D 2 are non-
conducting, and the equivalent circuit model shown in Figure 3-3 applies to Region
V as well. The initial conditions of the region follow directly from the end conditions
of Region III:
Vhs(0) =
V25(0) = Vh3(t
3)
(3.40)
E 5 (0) =
E 3 (f3 )= Es
(3.41)
41
As in Region II, Qh5(t) is constant, since the time-varying capacitor C is disconnected
from the main circuit by the non-conducting diodes.
Qh((t) =
QV((0)
E5 (0)
Es
(3.42)
However, the elastance is now defined as a linearly decreasing function:
E5 (t)
t + Es
Ed
(3.43)
Tf
where T is the time taken for the elastance function to decrease linearly from E,
to Ed. With Qh5(t) constant and E 5 (t) decreasing linearly, Vh5(t) decreases linearly
according to:
Vhs(t)
=
Qhs(t)ES(t)
Vh5(0)Ed
Es
t + Es
(3.44)
Tf
V2 5 (t) is similar to V2 2 (t) except for the initial conditions as the governing differential
equations are the same in both regions, and we apply the result from Region II
directly:
V25(t) = [V25(0) - V11 (0)] e
The time duration
f5
CaR3
+ V(0)
(3.45)
is defined as the time taken for Vhs(t) to decrease to V 15 (t):
V15 ()
V1(0)
(3.46)
=
Vh5(N)
=
Vh5(0)
Es
Ed-Es
Tf
t
ETF
Ed
Es
[F 1 1 (0) _Es]
+E
(3.47)
(3.48)
Vh5(0)
and
t5
=5
t + t3
42
(3.49)
3.1.8
Region VI
Region VI begins with Vh6(t) just below V 6(t), and ends when the elastance function
decreases to the diastolic value Ed. The end time of the region is therefore equal to
the systolic time interval T, added to Tj:
t6=
T, + Tf = 0.5T
(3.50)
f6 = t6 - t5
(3.51)
and
V16 (t) is higher than Vh6 (t), which forces
D1 into conduction while D 2 remains in the
off-state from Region V. Hence, the equivalent circuit model is the same as that in
Region I (see Figure 3-2). The initial conditions correspond to the end conditions of
Region V:
Vh6(0)
Vh5 (f 5 )
(3.52)
Qh6(0)
Qh5 (45 )
(3.53)
V25(f5)
(3.54)
E5 (f 5 )
(3.55)
V26(0)
=
E 6 (0)
The elastance function is defined as a linearly decreasing function:
Ed- E
E6 (t) = E
Tf
E t + E 6 (0)
(3.56)
Despite the flow of current into C through R 1 , Vh6(t) continues to fall because E 6 (t)
is decreasing faster than the rate at which Qh6(t) is increasing. From the equivalent
circuit model, we obtain a first-order governing differential equation in Qh6(t):
Qh 6 (t)
=
(3.57)
V16 (t) - Vh6(t)
RE
E6 (t)
=-
Qh6(t) +
43
V 1(0)
Ri(3.58)
Ed -
=-
Es
E(0)1
t+
___(_
Qh6(t) + V(
(3.59)
The mathematical working of the solution is omitted here (see Appendix A.3), and
we present the solution for Qh6(t) directly:
[
Es- Ed t2 _E6
QhG(t) = e 2 T f Ri
_
t
ET-Esl2±R
Vi 1 (0)
R1
e
2
R1
2J
(R
d-r +
Vh6(0)1
(3.60)
It is not possible to obtain a closed-form expression for the integral term in Equation
3.60 as we are integrating a function of the form
et 2 .
We simplify the integral term by
Ed-ES t2+ E
seeking a polynomial approximation to the expression
e 2Tf R 1
R1
over the period
of interest.
1.1
-
1.08
-e
1.06
.04
1
.02
- -function g(t)
- - linear approx. h(t)
0
0.005
0.01
0.015
Figure 3-6: Plot of function g(t) and the linear approximation h(t)
Ed-Es
We define the function g(t)
= e
2T
2
E 6 (O)
f R1
R1
and plot g(t) over the interval [0, 46]
in Figure 3-6, using the system parameters from Table 2.1. The time period
44
f6
is very
short at about 0.015s, which allows us to approximate g(t) by a linear function h(t)
with marginal error.
Y-X
=-
h(t)
(3.61)
t+X
t6
where
2
e
Ed-Es t + E (O) t
6
2Tf R
R I
j
'
2
Ed-Es t + E6 (0) t
and Y = e 2 Tf RI
(3.62)
R1
.
- '6t
Substituting Equation 3.61 into Equation 3.60 and evaluating the integral term, we
derived a closed-form solution for Qh6(t):
Qh6(t)
=
Es-Ed t2_ E6(O)t
R1
e 2TfR1
Vi(0)
Y - X
R1 2t 6
R,
2
+ xt)
+ Vh6(0)
Es]
(3.63)
Subsequently, we are able to derive a closed-form solution for Vh6(t):
(3.64)
Vh6 (t) = Qh6 (t)E(t)
The governing differential equation in V2 6 (t) is the same as that for V 21 (t), and we
apply the result from Region I directly to derive V2 6 (t):
V2 6(t) = [V26(0) - V11(0)] e
3.1.9
CaR3
+ Vu(0)
(3.65)
Region VII
Region VII corresponds to the period during which the elastance function is constant
at Ed, so
E 7 (t) = Ed
(3.66)
The equivalent circuit model is the same as that in Region I and VI, as D 1 and D 2
remain in the on-state and off-state ,respectively. The initial conditions follow directly
from the end conditions of Region VI:
Vh7(0)
=
Vh6( 6)
(3.67)
Qh7(0)
=
Qh6(f6)
(3.68)
45
V27(0)
= V26()
(3
(3.69)
From the equivalent circuit model, we have a first-order governing differential equation
in Qh7(t), which is the same as that in Region VI:
__
Qh7(t)=
V 17 (t) - Vh7 (t)
R,
_
V1(0)
E7 (t)
Qh7(t)
-
R1
R
V11(0)
R1
EA t
->
e
Qh7 (t)
R1
(3.70)
+() V1 (0)
Qh7(0)
Ed
Ed
(3.71)
and
Vh7 (t)
=
Qh7 (t)E 7 (t)
(3.72)
=
e R(Vh7(0) - V1(0)) + V11(0)
(3.73)
The mathematical working of the solution is shown in Appendix A.4. Here, we again
make use of the results from Region I to derive V27 (t):
V27 (t) = [V
27 (0)
- V1(0)] e CaR3 + V1(0)
(3.74)
The end of the region corresponds to the end of the cycle , and so
3.1.10
t7
=
T
f7
=
t7 -
(3.75)
t6
(3.76)
Initializing the Next Cycle
We have so far successfully derived closed-form expressions for the voltage functions
Vi(t), V 2 (t) and Vh(t) for all seven regions within one cycle, by solving first-order
differential equations and making reasonable assumptions to simplify complex integral
46
functions. A method of setting up the new initial conditions for the next cycle is
required to implement the beat-to-beat propagation of the analytical solution. We
denote the new initial conditions by Vnew(0), V 2 1new(0) and Vhlnew(0), respectively.
V 2 1new(0) and Vhnew(0) are obtained directly from the end conditions of Region VII
from the preceding cycle:
=
V 2 new(0)
Vhnew(0)
V27(7)
(3.77)
Vh7(f7)
(3.78)
An expression for Vinew(0) is obtained by applying the principle of charge conservation, which requires the total charge in the system at the start of the new cycle to be
equal to that at the start of the last cycle:
CvViinew(0) + CaV21new(O) + Vhlnew (0) = CvV 11(0) + CaV 21(0) + V1(0)
Ed
E
Vn1(0|CV +
> V1new(0) =
Vh1 (0)
Ed
+
V21(0)Ca -
Ca
Cv
Vhlnw(O)
Ed
-
V21new(0)Ca
(3.79)
(3.80)
In summary, we have derived a closed-form analytical solution to the pulsatile model,
which computes V(t), V2 (t) and Vh(t) recursively over many cycles given a set of
pre-defined initial conditions. Starting from Region I, we apply the initial conditions
to the voltage functions corresponding to Region I, which then compute V1(t), V 2 (t)
and Vh(t) until the end of the region, after which the voltage functions corresponding
to Region II take over. This carries on until we reach the end of Region VII, which
also marks the end of the cycle. At this point, we use Equation 3.77, 3.78 and 3.80
to determine the new initial conditions to Region I of the following cycle, and the
process repeats.
47
3.2
3.2.1
Implementing the Analytical Solution
MATLAB
We first implement the analytical solution in the MATLAB environment to make use
of its powerful and yet easy-to-use graphical tools to plot the waveforms generated by
the solution. The implementation is easy and straightforward since MATLAB allows
its users to implement equations directly in their mathematical forms. Perhaps most
importantly, it already has a pre-defined lambertw function, which is required to
evaluate the time period t 2 in Region II.
The MATLAB source code for implementing the analytical solution is listed in
Appendix B.1. The first part of the code initializes the system parameters and the
initial conditions. The structure of the program is designed with the voltage functions, which are ordered from Region I to Region VII, embedded in a f or loop, which
repeats after every cycle period T. Before control is passed back to the start of the
loop, the program computes the new set of initial conditions for the next cycle. Using
the system parameters given in Table 2.1, we run the program for 10s and plot the
waveforms in Figure 3-7.
3.2.2
C Programming Language
We also implement the analytical solution in the C programming language, in order
to utilize the Gprof command in LINUX to evaluate the computational efficiency of
the solution. Briefly, the Gprof command, when executed with a C program, outputs
the computation time of the program.
Exporting the code from MATLAB into C is relatively easy, as the two environments are syntactically very similar. The C source code for implementing the
analytical solution can be found in Appendix B.2. The structure of the program
follows closely that of the MATLAB program, by ordering the voltage functions from
Region I to Region VII, and nesting them in a for loop. However, C does not have
48
14
Vh
-
-
vi
V2
12 0-
10
0
-
8
0D
0)
0
60
4 .0
20-
A
1
0O
2
I
5
I
4
I
3
I
6
I
7
I
8
9
10
time (s)
Figure 3-7: Voltage waveforms generated by the analytical solution in MATLAB
- Vh
-vi
V2
120
100
\.-
80
(D)
75
60
\*\**
-~\
40
20
0
1
2
3
4
5
time (s)
6
7
8
9
10
Figure 3-8: Voltage waveforms generated by the analytical solution in C
49
a pre-defined lambertw function like MATLAB. As such, we add the source code to
define the LambertW function at the end of the C program. The program is then run
for 10s using the system parameters given in Table 2.1, and the waveforms plotted in
Figure 3-8.
The differences in the plots in Figure 3-7 and 3-8 are hardly noticeable, and one
waveform seems like the replica of the other. This shows that the MATLAB and
C source codes for implementing the analytical solutions are functionally equivalent,
and that the definition of the LambertW function in C is correct to a certain degree
of accuracy.
3.3
Discrete-time Analytical Solution
We have shown in earlier sections that implementing the analytical solution requires
the computation of the start and end times of the seven regions within one cycle. By
evaluating the analytical solution at these times, we have a set of data values which
correspond to the boundary conditions of the regions. Since we have full knowledge
of the characteristics and behavior of the voltage waveforms in each region from the
analytical solution, it suffices to represent the waveforms just by this set of discretetime points, as we can easily recover the full waveforms by evaluating the voltage
functions between these points. We will refer to the discrete-time representation of
the voltage functions as the discrete-time analytical solution.
We modify the C source code from Appendix B.2 to implement the discrete-time
analytical solution by evaluating the voltage functions only at the start of each region
(see Appendix B.3). The program is run for 30s and Figure 3-9 shows the discretetime voltage waveforms generated by the discrete-time analytical solution.
50
-*
o
++,
Vh
V1
+ V2
100
80
II)
Ce
60
40
20
----
0
---- >-----------G------
28
-------------------
28.2
28.4
-
28.6
28.8
-O-
29
time (s)
14UV1
+
V2
120-
100-
8001
.5
60-
40-
20to
0 4
o
o"
0
o
0
*
'
O0
'
'
2.5
3
OS
to
00
*
n
0
0.5
1
1.5
2
3.5
4
4.5
5
time (s)
Figure 3-9: Representation of full voltage waveforms by discrete-time points over 1
cycle (top); discrete-time voltage waveforms (bottom)
51
52
Chapter 4
Comparison of Simulations
In Chapter 3, we derived a closed-form analytical solution to the pulsatile model using
the piecewise linear elastance function and implemented the solution in MATLAB and
C. To evaluate the performance of the analytical solution, we study its steady-state
and transient responses, and measure how "closely" the voltage waveforms follow the
simulaton output of the pulsatile model. In studying hemodynamic waveforms, there
are several variables of physiological interest, which are often used to characterize the
waveforms. For the venous pressure V1, we are most interested in its mean value,
since it has a very small ripple. The arterial pressure V2 is described by its mean,
systolic and diastolic values, while the ventricular pressure Vh is characterized by its
systolic and end-diastolic values. Table 4.1 summarizes the characteristic variables
associated with each voltage waveform. Furthermore, we also evaluate the computational efficiency of the analytical solution by comparing the computation time of the
analytical solution to the simulation time of the pulsatile model.
V1
mean
V2
mean
systolic
Vh
diastolic
systolic
end-diastolic
Table 4.1: Characteristic variables of voltage waveforms
53
4.1
Comparison of Steady-state Numerics
To compare the steady-state responses of the analytical solution and the circuit simulation of the pulsatile model, the pulsatile model and the analytical solution are
implemented in HSPICE and MATLAB, respectively, for a period of 30 cycles using
the system parameters given in Table 2.1. Figure 4-1 shows the steady-state responses
of the simulation runs over the time interval [25, 30]. The waveforms generated by
the analytical solution are almost identical to the simulation outputs of the pulsatile
model, with the exception of Region III which corresponds to the period of systole.
Here, a very small potential difference is observed between the ventricular voltage Vh
and arterial voltage V2 of the simulation outputs, but the analytical solution assumes
zero difference by setting Vh
=
V 2 in this region.
Figure 4-2 compares the steady-state dynamics of V 1, V2 and Vh for the analytical
solution (AS) and the circuit simulation (CS) of the pulsatile model over the time
interval [25, 30]. The HSPICE simulation output for V is a time-varying waveform
with a peak-to-peak ripple magnitude of 0.4V, whereas the voltage function V in
the analytical solution is constant in steady-state. On the other hand, the voltage
functions V2 and Vh follow the simulation outputs very closely. Table 4.2 compares the
steady-state responses, in which the maximum relative error is no more than 1.11%.
CS
AS
rel. error
mean
V1
15.25
15.08
1.11%
mean
systolic
diastolic
99.72
114.30
83.50
100.62
115.00
84.05
0.90%
0.61%
0.66%
systolic
end-diastolic
115.75
13.18
115.00
13.15
0.65%
0.23%
Variables
V2
Vh
Table 4.2: Comparison of steady-state responses
54
/
~1
I
1001-
/
~
\
/
ji
/
/
\
,1
*/I
\
I
\.
~.
\.
II
-
80
5,
a)
60
0
40
20
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
time (s)
120
100
80
a)
60
0
- ---- ---- ----- --------- ---------- ---------- ----40
20
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
time (s)
Figure 4-1: Steady-state voltage waveforms generated by circuit simulation (top) and
analytical solution (bottom) of the pulsatile model
55
ECI
A-S
15.55
15.5
15.45
15.4
15.35
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -A -
----
-- --
15.3
15.25
15.2
15.15
15.1
15.05
25.5
5
26
26.5
27
27.5
28
28.5
29.5
29
30
time (s)
120 r---
AS
115-
/I
/
110-
-
105 -
100
-5
95
90
85
80
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
time (S)
E~I~i
120
/
/
/
I
100
/
I
7
I
-
80
60
40
20
25
25.5
26
26.5
27
27.5
28
28.5
29
29.5
30
time (s)
Figure 4-2: Comparison of steady-state dynamics of V (top), V 2 (middle) and Vh
(bottom)
56
4.2
Comparison of Dynamic Responses
To compare the responses of the circuit simulation and analytical solution of the pulsatile model to changes in the system parameters, we choose to perturb the arteriolar
resistance R 3 and the cycle period T. Both parameters play important roles in cardiovascular homeostasis through feedback regulation and have the capacity to change
by a factor of 2 over short periods of time.
4.2.1
Changes in R 3
We run the simulations for 100 cycles, during which the resistance is stepped down
from R 3
=
1.OQ to R 3 = 0.5Q at time t = 30s, and the step change is reversed at time
t = 60s. Figure 4-3 shows the responses for the time intervals [25, 40] and [55, 70].
The intervals are chosen so that the transient dynamics of the voltage waveforms are
clearly shown. At the onset of the step changes in R 3 , it takes about 5 cycles for the
simulations to reach steady-state. The systolic values of V2 and Vh clearly decrease as
R 3 is lowered, but V does not register any significant change. The voltage functions
V 2 and Vh are very close to the simulation outputs of the pulsatile model.
Figure 4-4 compares the transient dynamics of V1, V2 and Vh for the analytical
solution (AS) and circuit simulation (CS) of the pulsatile model. The mean value of
V increases slightly as the resistance is stepped down, as there is less resistance to
current flow into C, through R 3 and the average amount of charge per cycle stored in
C, increases. During transient, the voltage function V remains constant over 1 cycle
but changes from cycle to cycle. For V2 and Vh, the analytical solution tracks the
simulation outputs very closely during transient. The relative errors in the responses
are observed after 5 cycles have elapsed following the step change in R 3 to ensure
that steady-state is reached. The maximum relative error in the transient response
of the analytical solution to changes in R 3 is 1.79%.
57
120
120
1 00
1 00 I-
'
I
I
--~
'31
80
I
so
I
I
I
60 -
I
4-
LI
40-
20-
(
0
2 5
30
35
ti.e
40
55
(S)
60
time (s)
65
70
120
120
I
ft
1 00
80
80
60
60
40
$1
vv
20
v(
25
il 'I
1.1
100
401IV
20
vi
30
time (a)
P(
01
5t
,40
60
K(
65
time (s)
Al_
(
Kv
70
Figure 4-3: Transient responses of circuit simulation (top) and analytical solution
(bottom) of the pulsatile model to changes in R 3
Variables
CS
AS
rel. error
15.79
1.25%
67.03
82.40
48.55
0.57%
0.12%
0.16%
82.40
13.49
1.79%
0.07%
V1
mean
15.99
mean
systolic
diastolic
66.65
82.30
48.63
systolic
end-diastolic
83.90
13.50
V2
Vh
Table 4.3: Comparison of transient responses to changes in R 3
58
4
16.4
16. 2
16.2
16.
16
15.8
6
15.6
15. 4
15.4
2.
1.
06
-
15.2
25
35
30
time
1
-~K
16
15. 8
15.
-
15
40
5
tm
(B)
time
65
7
65
7 0
0
(a)
2O
-
110
-
110
1 00
100
9O
90
so
80
70
70
6o
60
so
50
30
25
35
4
O
-40-
55
60
time (s)
time
12 0
120
0
100
S
0
80
6
0-
so
10
(a)
11
11
40
2
0-
20
v
{
20
0
05
time
-40
55
65
time
(M)
v vK
(
60
(
v
( V
70
)
Figure 4-4: Comparison of transient dynamics of V (top), V2 (middle) and Vh (bottom) due to changes in R 3
59
4.2.2
Changes in T
In this section, we compare the transient responses of the analytical solution and the
circuit simulation of the pulsatile model to a step change in the cycle period T. The
simulations are run for a period of 60 cycles, during which T is stepped down from
T = 1.0s to T = 0.5s at time t = 30s. Figure 4-5 shows the transient responses of the
pulsatile model and the analytical solution over the interval [25, 35]. As in Section
4.2.1 where we applied a step change to R 3 , the simulations take about 5 cycles to
reach steady-state after T is stepped down. Both transient simulations show that
the intra-cycle dynamics of the waveforms are preserved and reproduced well by the
analytical solution, with increased systolic values for V2 and Vh while V shows a slight
decrease in its mean value.
Figure 4-6 shows the transient dynamics of V, V2 and Vh for both implementations
over the time interval [25, 35]. The peak-to-peak ripple magnitude of V2 is almost
halved after the step change in T, because it continues to rise and fall with the same
time constants over a cycle period which is half of that before the transient. The
voltage functions, in particular V2 and Vh, are very close to the simulation outputs
of the pulsatile model, with the relative errors given in Table 4.4. The errors are
observed after 5 cycles have elapsed following the onset of the transient to ensure
steady-state is reached.
Variables
CS
AS
rel. error
14.77
0.81%
122.50
132.84
111.51
0.71%
0.64%
0.25%
132.84
10.70
1.18%
0.47%
Vi
mean
14.89
mean
systolic
diastolic
121.64
131.98
111.23
systolic
end-diastolic
134.42
10.77
V2
Vh
Table 4.4: Comparison of transient responses to changes in T
60
As can be seen from the steady-state and transient responses of the analytical
solution, the maximum relative error across all waveforms is no more than 1.79%. This
shows that the assumptions we made in Chapter 3 to obtain closed-form expressions
for the voltage functions are valid, and that we have successfully derived an analytical
solution that are very close to the "true" solution of the pulsatile model. In the
following section, we compare the computational efficiency of the solution against
that of the numerical implementation of the pulsatile model.
61
140
cc*
~
cc
c
120
*1~
I
/
~*
\*
100
I~
j\.~
cc
cc.
*~*
cc
cc ~ cc
cc
cc
H
*~
cc.
ccccl
cc
I
cc
80
a,
cci
0
60
40
20
01L
25
26
27
28
30
time (s)
I
I
140r
29
31
32
33
c
34
j
~'cc/~
ccl ccl
ccl
cc cclcc~
120
35
ccl
ccl
100
80
60
-
cc.
cc
40
20
025L
-1I§
VLEP
7-
26
27
28
29
30
time (s)
31
32
33
34
35
Figure 4-5: Transient responses of circuit simulation (top) and analytical solution
(bottom) of the pulsatile model to changes in T
62
15.7
1 5.6
1 5.5
1 5.4
15.3
15.2
15.1
-------------------------
15
14.9
1 4.8
----------------------
1,47 0
6
50
40
30
20
10
time (a)
40.40
13O
1 20
110
til
5
26S
27
l
8
9
26
26S
27
27
28
at
29
9
s
303
31
32
33
4
31
32
33
34
315
190
140
12
80
120
100
60
20
0
2t
5
30
tima
()
35
(S)
Figure 4-6: Comparison of transient responses of V (top), V 2 (middle) and Vh (bottom) to changes in T
63
4.3
Computational Efficiency
In Section 3.3, we showed that discrete-time points obtained by evaluating the analytical solution at the start of each region within a cycle are sufficient representations of
the full pressure waveforms due to our knowledge of the characteristics and behavior
of the waveforms from the analytical solution. In other words, these discrete-time
points provide a complete characterization of the full voltage waveforms, and we have
seen how to generate these points using the discrete-time analytical solution. In this
section, we compare the computation time of the analytical solution to the simulation
time of the pulsatile model.
The LINUX operating system has a Gprof utility which allows users to assess
the CPU time of compiling a C source code when the code is compiled using the
-pg
option of the gcc compiler. We have implemented both continuous-time and
discrete-time analytical solutions in C (see Section 3.3), while Heldt has implemented
the algorithm for the pulsatile model in C by using a standard fourth-order RungeKutta integrator to solve the differential equations numerically. Due to the piecewise
linear nature of the time-varying elastance function, a step size of 10
4
s was used in
the numerical simulation of the pulsatile model. Each program was run for 10,000
cycles with the system parameters given in Table 2.1, and the corresponding CPU
time was assessed by the Gprof utility. Table 4.5 compares the averaged CPU time
of the circuit simulation (CS), the discrete-time analytical solution (DTAS) and the
full solution (AS) using different step sizes over 5 runs each.
Variable
step size (s)
CPU time (s)
CS
AS
10-4
10-4
10-
248.69
37.42
3.86
DTAS
10-2
0.41
-
0.05
Table 4.5: Comparison of CPU times
As we can see, the discrete-time analytical solution allows for an improvement in
the CPU time to a factor of 5000, and yet captures the intra-cycle dynamics of the
full voltage waveforms without any loss of information.
64
Chapter 5
Extension Work
In Chapter 4, we evaluated the performance of the analytical solution in terms of
accuracy and computational efficiency, and showed that the analytical solution is
very close to the "true" solution of the pulsatile model, and yet registers very short
simulation times which are several orders of magnitude less than that of the numerical
implementation of the pulsatile model.
Here, we extend the use of the analytical
solutions to two problems of interest:
model parameter sensitivity and elastance
parameter estimation.
5.1
Model Parameter Sensitivity
Recall that the pulsatile model is a simplified version of the computational hemodynamic model which was developed to simulate the short term (< 5min) transient and
steady-state hemodynamic responses to different physiological conditions. The model
parameters are largely based on literature values, with a few adjustments made to
align simulation output to population-averaged hemodynamic data so that simulation
results are relevant and as close as possible to experimental observations. Moreover,
in the study of rare cardiac disorders, it is also common to model hemodynamic
responses of patients on an individual basis. As such, it is very useful for us to understand how changes in the model parameters affect the analytical solution and its
voltage functions, so that model parameters can be correctly adjusted to simulate
65
experimental data.
We perform a sensitivity analysis on the pulsatile model parameters based on the
analytical solution, by increasing the parameter values in turn by a very small amount
and then measuring the resulting differences in the characteristic quantities of the
steady-state voltage waveforms propagated by the analytical solution. Here, we have
chosen to perform a quantitative analysis instead of taking the symbolic derivative
of the analytical solution with respect to each parameter, because the latter yields
complicated expressions as a result of the Lambert's W function. The results of the
quantitative sensitivity analysis are given in Table 5.1.
V
mean
mean
V2
systolic
Vh
diastolic
+0.04%
-0.20%
R, (+1%)
-0.17%
-0.18%
-0.08%
+0.56%
R 3 (+1%)
+0.49%
+0.73%
-0.01%
+0.02%
-0.09%
systolic
end-diastolic
-0.23%
-0.17%
+0.01%
+0.49%
-0.01%
-0.09%
Ca (+1%)
+0.21%
Table 5.1: Numerical sensitivity analysis of model parameters
The sensitivity analysis for R 2 and C, is not shown here, as they have no effect
on the voltage waveforms. As a matter of fact, R 2 does not appear in the analytical solution at all, while C, is only used to compute Viinew(0) for the new cycle.
Differentiating Equation 3.80 with respect to C,, we have
Vhl(O) +_ VhnwO
DV 1 new(0)
Ed
_
a
+ V2 1(0)Ca - Vid (O)- V21new(0)Ca
Cv2(5.1)
CV
-(5.2)
~2
which is small for large Cv. As a result, the changes in the voltage waveforms corresponding to a 1% change in C, are almost negligible.
The quantitative analysis on the model parameter sensitivity gives us a clearer
picture of how changes in the model parameters effect changes in the voltage functions,
66
as well as how to tweak model parameters to simulate hemodynamic data using the
analytical solution. In the next section, we make use of the analytical solution to
construct an estimator for the elastance function parameters based on observations
of hemodynamic waveforms.
5.2
Elastance Parameter Estimation
In physiological context, the elastance of the heart ventricle is characterized by two
parameters: the end-systolic value E, and the diastolic value Ed. Currently, there are
two methods which are commonly used to measure ventricular elastance. The first
method is highly invasive and involves measuring the elastance directly by placing a
strain-gauge compliance catheter in the ventricle of a patient. The second method is
less invasive and invokes the concept of ventricular-vascular coupling, in which the
ventricular elastance is determined as the slope of the end-systolic pressure-volume
(PV) relation, to compute the elastance indirectly from the PV measurements. In
addition to these, a host of non-invasive methods have being developed to estimate
the ventricular elastance to varying degrees of accuracy.
In Chapter 3, we derived the analytical solution to the pulsatile model using the
piecewise linear elastance function and here, we would like to reverse the process
by using the analytical solution to construct a non-random parameter estimator for
the elastance function parameters E, and Ed based on observed hemodynamic waveforms. It is sufficient to estimate these parameters because they characterize the
elastance function completely. Since we are estimating the parameters based on observed hemodynamic waveforms only, Equations 3.5, 3.15 and 3.44 are most useful in
our derivation, as they are independent of the model parameters.
By approximating the time period fi to be small such that E 2 (0) = Ed, Equation
3.15 can be shown to reduce to Equation 3.5:
Vh2 (t)
Vh(0)(Es
Ed
T9
Vh 1(O)(Es - Ed)
EdT
67
t+
Ed
(5.3)
+ Vhl(0)
(5.4)
Vhl(0) Es
T
T t + Vhl(0)
Ed
8
(5.5)
where we have assumed E, > Ed, such that
Es - Ed
Es
Ed
Ed
(5.6)
To estimate each parameter separately, we would need another equation in E, and Ed.
However, Equation 3.44 reduces to a form which is independent of the parameters:
V(t)
when we again assume E,
(5.7)
-Vh 5 (0) + Vh5 (0)
Tf
> Ed. This implies that it is only possible to estimate
E,/Ed, which is also referred to as the contractility ratio (CR), from Equation 5.5
alone. The contractility ratio is an important quantity in cardiology which is related to
several vascular quantities, and is widely used in the study of heart muscle diseases. To
construct a non-random parameter estimator for E,/Ed, we first define the sequence
Vh2[n]
Vh1()
Ts
Fnat
Ed
n = 0, ..., N and N =L
+ Vhl(0)
which is a discrete-time version of Equation 5.5.
t2
At
(5.8)
Alternatively, we can view the
sequence as sample values of Equation 5.5 with sampling period At. Writing in
matrix form, we have
Vh2 [01
0
1
At
1
2At
1
NAt
1
TVhl()
E
Ts
Ed
(5.9)
Vh2 [N]
Vhl(0)
Using y, x and H to represent system outputs, system inputs and system function,
68
respectively, we can rewrite Equation 5.9 as
(5.10)
y = Hx
where
Vh1(O) E,
T
Ed
Vh2 [0]
0
1
At
1
2At
1
NAt
1
(5.11)
[Vh2 [N]
Vh1(0)
From estimation theory, given the system outputs or observations y and system function H, the maximum likelihood (ML) estimator
XML
for the non-random parameter
x is
XML
=
(5.12)
(HTH)-lHTy
-
-
-1
E(nAt)2 E nAt
--
E(nAt)Vh2 [n]
(5.13)
E nAt
N + 1
E V2[n]
Here, we evaluate the inverse matrix in Equation 5.13
E(nAt) 2
ZnAt
EnAt
N+1
N+1
-EnAt
1
(5.14)
(N + 1) E(nAt) 2 - (EnAt)2
-EnAt
E(nAt) 2
N+1
1
(N + 1)(At) 2 g 42
--
(At) 2 (z
n
(5.15)
n)2
-AtEn
69
-At
(At)
2
En 2
6
-3NAt
2
(5.16)
(At) 2 N(N + 1)(N + 2)
-3NAt
(At) 2 N(2N + 1)
where the last equality follows from the finite sums of the sequences n and n 2:
N(N+1
N
E
n=O
n =
2
N
and
n2
n=O
N(N + 1)(2N + 1)
6
(5.17)
Substituting Equation 5.16 into Equation 5.13 and evaluating the matrix product, we
have
Vhl(O) E
Ts
Ed
Vhl(0)
ML
6EnVh2 [n] - 3N EVh2 [n]
2
AtN(N + 1)(N + 2)
-3NAt E nV 2 [n] + AtN(2N + 1) Z V2[n]
(5.18)
Our work is not yet complete, as we have derived an estimator for
Es
d
Vhl
(O)
T.
Ed
and not
We assume the terms to be independent:
Vhl1(0)
Ts
[Es
LEd] ML
Es
1
[VhI(0)]ML
Ed] ML
Es
(5.19)
[Ed]-ML
T8 [Vhi(0)] L [Vh1(0) Es]
.9 Vh(O)MLITs
where T, is easily computed from the cycle period T.
70
Ed.j
(5.20)
ML
Chapter 6
Conclusion
In this thesis, we derived a closed-form analytical solution to a pulsatile singleventricle model using a piecewise linear elastance function, which is a close fit to
population-averaged hemodynamic data.
This pulsatile model is a simplified ver-
sion of the computational hemodynamic model developed by Davis [4]. A numerical
simulation of the model was performed in HSPICE, which is a widely used circuit
simulation environment.
Due to the piecewise nature of the elastance function and the on-off switching
of the ideal diodes, the cardiac cycle operates naturally in seven regions.
In each
region, we numerically solve first-order differential equations to obtain closed-form
expressions for the voltage functions, making reasonable approximations where possible/necessary. In Region III, the resistance R 2 is assumed to be zero and this removes
the very small potential difference between V 2 and Vh, which is observed in the simulation output of the pulsatile model as well as in experimental hemodynamic waveforms.
Further work should focus on refining this approximation to accommodate a non-zero
R 2 in order to simulate a more realistic circulatory system.
Furthermore, we also
showed that with the analytical solution, it is sufficient to represent the voltage waveforms by discrete-time points obtained by evaluating the solution at the start of each
region. We term this set of data points the discrete-time analytical solution.
We implemented the analytical solution in MATLAB and compared its steady
state and transient responses against those of the HSPICE simulation of the pulsatile
71
model. We triggered the transient responses by applying step changes in the resistance
R 3 and cycle period T, and the comparisons showed that the maximum relative error
in the characteristic quantities of the voltage waveforms is no more than 1.79%. Next
we implemented the full analytical solution and the discrete-time solution in the C
programming language to make use of Linux's Gprof utility to evaluate the relative
computational efficiency of the solutions in terms of CPU time. A comparison of
averaged CPU time for a simulation run of 10,000 cycles showed that the discretetime analytical solution reduces the computation time of a numerical simulation of
the pulsatile model by a factor of 5000.
In Chapter 5, we performed a sensitivity analysis on the model parameters based
on the analytical solution. However, the analysis was done on a numerical basis, due
to the computational difficulty involved in differentiating the Lambert's W function.
Therefore, future work should include a symbolic approach to analyzing parameter
sensitivity, possibly by further simplication of the analytical solution. In addition,
we also constructed a maximum likelihood (ML) estimator of the contractility ratio
(ES/Ed) based on observed hemodynamic data. While the contractility ratio is an
important cardiovascular parameter, we ultimately would like to estimate E, and
Ed
separately in order to completely characterize the elastance waveform.
It is our main conclusion that the analytical solution is very close to the "true"
solution of the pulsatile model, and yet registers very short CPU times as compared
to a numerical simulation of the model. The analytical solution has proven to be
very useful in parameter estimation problems as it provides an explicit mathematical
description of the system dynamics. Future work will include cardiovascular reflex
mechanisms as well as extension of the analytical solution to a more elaborate circulatory model.
72
Appendix A
Mathematical Working
A.1
Deriving V2 1 (t)
From Equation 3.6, we have
I 1(0)
CaR3 V2 (t) + CaR
3
V21 (t) =
(A.1)
To evaluate a first-order differential equation of the form,
±(t) = -p(t)x(t) + q(t)
(A.2)
we use the trick formula,
x(t) = e-P(t)
where p(t)
=
fo' p(T) dT
[jt eP(T)q(T) dT + KJ
(A.3)
and K is a constant, which is determined by the system's
initial conditions. Therefore,
(A.4)
p(t)
CaR 3
q(t)
CaR 3
73
(A.5)
p(t)
p(r) d
=
1CaR3
t
CaR 3
(A.6)
Using Equation A.3,
V21 (t) = e~CR3
=
e
=
(K
=
(21(0)
etR Vj(0) dT+ K
[10
CaR3
CaR3 [V,(0)eCaR3
-V1(0)) e
-
a
V(0)) e
-
Vn(O) + Kj
+Vn 1 (0)
+
CaR3
+ V11(0)
(A.7)
where the last equality follows from substituting t = 0 and we have obtained the
solution to the differential equation in closed-form as shown in Equation 3.7.
74
A.2
Deriving Qh3(t)
From Equation 3.32, we have the first-order differential equation
Qh3(t)
E 3 (t) + R 3 CaE 3 (t)
-
R 3 [1 + CaE 3 (t) Qh3(t)
1V (0)
R3 [I + CaE 3 (t)1
+
(A.8)
from which we define p(t) and q(t) as
E 3 (t) + R 3 CaE 3 (t)
p(t)
R 3 [1 + CaE 3 (t)]
1
CaR 3
Es--Ed _
3
±+E
(E. - Ed)t + CaE3(0)
C a2R
CaR3 1+
(A.9)
V1
q(t)
R 3 [1 + CaE(t)]
V1
R3 1 +
(A.10)
(E. - Ed)t + CA]
p(t)
CaR 3
O CaR 3 11+
CaR 3
where 3 = -(E
(Es - Ed)T + CaE 3 (d0)
[Ca
C R 3 (Es-E)
R3(E -Ed
E -Ed)
+ln
"Y
-
1
--
SC
C aE,-Ed4
E8 - EI)
t
+
CaR 3
t
C R 3 E,-E1
t
_
/ CaR 3
In
1+
\n
-(Es
To
Ca
-
Ed)T + CaE
3
(A.11)
+
7
- Ed) and 7 = CaE 3 (0) +1. We apply the formula in Equation A.3
by evaluating each term separately,
e-p()
=
e
=
(t+
+
(
t
Ca R 3
Y )0Cca R3
75
(0)
e
)/3caR3
-aR
3
(A.12)
t
t ep')q(r)d-r
V 1 (0)
eTR
Jo
-
/3T+
R 3 (OT+)
+
V11(O)
~aR
(
/3T+
3
dT
7f
1
/3CaR 3
CR
1
It e CaR 3
31F+
(A.13)
dT
-
Putting the terms together, we have
Qh 3 (t)
=
t+
O3CaR
1 -1
3
eR
(0 )
1
C
R3
= t +
(CaR3
a
[V
11 (0)
IR3
1
OCaR
-1
(
13TR3
'
_1
1
e
It
3
7t 3
CaR
dT+ K
OT +
eOR
iI
13+
Ca3
CR
3
dT + Qh3(0)
(A.14)
where the last equality follows from substituting t = 0.
76
A.3
Deriving Qh6(t)
From Equation 3.59, we have
Q
6
(t)
Ed-Est +
T R1
-
ER )) Qh 6 (t)
Vi1 (0)
(A.15)
R1
from which we define p(t) and q(t) as
Ed- Es + E6 (0)
R1
Tf R1
V 1 (0)
p(t)
q(t)
=
(A.16)
(A.17)
Integrating p(t), we have
Et2 +
pM) = Ed2Tf R1
E6(0)
(A.18)
t
R1
and we apply the formula in Equation A.3 by evaluating the terms separately,
e-p(t)
=
e-
=
e
(Ed-Es t 2 + E6(0) t)
2T R 1
Es -Ed t2
t
JOtep(-)q(T) dT
E6(0)t
R1
2Tf R1
J
Ed-Es
(A.19)
2
E 6 (O)r
e2TfRITRI
R,1
0
dT
(A.20)
Putting the terms together, we have
Es--Edt2
Qh6 (t)
e
-
2Tf R 1
Es -Ed t2
=
e 2Tf R 1
Ed-Es
E6(0)t
R1
E 6 ()
R1
2Tf R1
Ed-Es
t
fo t e
R,
2TfRT
where we obtain the last equality from setting t = 0.
77
2
E 6 (O)
R1
d
E 6 () +
R1
T+
+
K)
Es
(A.21)
A.4
Deriving Qh7(t)
From Equation 3.70,
(A.22)
Qh7(t) +
--
' h (t)
from which we define
Ed
(A.23)
p(t)
=
q(t)
V1(0)
(A.24)
We apply Equation A.3 directly
Qh7 (t)
e- f
-
-
e
p(u) du (t
At
R 1 Rdt
-
e
t
Vii(0)er
dT
fu
(V11 (0) eRj
=t(V
R
efo p(r) drq(T) d-r + K)
Qh ()
--
where K is found to be Qh7(0) by setting t = 0.
78
_
1
+K)
(0)
Ed
Ed ) +
+K)
V 1 (0)
Ed
(A.25)
Appendix B
Program Codes
B.1
Analytical Solution in MATLAB
%Initalizing system parameters
templ=15.0337; temph=12.7383; temp2=91.2281;
Es=2.5; Ed=0.1; T=1; Ts=T/3; Tf=T/6;
Ca=2; R3=1; Cv=100; R1=0.03; R2=0.01;
V1=zeros(1,1); V2=zeros(1,1); Vh-zeros(1,1); Qh=zeros(1,1);
for no-oLcycles=1:30
%Region I
Vlo=templ;
10
V2o=temp2;
Vho=temph;
tl=((Vlo-Vho)*Ed*Ts)/(Vho*(Es-Ed));
t=0:0.01:t 1;
E1=((Es-Ed)*t)/Ts+Ed;
Vhl=(Vho*(Es-Ed)*t)/(Ed*Ts)+Vho;
VI 1=zeros(1,length(t));
for k=1:length(t)
79
V11(k)=Vlo;
end;
20
V21=(V2o-Vlo)*exp(-t/(Ca*R3))+Vlo;
Qhl=Vhl./E1;
%Region II
Vh2o=(Vho*(Es-Ed)*t1)/(Ed*Ts)+Vho;
V22o=(V2o-Vlo)*exp(-tl/(Ca*R3))+Vlo;
E2o=((Es-Ed)*tl)/Ts+Ed;
input 1=-Ed*Ts* (-V22o+Vlo)*
exp(-Ts*(-Vho*E2o+Vlo*Ed)/Vho/Ca/R3/(Es-Ed))/
Vho/Ca/R3/(Es-Ed);
30
t2a= (Vlo*Ed*Ts-Vho*E2*Ts+Vho*Ca*R3*lambertw(input 1)*
Es-Vho*Ca*R3*lambertw(input 1) *Ed)/ (Es-Ed)/Vho;
t2=t2a+tl;
ta=0:0.01:t2a;
E2=((Es-Ed)*ta)/Ts+E2o;
Vh2=(Vho*(((Es-Ed)*ta)/Ts+E2o))/Ed;
V22=(V22o-Vlo)*exp(-ta/(Ca*R3))+Vlo;
V12=zeros(1,length(t2a));
for k=1:length(ta)
V12(k)=Vlo;
40
end;
Qh2=Vh2./E2;
%Region III
Vh3o=((((Es-Ed)*t2a)/Ts+E2o)*Vho)/Ed;
V23o=Vh3o;
E3o=((Es-Ed)*t2a)/Ts+E2o;
t3=Ts;
80
t3a=t3-t2;
tb=0:0.01:t3a;
50
V13=zeros (1,length(t3a));
for k=1:length(tb)
V13(k)=Vlo;
end;
E3=((Es-Ed)*tb)/Ts+E3o;
A=((((Ca*(Es-Ed)*tb)/Ts+1+Ca*E3o)/(1+Ca*E3o)).^
(-1+Ts/(R3*(Es-Ed)*(Ca^2)))).*exp(-tb/(Ca*R3));
C=(1+Ca*E3o)^(-Ts/(R3*(Es-Ed)*(Ca^2)));
D=((1+Ca*E3o+(Ca/Ts)*(Es-Ed)*t3a)^
(-Ts/(R3*(Es-Ed)*(Ca^2))))*exp(t3a/(Ca*R3));
60
B=(Vlo/R3)*((1+Ca*E3o)^(-1+Ts/(R3*(Es-Ed)*(Ca^2))))*
0.5*(C+D)*tb;
Qh3=A.*(B+Vho/Ed);
Vh3=Qh3.*E3;
V23=Vh3;
%Region V
AA=((((Ca*(Es-Ed)*t3a)/Ts+l+Ca*E3o)/(1+Ca*E3o))^
(-1+Ts/(R3*(Es-Ed)*(Ca^2))))*exp(-t3a/(Ca*R3));
CC=(1+Ca*E3o)^(-Ts/(R3*(Es-Ed)*(Ca^2)));
DD=((1+Ca*E3o+(Ca/Ts)*(Es-Ed)*t3a)^
(-Ts/(R3*(Es-Ed)*(Ca^2))))*exp(t3a/(Ca*R3));
BB=(Vlo/R3)*((1+Ca*E3o)^(-1+Ts/(R3*(Es-Ed)*(Ca^2))))*
0.5*(CC+DD)*t3a;
Qh5o=AA*(BB+Vho/Ed);
E5o=((Es-Ed)*t3a)/Ts+E3o;
Vh5o=Qh5o*E5o;
V25o=Vh5o;
81
70
t5a= (((Es*Vlo)/Vh5o) -Es)/ ((1/Tf) *(Ed-Es));
t5=t5a+Ts;
80
tc=0:0.01:t5a;
E5= (1/Tf) *(Ed-Es)*tc+Es;
V25=(V25o-Vlo)*exp(-tc/(Ca*R3))+Vlo;
V15=zeros (1,length(t5a));
Qh5=zeros(1, length(t5a));
for k=1:length(tc)
V15(k)=Vlo;
Qh5(k)=Vh5o/Es;
end;
Vh5=Qh5.*E5;
90
%Region VI
t6a=0.5*T-t5;
Vh6o=Vlo;
Qh6o=Vh5o/Es;
V26o=(V25o-Vlo)*exp(-t5a/(Ca*R3))+Vlo;
E6o=(1/Tf)*(Ed-Es)*t5a+Es;
td=0:0.01:t6a;
E6=(1/Tf)*(Ed-Es)*td+E6o;
W=exp(((1/(2*Tf))*(Es-Ed)*(td.^2)/R1)-E6o*td/R1);
X=1;
Y=exp(((1/(2*Tf))*(Ed-Es)*(t6a^2)+E6o*t6a)/R1);
Z=(Vlo/R1)*(((Y-X)*(td.^2))/(2*t6a) + X*td);
Qh6=W.*(Z+Qh6o);
Vh6=Qh6.*E6;
V26=(V26o-Vlo)*exp(-td/(Ca*R3))+Vlo;
V16=zeros(1,length(t6a));
for k=1:length(td)
82
100
V16(k)=Vlo;
110
end;
%Region VII
E7=Ed;
WW=exp(((1/(2*Tf))*(Es-Ed)*(t6a^2)/R1)-E6o*t6a/R1);
XX=1;
YY=exp (((1/(2*Tf)) *(Ed-Es) * (t6a^2)+E6o*t6a)/R1);
ZZ=(Vlo/R1)*(((YY-XX)*(t6a^2))/(2*t6a) + XX*t6a);
Qh7o=WW*(ZZ+Qh6o);
E7o=6* (Ed-Es) *t6a+E6o;
Vh7o=Qh7o*E7o;
120
V27o=(V26o-Vlo)*exp(-t6a/(Ca*R3))+Vlo;
t7a=0.5*T;
t7=T;
te=0:0.01:t7a;
Qh7=(Qh7o-Vlo/Ed)*exp((-Ed*te)/R1)+Vlo/Ed;
Vh7=Qh7*Ed;
V27=(V27o-Vlo)*exp(-te/(Ca*R3))+Vlo;
V17=zeros (1,length(t7a));
for k=1:length(te)
V17(k)=Vlo;
130
end;
%Initial conditions for next cycle
temph=Ed*((Qh7o-Vlo/Ed)*exp((-Ed*t7a)/R1)+Vlo/Ed);
temp2=(V27o-Vlo)*exp(-t7a/(Ca*R3))+Vlo;
temp1=((Vlo*Cv+Vho/Ed+V2o*Ca)-temph/Ed-temp2*Ca)/Cv;
%Generatingvoltage waveforms
83
m= (no-oLcycles- 1) *100;
al=length(Vhl);
140
bl=length(Vh2);
cl=length(Vh3);
dl=length(Vh5);
el=length(Vh6);
fl=length(Vh7);
tf=0:0.01: (al+bl+cl+d+e+fl+m)*0.01-0.01;
for a=1:al
VI(a+m)=V11(a);
Vh(a+m)=Vhl(a);
V2(a+m)=V21(a);
150
Qh(a+m)=Qhl(a);
end;
for b=1:bl
Vl(al+b+m)=V12(b);
Vh(al+b+m)=Vh2(b);
V2(al+b+m)=V22(b);
Qh(al+b+m)=Qh2(b);
end;
for c=1:cl
V1(al+bl+c+m)=V3(c);
160
Vh(al+bl+c+m)=Vh3(c);
V2(al+bl+c+m)=V23(c);
Qh(al+bl+c+m)=Qh3(c);
end;
for d=1:dl
Vi(al+bl+cl+d+m)=V15(d);
Vh(al+bl+cl+d+m)=Vh5(d);
V2(al+bl+cl+d+m)=V25(d);
84
Qh(al+bl+cl+d+m)=Qh5(d);
end;
170
for e=1:e1
V1(al+bl+c+d+e+m)=V16(e);
Vh(a1+bl+c1+d1+e+m)=Vh6(e);
V2(al+bl+cl+dl+e+m)=V26(e);
Qh(a1+bl+c1+d1+e+m)=Qh6(e);
end;
for f=1:fl
Vi(al+bl+cl+dl+el+f+m)=V17(f);
Vh(al+bl+cl+dl+el+f+m)=Vh7(f);
V2(al+bl+cl+dl+el+f+m)=V27(f);
Qh(al+bl+cl+dl+e+f+m)=Qh7(f);
end;
end;
%Plotting the waveforms
figure(1);
plot(tfVh,' -',tfV1,' -- ',tfV2,'-. ');
85
180
B.2
Analytical Solution in C
#include <stdio.h>
#include <math.h>
/* Initialize system parameters */
#define ES 2.5
#define ED 0.1
#define CA 2.0
#define CV 100.0
#define R1 0.03
#define R2 0.01
10
#define MAXPT 2000000
#define CYCLE 30
#define TIMESTEP 0.0001
#define stepno 10000
double LambertW(const double z);
const int dbgW=0;
int main(void)
{
20
/*
Variable declaration */
int i, k, total, n, m, r;
double
j,
TS, T, Tf, R3;
double tempi, temp2, temph, tempq;
double vlo, v2o, vho, ti, qho, vii, v21, vhl, qhl, el;
double vh2o, v22o, e2o, t2a, t2, qh2o;
double v12, vh2, v22, qh2, e2;
86
double vh3o, v23o, e3o, t3a, t3, qh3o, v13;
double vh3, v23, qh3, e3, a, b, c, d;
30
double aa, bb, cc, dd, qh5o, e5o, vh5o, v25o;
double t5a, t5, qh5, v15, v25, vh5, e5;
double t6, t6a, qh6o, e6o, vh6o, v26o;
double w, x, y, z, qh6, v16, v26, vh6, e6;
double t7, t7a, qh7o, e7o, vh7o, v27o;
double ww, xx, yy, zz, qh7, vh7, v27, v17, e7;
double vh[MAXPT];
double vl[MAXPT];
double v2[MAXPT];
double time[MAXPT];
40
double qh[MAXPT];
double inputi;
T = 1.0;
R3 = 1.0;
Ts = T/3.0;
Tf = T/6.0;
tempi = 15.0337;
temp2 = 91.2281;
temph = 12.7383;
50
n = 1;
time[0] = 0;
vl[O]
=
tempi;
v2[0]
=
temp2;
vh[0]
=
temph;
for (k = 0; k < CYCLE; ++k)
{
87
/* Region I */
vlo
=
tempi;
v2o
=
temp2;
vho
=
temph;
qho = vho
/
ti = ((vlo
-
60
ED;
vho) * ED * Ts) / (vho * (ES - ED));
for (j = TIMESTEP;
j
<= ti;
j
=
j
+ TIMESTEP)
{
el = ((ES - ED) *
vhl = (vho * (ES
v11
=
/ Ts + ED;
ED) *
j)
/ (ED * Ts) + vho;
vlo;
70
v21 = (v2o
-
/
qhl = vhl
j
time[n] =
vl[n]
-
j)
=
vlo) * exp(-j / (CA * R3)) + vlo;
el;
+ k
vii;
vh[n] = vh1;
v2[n] = v21;
n
=
n + 1;
}
/* Region II */
80
vh2o = (vho * (ES
v22o = (v2o
e2o = ((ES
-
ED) * ti) / (ED * Ts) + vho;
vlo) * exp(-1 * tl / (CA * R3)) + vlo;
-
ED) * t1) / Ts + ED;
-
/
qh2o = vh2o
e2o;
inputi = -ED
* Ts * (-v22o + vlo) *
/
exp(-Ts * (-vho * e2o + vlo * ED)
vho
/ CA / R3 / (ES - ED)) /
CA /R3
/(ES-
ED);
88
vho
/
t2a = (vlo * ED * Ts - vho * e2o * Ts
+
vho * CA * R3 * LambertW(inputl) * ES -
90
vho * CA * R3 * LambertW(inputl) * ED) / (ES - ED)
/
vho;
t2 = t2a + ti;
for (j = TIMESTEP;
j
j
<= t2a;
=
j
+ TIMESTEP)
{
e2 = ((ES - ED) *
j)
vh2 = (vho * (((ES
-
/ Ts + e2o;
j)
/
ED) *
v22 = (v22o - vlo) * exp(-j
/ Ts + e2o))
/
ED;
(CA * R3)) + vlo;
v12 = vlo;
qh2 = vh2 / e2;
time[n] =j + k + ti;
100
vl[n] = v12;
vh[n] = vh2;
v2[n] = v22;
n = n + 1;
}
/* Region III */
vh3o = ((((ES - ED) * t2a)
/
Ts + e2o) * vho)
/
ED;
v23o = vh3o;
e3o = ((ES - ED) * t2a) / Ts + e2o;
110
qh3o = vh3o / e3o;
t3 = Ts;
t3a = t3 - t2;
for (j = TIMESTEP;
j
<= t3a;
j
=
j
+ TIMESTEP)
{
e3 = ((ES - ED) *
j) /
a = pow(((CA * (ES
-
Ts + e3o;
ED) * j) / Ts + 1 + CA * e3o)
(1 + CA * e3o),-1 + Ts
89
/
/
(R3 * (ES - ED) * pow(CA,2))) * exp(-j / (CA * R3));
c
=
pow(1 + CA * e3,-Ts / (R3 * (ES - ED) * pow(CA,2)));
d
=
pow(1 + CA * e3o + (CA / Ts) * (ES
/
-Ts
b
=
(vlo
(R3 * (ES
/
-
-
120
ED) *j,
ED) * pow(CA,2))) * exp(j
/
(CA * R3));
R3) * 0.5 * (c + d) * j * pow(1 + CA * e3o,-1 +
Ts / (R3 * (ES - ED) * pow(CA,2)));
qh3 = a * (b + vho / ED);
vh3 = qh3 * e3;
v23 = vh3;
v13 = vlo;
time[n] =
vl[n]
=
j
+ k + t2;
v13;
130
vh[n] = vh3;
v2[n] = v23;
n
=
n + 1;
}
/* Region V */
aa
=
pow(((CA * (ES - ED) * t3a)
-1
/
Ts + 1 + CA * e3o)
+ Ts / (R3 * (ES - ED) * pow(CA,2))) * exp(-t3a
/
(1 + CA * e3o),
/
(CA * R3));
cc = pow(1 + CA * e3o,-Ts / (R3 * (ES - ED) * pow(CA,2)));
dd = pow(1 + CA * e3o + (CA / Ts) * (ES -ED)
-Ts / (R3 * (ES
-
* t3a,
ED) * pow(CA,2))) * exp(t3a / (CA * R3));
bb = (vlo / R3) * 0.5 * (cc + dd) * t3a * pow(1 + CA * e3o,
-1
qh5o
=
+ Ts / (R3 * (ES - ED) * pow(CA,2)));
aa * (bb + vho / ED);
e5o = ((ES - ED) * t3a) / Ts + e3o;
vh5o = qh5o * e5o;
v25o = vh5o;
t5a = ((((ES * vlo) / vh5o) - ES)*Tf) / (ED - ES);
90
140
t5 = t5a
+ Ts;
for (j = TIMESTEP;
j
<= t5a;
j
=
j
+ TIMESTEP)
150
{
e5 = ((ED
ES)/Tf) * j + ES;
-
/
qh5 = vh5o
ES;
vh5 = qh5 * e5;
/
v25 = (v25o - vlo) * exp(-j
(CA * R3)) + vlo;
v15 = vlo;
time[n] =
j
+ k + t3;
vl[n] = v15;
vh[n] = vh5;
v2[n] = v25;
n = n
160
+ 1;
}
/* Region VI */
t6 = 0.5*T;
t6a = t6 - t5;
vh6o = vlo;
qh6o = vh5o / ES;
v26o = (v25o - vlo) * exp(-t5a
/
(CA * R3)) + vlo;
e6o = ((ED - ES)/Tf) * t5a + ES;
x =
170
1;
y = exp((((ED-ES)/(2*Tf))*pow(t6a,2)+e6o*t6a)/R1);
for (j = TIMESTEP;
j
<= t6a;
j
=
j
+ TIMESTEP)
{
e6 = ((ED - ES)/Tf) * j + e6o;
w= exp((((ES
z = (vlo
/
-
ED)/(2*Tf)) * pow(j,2) / Ri) - e6o * j
/
Ri) * (((y - x) * pow(j,2)) / (2 * t6a) + x * j);
qh6 = w * (z + qh6o);
91
Ri);
vh6
qh6 * e6;
=
v26 = (v26o - vlo) * exp(-j / (CA * R3)) + vlo;
v16
vlo;
=
time[n] =
vl[n]
180
=
j
+ k + t5;
v16;
vh[n] = vh6;
v2[n] = v26;
n = n + 1;
}
/* Region VII */
ww=
xx =
exp((((ES - ED)/(2*Tf)) * pow(t6a,2) / RI) - e6o * t6a / Ri);
190
1;
yy = exp(((ED - ES)/(2*Tf)) * pow(t6a,2) / RI + e6o * t6a / Rl);
zz = (vlo
/
Ri) * (((yy - xx) * pow(t6a,2)) / (2 * t6a) + xx * t6a);
qh7o = ww * (zz + qh6o);
e7o = ((ED
-
ES)/Tf) * t6a + e6o;
vh7o = qh7o * e7o;
v27o = (v26o - vlo) * exp(-t6a
/
(CA * R3)) + vlo;
t7a = 0.5*T;
t7 = T;
for (j = TIMESTEP;
j
<= t7a;
j
=
j
+ TIMESTEP)
200
{
e7
=
ED;
qh7 = (qh7o - vlo
/
ED) * exp((-ED *
j)
/ Ri) + vlo
vh7 = qh7 * ED;
v27 = (v27o -
vlo) * exp(-j / (CA * R3)) + vlo;
v17 = vlo;
vl[n] = v17;
vh[n] = vh7;
92
/
ED;
v2[n] = v27;
n = n + 1;
210
}
/* Initial conditions for new cycle */
tempq = (qh7o
-
vlo
/
ED) * exp((-ED * t7a) / Ri) + vlo / ED;
temph = tempq * ED;
temp2 = (v27o
-
vlo) * exp(-t7a / (CA * R3)) + vlo;
tempi = ((vlo*CV+vho/ED+v2o*CA)-temph/ED-temp2*CA)/CV;
}
/*
Plot voltage waveforms */
total
220
=n;
for (i = 0; i < total; ++i)
printf("X8.4f %8.4f%8.4f %8.4f\n",time[i], v1[i], vh[i], v2[i]);
return 0;
}
/* Lambert's W function by Briggs (2001) */
double LambertW(const double z)
{
230
int i;
const double eps = 4.0e-16, emi = 0.3678794411714423215955237701614608;
double p, e, t, w;
if (dbgW) fprintf(stderr,"LainbertW: z=%g\n",z);
if (z < -emi)
{
93
fprintf(stderr,"LambertW: bad argument %g, exiting. \n",z); exit(1);
240
}
if (z == 0.0) return 0.0;
//
series near -emi
in sqrt(q)
if (z < -eml + le-4)
{
double q = z + emi, r
=
sqrt(q), q2 = q * q, q3 = q2 * q;
return
-
1.0
+ 2.331643981597124203363536062168 * r
250
- 1.812187885639363490240191647568 * q
+ 1.936631114492359755363277457668 * r * q
- 2.353551201881614516821543561516 * q 2
+ 3.066858901050631912893148922704 * r * q2
- 4.175335600258177138854984177460 * q 3
+ 5.858023729874774148815053846119 * r * q3
- 8.401032217523977370984161688514 * q3 * q;
//
error approx le-16
}
/* initial approx for iteration */
260
if (z < 1.0)
{
/* series near 0 */
p = sqrt(2.0 * (2.7182818284590452353602874713526625
w = -1.0
* z + 1.0));
+ p * (1.0 + p * (-0.333333333333333333333 +
p * 0.152777777777777777777777));
}
else
w = log(z); /* asymptotic */
94
if (z > 3.0) w-=log(w);
270
for (i = 0; i < 10; i++)
{
/* Halley iteration */
e
=
exp(w);
t = w * e - z;
p
=
w + 1.0;
t/=e*p-0.5*(p+1.0)*t/p;
W-=t;
if (fabs(t) < eps * (1.0 + fabs(w))) return w;
/* relative-absolute error
}
280
/* error warning */
fprintf(stderr,"LambertW: No convergence at z=%g, exiting.\n",z);
exit(1);
}
95
Discrete-time Analytical Solution in C
B.3
#include <stdio.h>
#include <math.h>
/* Initialize system parameters */
#define ES 2.5
#define ED 0.1
#define CA 2.0
#define CV 100.0
#define RI 0.03
10
#define R2 0.01
#define MAXPT 2000000
#define CYCLE 30
#define TIMESTEP 0.0001
#define stepno 10000
double LambertW(const double z);
const int dbgW=0;
int main(void)
{
20
/* Variable declaration *7
int i, k, total, n, m, r;
double
j,
TS, T, Tf, R3;
double tempi, temp2, temph, tempq;
double vlo, v2o, vho, t,
qho, vii, v21, vhl, qhl, el;
double vh2o, v22o, e2o, t2a, t2, qh2o;
double v12, vh2, v22, qh2, e2;
96
double vh3o, v23o, e3o, t3a, t3, qh3o, v13;
double vh3, v23, qh3, e3, a, b, c, d;
30
double aa, bb, cc, dd, qh5o, e5o, vh5o, v25o;
double t5a, t5, qh5, v15, v25, vh5, e5;
double t6, t6a, qh6o, e6o, vh6o, v26o;
double w, x, y, z, qh6, v16, v26, vh6, e6;
double t7, t7a, qh7o, e7o, vh7o, v27o;
double ww, xx, yy, zz, qh7, vh7, v27, v17, e7;
double vh[MAXPT];
double vl[MAXPT];
double v2[MAXPT];
double time[MAXPT];
40
double qh[MAXPT];
double inputi;
T = 1.0;
R3 = 1.0;
Ts = T/3.0;
Tf = T/6.0;
tempi = 15.0337;
temp2 = 91.2281;
temph = 12.7383;
50
n = 1;
time[0] = 0;
vl[0] = tempi;
v2[0] = temp2;
vh[0] = temph;
for (k = 0; k < CYCLE; ++k)
{
97
/* Region I */
60
vlo = tempi;
v2o = temp2;
vho = temph;
qho = vho
/
ti = ((vlo
-
ED;
vho) * ED * Ts) / (vho * (ES - ED));
/* Region II */
vh2o = (vho * (ES - ED) * ti) / (ED * Ts) + vho;
v22o = (v2o
e2o = ((ES
vlo) * exp(-1 * tl / (CA * R3)) + vlo;
-
ED) * ti) / Ts + ED;
-
/
qh2o = vh2o
70
e2o;
inputi = -ED
* Ts * (-v22o + vlo) *
exp(-Ts * (-vho * e2o + vlo * ED)
vho
/
CA
/
R3 / (ES - ED))
CA /R3 /(ES
t2a
=
/
vho
/
/
- ED);
(vlo * ED * Ts - vho * e2o * Ts
+
vho * CA * R3 * LambertW(inputl) * ES vho * CA * R3 * LambertW(inputl) * ED)
t2
=
t2a
/
(ES
-
ED)
/
vho;
+ ti;
80
/* Region III */
vh3o = ((((ES - ED) * t2a) / Ts + e2o) * vho)
v23o = vh3o;
e3o = ((ES - ED) * t2a) / Ts + e2o;
qh3o = vh3o / e3o;
t3 = Ts;
t3a = t3 - t2;
98
/
ED;
/* Region V */
aa = pow(((CA * (ES - ED) * t3a) / Ts + 1 + CA * e3o)
-1
/
+ Ts / (R3 * (ES - ED) * pow(CA,2))) * exp(-t3a
(1 + CA * e3o), 90
/
(CA * R3));
cc = pow(1 + CA * e3,-Ts / (R3 * (ES - ED) * pow(CA,2)));
dd = pow(1 + CA * e3o + (CA / Ts) * (ES
-Ts / (R3 * (ES
-
-
ED) * t3a,
ED) * pow(CA,2))) * exp(t3a / (CA * R3));
bb = (vlo / R3) * 0.5 * (cc + dd) * t3a * pow(1 + CA * e3o,
-1
+ Ts / (R3 * (ES - ED) * pow(CA,2)));
qh5o = aa * (bb + vho / ED);
e5o = ((ES - ED) * t3a) / Ts + e3o;
vh5o = qh5o * e5o;
v25o
=
vh5o;
100
t5a = ((((ES * vlo) / vh5o) - ES)*Tf)
t5
=
/
(ED - ES);
t5a + Ts;
/* Region VI */
t6 = 0.5*T;
t6a = t6 - t5;
vh6o = vlo;
qh6o = vh5o / ES;
v26o = (v25o - vlo) * exp(-t5a / (CA * R3)) + vlo;
e6o = ((ED - ES)/Tf) * t5a + ES;
x =
110
1;
y = exp((((ED-ES)/(2*Tf))*pow(t6a,2)+e6o*t6a)/R1);
/* Region VII */
ww = exp((((ES
-
ED)/(2*Tf)) * pow(t6a,2) / Ri) - e6o * t6a
/
RI);
xx = 1;
yy = exp(((ED
-
ES)/(2*Tf)) * pow(t6a,2) / Ri + e6o * t6a
/
RI);
zz = (vlo / RI) * (((yy - xx) * pow(t6a,2)) / (2 * t6a) + xx * t6a);
99
qh7o
=
ww * (zz + qh6o);
e7o = ((ED
-
ES)/Tf) * t6a + e6o;
120
vh7o = qh7o * e7o;
v27o = (v26o - vlo) * exp(-t6a / (CA * R3)) + vlo;
t7a = 0.5*T;
t7 = T;
/* Initial conditions for new cycle */
tempq = (qh7o
-
vlo
/
ED) * exp((-ED * t7a) / R1) + vlo / ED;
temph = tempq * ED;
temp2 = (v27o
-
vlo) * exp(-t7a / (CA * R3)) + vlo;
tempi = ((vlo*CV+vho/ED+v2o*CA)-temph/ED-temp2*CA)/CV;
130
}
/* Store in array *7
time[k * 6 + 1] = tl + k
time[k * 6 + 2] = t2 + k
time[k * 6 + 3] = t3 + k
time[k * 6 + 4] = t5 + k
time[k * 6 + 5] = t6 + k
time[k * 6 + 6] = t7 + k ;
140
vl[k * 6 + 1] = vlo;
vl[k * 6 + 2] = vlo;
vl[k * 6 + 3] = vlo;
v1[k * 6 + 4] = vlo;
v1[k * 6 + 5] = vlo;
vl[k * 6 + 6] = vlo;
100
v2[k * 6 + 1] = v22o;
v2[k * 6 + 2] = v23o;
150
v2[k * 6 + 3] = v25o;
v2[k * 6 + 4] = v26o;
v2[k * 6 + 5] = v27o;
v2[k * 6 + 6] = temp2;
vh[k * 6 + 1] = vh2o;
vh[k * 6 + 2] = vh3o;
vh[k * 6 + 3] = vh5o;
vh[k * 6 + 4]
vh6o;
vh[k * 6 + 5] = vh7o;
vh[k * 6 + 6]
160
temph;
}
/* Plot discrete-time points */
total
=
k * 6;
for (i = 0; i < total + 1; ++i)
printf("X8.4f %8.4f%7.4fX8.4f\n", time[i], vh[i], v1[i], v2[i]);
return 0;
170
/* Lambert's W function by Briggs (2001)
*7
double LambertW(const double z)
{
int i;
const double eps = 4.0e-16, emi = 0.3678794411714423215955237701614608;
double p, e, t, w;
101
if (dbgW) fprintf(stderr,"LambertW:
z=Xg\n",z);
180
if (z < -eml)
{
fprintf(stderr,"LambertW: bad argument %g, exiting. \n",z); exit(1);
}
if (z == 0.0) return 0.0;
// series near -emi in sqrt(q)
if (z < -emi + le-4)
190
{
double q = z + emi, r = sqrt(q), q2 = q * q, q3 = q2 * q;
return
-
1.0
+ 2.331643981597124203363536062168 *r
- 1.812187885639363490240191647568 * q
+ 1.936631114492359755363277457668
* r * q
- 2.353551201881614516821543561516
*q2
+ 3.066858901050631912893148922704 *r * q2
- 4.175335600258177138854984177460 * q3
+ 5.858023729874774148815053846119 *r * q3
- 8.401032217523977370984161688514
*
q3 * q;
200
//
error approx le-16
}
/*
initial approx for iteration */
if (z < 1.0)
{ /* series near 0 *7
p = sqrt(2.0 * (2.7182818284590452353602874713526625
w = -1.0
* z + 1.0));
+ p * (1.0 + p * (-0.333333333333333333333 +
102
p * 0.152777777777777777777777));
}
210
else
w = log(z); /* asymptotic
*/
if (z > 3.0) w-=og(w);
for (i = 0; i < 10; i++)
{ /* Halley iteration *7
e = exp(w);
t = w * e - z;
p
=
w + 1.0;
220
t/=e*p-0.5*(p+1.0)*t/p;
w-=t;
if (fabs(t) < eps * (1.0 + fabs(w))) return w; /* relative-absolute error *7
}
/* error warning *7
fprintf(stderr,"LambertW: No convergence at z=Xg,
exit(1);
}
103
exiting. \n",z);
Bibliography
[1] Thomas S. Ahrens and Laura A. Taylor. Hemodynamic Waveform Analysis. W.B.
Saunders, 1992.
[2] Vahe A. Caliskan, George C. Verghese, and Aleksandar M. Stankovic. Multifrequency averaging of DC/DC converters. IEEE Transactions on Power Electronics,
14(1):124-133, January 1999.
[3] Jolie L. Chang. Cycle-averaged models of cardiovascular dynamics. M.Eng Thesis,
Department of Electrical Engineering and Computer Science, MIT, May 2002.
[4] T. L. Davis. Teaching physiology through interactive simulation of hemodynamics.
M.S. Thesis, Department of Electrical Engineering and Computer Science, MIT,
February 1991.
[5] Raymond A. DeCarlo. Linear Systems: A State Variable Approach with Numerical
Implementation. Prentice Hall, 1989.
[6] Thomas Heldt, Eun B. Shim, Roger D. Kamm, and Roger. G. Mark. Computational modeling of cardiovascular response to orthostatic stress. Journal Applied
Physiology, 92:1239-1254, March 2002.
[7] Thomas Heldt, Jolie L. Chang, George C. Verghese, Roger G. Mark. Cycleaveraged models of cardiovascular dynamics. To appear in: Proceedings of the 5th
IFAC Symposium on Modeling anf Control in Biomedical Systems, International
Federation of Automation and Control, 2003.
105
[8] John G. Kassakian, Martin F. Schlecht, and George C. Verghese. Principles of
Power Electronics. Addison-Wesley, 1991.
[9] Star-Hspice Manual. http://www.ee.washington.edu/class/cadta/hspice/,
2nd
edition, July 1998.
[10] Brian W. Kernighan and Dennis M. Ritchie. The C Programming Language.
Prentice Hall, 1988.
[11] Arthur J. Vander, James H. Shermanm and Dorothy S. Luciano. Human Physiology: The Mechanisms of Body Function. McGraw Hill, 1990.
[12] Sunagawa K. and K. Sagawa. Models of ventricular contraction based on timevarying elastance. Crit Rev Biomed Eng, 7(3):193-228, 1982.
[13] Anatomy of the Human Heart. http://www.tmc.edu/thi/anatomy2.html,
2003.
106
July
Download