Project 1: Using Linear Systems Analysis and STELLA to Model Cardiac Response to CPR Stimuli

18
Using Linear Systems Analysis and STELLA to Model Cardiac Response to CPR Stimuli Rough Draft David v. Rudisill Dr. Karl Romstedt December 7, 2012

Transcript of Project 1: Using Linear Systems Analysis and STELLA to Model Cardiac Response to CPR Stimuli

Using Linear Systems Analysis and STELLAto Model Cardiac Response to CPR Stimuli

Rough Draft

David v. RudisillDr. Karl Romstedt

December 7, 2012

Introduction and Background

This paper seeks to use linear systems analysis to model the cardiac responseto stimuli that occur during cardio pulmonary resuscitation (CPR). Usinga reasonable model for the cardiac response to an electric shock, we candetermine how the heart will respond to other stimuli that might occur duringCPR, such as chest-compressions. In doing so, we hope to gain some insightas to how the heart responds to different methods of CPR as well as therelative effectiveness of each method. Necessary material from linear systemsanalysis will first be introduced, followed by the cardiac model. An analysisof the cardiac model will then be presented along with a STELLA simulation.Finally, concluding remarks will be given.

Imagine a thin steel bar of length L suspended between two points, andsuppose that a hammer strikes the bar with a force F (t). How might wemodel the force F (t) produced by the hammer as a function of time, andwhat is the response y(t) of the bar being struck by the hammer? Since thehammer produces a force for a very short period of time, and the force isrelatively constant over the short period of time, we can model F (t) as a tall,thin spike beginning at t = 0. To express F (t) with an explicit formula, it ishelpful to introduce the ε-impulse function,

δε(t) =

1

εif t ∈ [0, ε]

0 if t /∈ [0, ε]

(1)

The ε-impulse function can be visualized as a rectangle of height 1ε

andwidth ε with the area under the rectangle equal to 1. As ε→ 0, the heightof the rectangle approaches infinity, and the width of the base approaches 0.We can now express the force F (t) in terms of the ε-impulse function,

F (t) = F0δε(t) =

F0

εif t ∈ [0, ε]

0 if t /∈ [0, ε]

(2)

where the constant F0 is so chosen so that F (t) accurately representsthe force of the hammer.

Assuming no dissipative forces are at work, the steel bar oscillates in-definitely after having been struck with the hammer, and such motion canbe modeled with a simple sine wave as shown in Figure 1. The vertical dis-placement of the bar is measured from its midpoint, and the midpoint of thebar reaches a maximum displacement of ym above and below the equilibrium

1

position with each oscillation. This is the response of the steel bar tothe input force F (t). When F0 = 1, i.e., when the input force is the ε-impulsefunction, the response of the system is approximately given by the weighingfunction w(t). More generally and less precisely, the weighing function w(t)is how a system responds to an abrupt force of very short duration.

Knowledge of the weighing function is very useful, since with it we candetermine how a system responds to any forcing function f(t). For example,suppose that we have the same steel bar as before, and suppose we applyto the bar a force f(t) = 1

t. How does the system respond, i.e., what is

the response y(t)? The response can be determined with the convolutionoperation,

y(t) = w(t) ∗ f(t) =

∫ t

0

w(t− s)f(s)ds. (3)

In our example, the weighing function is w(t) = A sin(kt), and whenthe force f(t) = 1

tis applied to the steel bar, the response is,

y(t) = A sin(kt) ∗ 1

t= A

∫ t

0

sin(kt− ks)s

ds. (4)

A few more results are necessary before proceeding to the model. A veryuseful property of the ε-impulse function is the so-called shifting property,∫ ∞

−∞f(t)δε(t− a)dt ≈ f(a). (5)

That is, when the integral is taken, the ε-impulse function shifted byamount a ”picks out” the value a and evaluates f(t) at a. The shifting

2

property can be established as follows. Let F (t) denote the antiderviative off(t). Then,

∫ ∞−∞

f(t)δε(t− a)dt =1

ε

∫ a+ε

a

f(t)dt =F (t)

ε

∣∣∣∣a+εa

=F (a+ ε)− F (a)

ε. (6)

But, for small ε,

F (a+ ε)− F (a)

ε≈ F

′(a) = f(a), (7)

which establishes equation (5). A property related to the shifting prop-erty is known as the the scaling property: When a scaling transformationt→ ct is applied, we can express the scaled impulse function in terms of thenon-scaled impulse function,

δε(ct) =

1

εif ct ∈ [0, ε]

0 if ct /∈ [0, ε]

(8)

We see that this is equal to,

δε(ct) =

1

εif t ∈ [0, ε

c]

0 if t /∈ [0, εc]

=1

cδε/c(t), (9)

which establishes the shifting property.

Cardiac Resuscitation Model

We assume that initially the heart is in the zero-state, and that the heartexhibits a zero-state response to an electric shock. That is, if the functionsSV (t) and CO(t) denote the stoke volume and cardiac output respectivelyas functions of time, the zero state is the requirement that,

SV (0) = SV (1)(0) = . . . SV (n−1)(0) · · · = 0, (10a)

CO(0) = CO(1)(0) = . . . CO(n−1)(0) · · · = 0. (10b)

Equations (8a) and (8b) describe a heart initially at complete rest andwith no activity of any kind occurring.

3

We assume that the stroke volume SV (t) and cardiac output CO(t)satisfy the linear differential equations,

L1SV (t) = f1(t), L2CO(t) = f2(t), (11)

where L1 and L2 are both linear differential operators of order n andf1(t) and f2(t) are both forcing functions. We suppose that an electric shockof the form,

I(t) = I0δε(t), (12)

is applied to the heart at t = 0, and that the heart responds in somemanner. What might we take as a reasonable model of the cardiac response?We can assume that in the moments immediately proceeding the electricshock, the cardiac output (CO) is relatively weak, and as time increasesthe cardiac output grows stronger. This can be achieved by assuming thatinitially the end diastolic volume (EDV) is only slightly greater than theend systolic volume (ESV), and that the EDV grows with time (Figure 2).Eventually, we suppose that the CO and EDV reach normal levels.

With I0 = 1, our model for the SV response is,

4

wsv(t) = An

(EDVnormal − ESV

k

)(t− nk) + ESV, nk < t ≤ (n+ 1)k,

(13)where An is an increasing sequence and t0 = 0 for simplicity. Our model

for the response of the CO is,

wco(t) = HR(EDVnormal − ESV )∞∑j=0

Bjδε(t− jk), (14)

where Bj = εAj.When I0 6= 1, the responses of the CO and SV can beeasily found as follows. Let Rsv(t) and Rco(t) denote the responses of the SVand CO respectively to the electric shock given by equation (7). Then,

Rsv(t) ≈ whv(t) ∗ I0δε(t) = I0(wsv(t) ∗ δε(t)) = I0wsv(t), (15a)

Rco(t) ≈ wco(t) ∗ I0δε(t) = I0(wco(t) ∗ δε(t)) = I0wco(t). (15b)

Thus the cardiac responses to an electric shock of the form of equation(7) can be found by simply multiplying the weighing functions by I0. Dueto nonlinear effects, we expect that equations (10a) and (10b) are valid onlyfor small ranges of t and I0.

With our weighing functions for the CO and SV established, we cananswer the following question: How does the cardiac model respond to otherstimuli that might occur during CPR, such as chest compressions? Our modelfor chest compressions is taken to be,

fcc(t) =∞∑j=0

F0δε(t− jk). (16)

Equation (11) describes a total of m chest compressions given withconstant force F0 and with each compression lasting for a small time ε. Asbefore, we can determine the responses of the CO and the SV by using theconvolution operation. For simplicity, let

Cn = An

(EDVnormal − ESV

k

), (17a)

Dj = HR(EDVnormal − ESV )Bj. (17b)

Let Rsv(t) denote the response of the SV to the chest compressions. Itcan be shown that,

5

Rsv(t) = wsv(t) ∗ fcc(t)

= F0

m∑j=0

Cj[t− k(j + n)] + F0mESV. (17)

The response Rco(t) of the CO to chest compressions can be shown tobe,

Rco(t) = wco(t) ∗ fcc(t)

≈ F0

∞∑j=0

m∑i=0

Djδε(t− k[i+ j]). (18)

We can scale time t and parameter k with parameter T , and we canscale sequences Cj by C0 and Dj by D0 to obtain,

τ =t

T, κ =

k

T, Cj =

CjC0

, Dj =Dj

D0

, (20)

where T has units of time and τ and κ are both dimensionless. Withthese rescaled parameters, we can use the scaling property of the impulsefunction to express wco(t) and Rco(t) as,

wco(Tτ) =D0

T

∞∑j=0

Djδε/T (τ − κj), (21a)

Rco(Tτ) =F0D0

T

∞∑j=0

m∑i=0

Djδε/T (τ − κ[i+ j]). (21b)

Likewise, for the SV response on the interval nκ < τ ≤ (n+ 1)κ wehave,

wsv(Tτ) = C0TCn(τ − nκ) + ESV, (22a)

Rsv(Tτ) = F0C0Tm∑j=0

Cj(τ − κ[j + n]) + F0mESV. (22b)

We can take units in which,

D0

Tδε/T = C0T = 1. (23)

6

The sequence Dn depends on sequence Cn and largely determines thecardiac outputs. Sequence Dn can be approximately given by,

Dn ≈ wsv(T [nκ− ε])− ESV = Cn(κ− ε) ≈ κCn. (24)

We now consider how physically realistic the weighing and responsefunctions (20a) - (21b) are, and we implement them in a STELLA model.

Analysis of the Cardiac Model and STELLA implementation

The response Rco(Tτ) suggests that, as parameters F0 and m increase with-out bound, the cardiac response likewise increases without bound and in-creases by larger and larger amounts (see Appendix B). Clearly, this behav-ior can only hold until certain threshold values for F0 and m are reached;beyond these values, nonlinear effects occur and further increases in F0 andm do not produce linear increases in cardiac output. Similarly, the EDV forthe function Rsv(Tτ) can be made arbitrarily large by increasing F0 and mwithout bound as well (Appendix B). We can expect that Rco(Tτ) gives anaccurate representation of the cardiac output response to chest compressionsfor small values of F0 and m and for short times τ . As these parametersincrease, Rco(Tτ) becomes an increasingly inaccurate model of the cardiacoutput response.

We’ve also assumed that the weighing functions wco(Tτ) and wsv(Tτ)don’t go to zero as τ →∞. That is, we’ve assumed that the cardiac outputand stroke volume have ”infinite memories” and that an input at τ = 0 is”remembered” by the cardiac output and stroke volume as τ →∞. Formost physical systems, this is unrealistic, and we would expect the weighingfunction to go to zero as τ →∞. Infinite memory systems are in somerespects like systems in which friction is neglected; they’re useful only as afirst approximation. Additionally, our weighing functions are discontinuousand don’t satisfy the canonical condition that w(0) = w(1)(0) = . . . = wn−1(0)= 0.

We can use STELLA to determine what effect the weighing and re-sponse functions (20a) to (21b) have on the cardiovascular system as a whole.To implement the weighing function wco(Tτ), we can create a CO WeighingFunction flow that transports blood from the Heart Ventricle stock to theAorta stock. The Heart Ventricle and Aorta stocks are connected to theBody Tissues stock, Arterial Flow and Venous Flow flows as in the STELLAmodel for a single-chambered heart. The CO Weighing Function flow is con-nected to converters that store the values of kappa and the sequence Cn . Theweighing function wsv(Tτ) is connected to converters that store the values

7

of the ESV, sequence Cn, and kappa. The syntax used for the SV WeighingFunction flow is

SV_Weighing_Function = (Sequence_C) * (TIME - INT(TIME / KAPPA)

* KAPPA) + End_Systolic_Volume

Here, KAPPA = 5 and End Systolic Volume = 70. The syntax used forSequence C converter and CO Weighing Function flow are, respectively,

Sequence_C = IF TIME <= (INT(TIME/KAPPA) + 1) * KAPPA

AND TIME > INT(TIME/KAPPA) * KAPPA THEN

40 * (1 - EXP(-INT((TIME)/KAPPA) / 24))

ELSE 0

CO_Weighing_Function = PULSE(SV_Weighing_Function,KAPPA,KAPPA)

The IF and ELSE syntax impliment the requirement that nκ < τ ≤ (n+ 1)κand the syntax INT(TIME/KAPPA) gives the integer n. The schematics for theSTELLA model is shown below.

With the exception of the SV Weighing Function converter, CO Weigh-ing Function flow as well as the Sequence C and Kappa converters, the pa-rameter values for the cardiac resuscitation model are identical to those foundin the STELLA model for a single-chambered heart. Using these parametervalues, the cardiac resuscitation model produces the following graphs for theweighing functions wsv(Tτ) and wco(Tτ) and the Aorta, Heart Ventricle andBody Tissues stocks.

8

9

The SV Weighing Function flow describes a single-chambered heartwith an ESV of 70 and an EDV that approaches 120 like 1− e−kt. This is theSV response to the electric shock in equation (11) with I0 = 1. The responsefunctions Rco(Tτ) and Rhv(Tτ) can be implemented as follows. We can createa SV Response Function converter that’s connected to converters Compres-sion Number m, Compression Force F0, SV Weighing Function and End Sys-tolic Volume which contain the values m, F0, wsv(Tτ) and ESV respectively.The SV Weighing Function converter is connected to converters Sequence C,Kappa and End Systolic Volume as before. Converters Kappa and SequenceC also connect to converter Sequence D. Finally, the CO Response Func-tion flow is connected to the Compression Force F0, Sequence D, and Kappa

10

converters.With Compression Force F0 = 1 and Compression Number m = 2 the

syntax for the SV Response Function converter is,

SV_Response_Function =

IF TIME <= (INT(TIME/KAPPA) + 1) * KAPPA AND

TIME > INT(TIME/KAPPA) * KAPPA THEN

Compression_Force_F0 * Compression_Number_m * SV_Weighing_Function

+ Compression_Force_F0 * (SV_Weighing_Function - End_Systolic_Volume)

* (1 - INT(TIME / KAPPA) * KAPPA * (1 / TIME - 1 /(TIME - KAPPA)

- 1/(TIME - 2 * KAPPA)))

ELSE Compression_Number_m * Compression_Force_F0 *

End_Systolic_Volume

We’ve used equation (26) in Appendix B to express the SV ResponseFunction converter in terms of the SV Weighing Function converter. Thesyntax for the CO Response Function flow and Sequence D converter are,

CO_Response_Function =

Compression_Force_F0 * (PULSE(Sequence_D, 0, KAPPA)

+ PULSE(Sequence_D, KAPPA, KAPPA) + PULSE(Sequence_D, KAPPA * 2, KAPPA))

Sequence_D = KAPPA * Sequence_C

With this syntax for the model converters and flows, the following

11

graphs are produced for the response functions Rsv(Tτ) and wsv(Tτ) andthe Aorta, Body Tissues and Heart Ventricle stock.

12

Conclusions and Future Research

The cardiac model predicts that with F0 =1 and m = 2 the aorta volumeresponse to chest compressions is much greater than the baseline aorta vol-ume response to an electric shock. This suggests that chest compressionsforce more blood into the aorta as a function of time. The total amount ofblood in body tissues seems to be unaffected by chest compressions. Theheart ventricle volume response to chest compressions is initially similar tothe response to an electric shock, but decreases as time increases.

While the weighing, response and forcing functions used in the cardiacresuscitation model were relatively simple, they nonetheless captured the lin-ear behavior of the cardiovascular system for short time scales. Our model

13

for chest compressions could be made more physically realistic by supposingthat the compressions were given with time-varying force rather than con-stant force F0. Additionally, rather than compressions being given with aconstant time interval between each compression, it might be supposed thatthe time-intervals between each compression varied in such a way that moreaccurately reflected how CPR is done in practice.

The weighing and forcing functions used were also sufficiently simplesuch that direct integration was possible and the responses Rsv(t) and Rco(t)could be expressed by explicit formulas. For more complicated CPR stimuli(which corresponds to more complicated forcing functions f(t)), the car-diovascular response would be more likely found by numerical integrationmethods. This could be achieved by replacing the convolution integral by aRiemann sum,

R(t) = w(t) ∗ f(t) =

∫ t

0

w(t− s)f(s)ds ≈n∑k=0

w(hk − s)f(kh) h, (25)

where the integral has been approximated by summing n rectangles ofheight w(hk − s)f(kh) and width h and the interval [0, t] has been dividedinto n sections of width h.

A more through study of the cardiovascular response to CPR stimulimust also take into account nonlinear effects that occur in response to suchstimuli. As Appendices A and B show, by increasing parameters F0 andm without bound, the cardiac responses Rsv(Tτ) and Rco(Tτ) also respondwithout bound. To rectify this, we can multiply the responses Rsv(Tτ) andRco(Tτ) by a function N(F0,m, τ) that preserves linear behavior for smallvalues of F0, m, τ and behaves nonlinearly for larger parameter values.

We’ve also assumed for simplicity that the cardiovascular system in thecardiac resuscitation model involves a single-chambered heart. Although thisis useful as a crude approximation, more realistic models must involve a four-chambered heart. There is also the question of how realistic the weighingfunction wsv(Tτ) is. While the model can perhaps be made more realisticby adjusting sequence Cn, there is a limit to how much realism can be addedto the model by making adjustments in this way. A model with a constantESV simplifies the analysis but may also limit applicability.

Appendix A: Derivation of the Responses Rsv(t) and Rco(t)

The derivations for equations (21b) and (22b) are given below. Here, fcc(t)denotes the chest compression forcing function. For the response of the SVto chest compressions, we have

14

Rsv(t) = wsv(t) ∗ fcc(t)

=

∫ t

0

wsv(t− s)fcc(s)ds

=

∫ t

0

[Cj(t− s− nk) + ESV ]m∑j=0

F0δε(s− jk)ds

= F0

m∑j=0

∫ t

0

[Cj(t− s− nk) + ESV ]δε(s− jk)ds

≈ F0

m∑j=0

[Cj(t− jk − nk) + ESV ] (Shifting property)

= F0

m∑j=0

Cj[t− k(j + n)] + F0mESV.

Likewise, the response of the CO to chest compressions is,

Rco(t) = wco(t) ∗ fcc(t)

=

∫ t

0

wco(t− s)fcc(s)ds

=

∫ t

0

∞∑j=0

Djδε(t− s− jk)m∑i=0

F0δε(s− ik)ds

= F0

∞∑j=0

m∑i=0

∫ t

0

Djδε(t− s− jk)δε(s− ik)ds

≈ F0

∞∑j=0

m∑i=0

Djδε(t− ik − jk) (Shifting property)

= F0

∞∑j=0

m∑i=0

Djδε(t− k[i+ j]).

Appendix B: Evaluating Rsv(Tτ) and Rco(Tτ)

We can evaluate Rco(Tτ) at the value (m+ q)κ as follows,

15

Rco(T [m+ q]κ) =D0F0

T

( ∞∑j=0

Djδε/T ([m+ q − j]κ) +∞∑j=0

Djδε/T ([m+ q − 1− j]κ)

+ · · ·∞∑j=0

Djδε/T ([q − j]κ)

)

=D0F0

T(Dm+q + Dm+q−1 + . . . Dq) =

D0F0

T

m∑i=0

Dq+i.

Remembering our assumption that D0

T= 1, the asymptotic behavior of

Rco(Tτ) can be found by letting q →∞,

limq→∞

Rco(T [m+ q]κ) = limq→∞

F0

m∑i=0

Dq+i = F0(m+ 1)LD, LD = limq→∞

Dq.

Hence, the expression for Rco(Tτ) predicts that as the parameters F0

and m increase without bound, the cardiac output likewise increases with-out bound. To evaluate Rsv(t), it will be helpful to note that, with ourassumption C0T = 1,

Cn =wsv(Tτ)− ESV

τ − nκ, nκ < τ ≤ (n+ 1)κ.

Hence,

Rsv(Tτ) = F0

m∑j=0

wsv(Tτ)− ESVτ − jκ

(τ − κ[j + n]) + F0mESV.

= F0(wsv(Tτ)− ESV )

[m+ 1−

m∑j=0

τ − jκ

]+ F0mESV.

= F0mwsv(Tτ) + F0(wsv(Tτ)− ESV )

[1−

m∑j=0

τ − jκ

]. (26)

Equation (26) expresses the response of the stroke volume Rsv(Tτ) interms of the weighing function wsv(Tτ). The asymptotic behavior of Rsv(Tτ)can be found by setting τ = nκ− ε, where ε > 0. We have,

16

limτ→∞

Rsv(Tτ) = limn→∞

Rsv(T [nκ− ε])

= limn→∞

F0mwsv(T [nκ− ε])

+ limn→∞

F0(wsv(T [nκ− ε])− ESV )

[1−

m∑j=0

(n− j)κ− ε

].

We have that, as ε→ 0,

limn→∞

wsv(T [nκ− ε]) = κLC + ESV,

limn→∞

[1−

m∑j=0

(n− j)κ− ε

]= lim

n→∞[1− (m+ 1)] = −m.

Hence,

limn→∞

Rsv(T [nκ− ε]) = F0m(κLC + ESV ) + F0(κLC)(−m)

= F0mESV.

Hence, the cardiac model predicts that the response Rsv(Tτ) can bemade arbitrarily large by increasing m and F0.

References

[1] Ritger, Paul D. and Rose, Nicholas J. Differential Equations with Ap-plications. Mineola, New York: Dover Publications, Inc. 2000.

[2] Romstedt, Karl. ”Modeling the Cardiovascular System usingSTELLA R©: A module for Computational Biology.” Handout.BIOL/CSAC 392: Computational Biology.

17