real-time cardiovascular simulation using · pdf filereal-time cardiovascular ... p_i~ / rvr,...

12
~4athematicul Modelling. Vol. 7. pp. 929-940. 1986 02-0-0255,86 $3.tY0 - .00 Printed in the U.SA. All rights reserved. Cop~,right ~ 1986 Pergamon Journals Ltd. REAL-TIME CARDIOVASCULAR SIMULATION USING TWO MICROCOMPUTERS-? NILS S. PETERSON,* THOMAS Y. KAGEHIRO AND KENNETH B. CAMPBELL Department of Veterinary and Comparative Anatomy, Pharmacology and Physiology Washington State University Pullman, WA 99164-6520, USA {Received 27 January. 1985; revised 13 May 1985) Abstract--Cardiovascular simulations have been developed for a number of different classes of applications: systems identification, benchmarks, physiologic research and teaching. The model presented in this paper is similar in structure to the PHYSBE benchmark model. Our purpose, however, is to teach medical students about the com- plex interactions of the cardiovascular system. Commonly, cardiovascular simulations have been implemented on powerful research computers using high-level languages. This paper reports on the use of a microprocessor, programmed in assembler, as the simulation engine. This more limited machine was chosen to minimize the cost of de- veloping multiple student workstations while still providing real physiologic time analog outputs. A number of different models have been developed for teaching cardiovascular physiology using mainframe, mini, micro and analog computers. Of these, only the analog simulations and the present work are capable of real-physiologic time compu- tation and pulsatile display. The digital computer system presented here achieves this result with a more flexible student interface. INTRODUCTION Computer models of the cardiovascular system have been used for several purposes. Most obvious are attempts to better explain and predict cardiovascular behavior{l]. Cardio- vascular models have also been used as exemplar systems for applying identification techniques{2], for demonstrating hybrid computer applications{3], for comparing the rela- tive merits of digital and analog computational systems{4] and as a benchmark for digital computers running general simulation languages{5, 6]. The cardiovascular system has been chosen for each of these types of study because it is exemplarly complex. It consists of multiple components, the components interact in complex ways and the system exhibits hierarchical organization and multiple time scales. The very features that recommend the cardiovascular system as a subject for simulation studies make it difficult to teach to medical students. A model suggests itself as a means of teaching the complex aspects of cardiovascular physiology, because it can closely emulate the behavior of the actual system, and it possesses all the relevant features of the system's complexity. A number of workers have recognized these attributes of cardiovascular models and have implemented teaching models on computers{7-9]. The computational burden arising from the multiple time-scale behavior has imposed practical limitations on the complexity that may be simulated on the small digital computers commonly used for teaching pur- poses, Teaching models that include both pulsatile and longer time-scale behavior have t Computer diskette available. * Author to whom correspondence should be addressed. 929

Upload: hoangliem

Post on 08-Mar-2018

217 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

~4athematicul Modelling. Vol. 7. pp. 929-940. 1986 02-0-0255,86 $3.tY0 - .00 Printed in the U.SA. All rights reserved. Cop~,right ~ 1986 Pergamon Journals Ltd.

REAL-TIME CARDIOVASCULAR SIMULATION USING TWO MICROCOMPUTERS-?

NILS S. PETERSON,* THOMAS Y. KAGEHIRO AND KENNETH B. CAMPBELL

Department of Veterinary and Comparative Anatomy, Pharmacology and Physiology Washington State University

Pullman, WA 99164-6520, USA

{Received 27 January. 1985; revised 13 May 1985)

Abstract--Cardiovascular simulations have been developed for a number of different classes of applications: systems identification, benchmarks, physiologic research and teaching. The model presented in this paper is similar in structure to the PHYSBE benchmark model. Our purpose, however, is to teach medical students about the com- plex interactions of the cardiovascular system. Commonly, cardiovascular simulations have been implemented on powerful research computers using high-level languages. This paper reports on the use of a microprocessor, programmed in assembler, as the simulation engine. This more limited machine was chosen to minimize the cost of de- veloping multiple student workstations while still providing real physiologic time analog outputs. A number of different models have been developed for teaching cardiovascular physiology using mainframe, mini, micro and analog computers. Of these, only the analog simulations and the present work are capable of real-physiologic time compu- tation and pulsatile display. The digital computer system presented here achieves this result with a more flexible student interface.

I N T R O D U C T I O N

Computer models of the cardiovascular system have been used for several purposes. Most obvious are at tempts to bet ter explain and predict cardiovascular behavior{l]. Cardio- vascular models have also been used as exemplar systems for applying identification techniques{2], for demonstrat ing hybrid computer applications{3], for comparing the rela- tive merits of digital and analog computational systems{4] and as a benchmark for digital computers running general simulation languages{5, 6].

The cardiovascular system has been chosen for each of these types of study because it is exemplarly complex. It consists of multiple components , the components interact in complex ways and the system exhibits hierarchical organization and multiple time scales. The very features that recommend the cardiovascular system as a subject for simulation studies make it difficult to teach to medical students. A model suggests itself as a means of teaching the complex aspects of cardiovascular physiology, because it can closely emulate the behavior of the actual system, and it possesses all the relevant features of the sys tem's complexity.

A number of workers have recognized these attributes of cardiovascular models and have implemented teaching models on computers{7-9]. The computational burden arising from the multiple time-scale behavior has imposed practical limitations on the complexi ty that may be simulated on the small digital computers commonly used for teaching pur- poses, Teaching models that include both pulsatile and longer time-scale behavior have

t Computer diskette available. * Author to whom correspondence should be addressed.

929

Page 2: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

930 NILS S. PETERSOY et al.

been restricted to minicomputers[10] or analog computers[l i]. Of these, only the analog" computer could compute and display the results in real physiologic time.

The analog computer and multi-user minicomputer are limited by having rather complex and uninteresting interfaces for student control. Typically students require continuous assistance when operating simulations implemented on these vehicles. Also, their cum- bersome operating environments and limited interface controls cause them to be inflex- ible. Finally, models implemented on minicomputers or special analog devices are very expensive.

We have attempted to overcome the limitations of the previous approaches to real- time simulations of pulsatile cardiovascular events by using a dual microprocessor com- puting system. The processors are assigned distinct tasks: model solution and user in- terface. A single-board industrial control computer is assigned the task of numerical in- tegration and analog display. It operates as a slave to the other computer, a standard personal computer. The personal computer is assigned the task of user interface, including graphic input controls, graphic display of time-averaged data and communication of user commands to the slave computer. The resulting system executes a pulsatile model in real physiologic time, has a simple and appealing user interface, is flexible, relatively inex- pensive and extends the utility of the equipment already owned.

Model description

The model that was used is a slight elaboration of a rather standard form used by several others[3, I0]. It is composed of two active elements representing the two major

R RV R PA R PC

P1 " P2 - A v P_3

, C_PA

Eo R~bt T

R BV

R VR P9

~ C_VR

R PV R LV R SA - P_4 - P 5

Val~ve Valve , , Z _ ~ C_SA

P 6

I 7-

R MV - - R HA P_7

j 4 ~ C N

R SKV - - R SKA

P8

T C.SL

R BA

C8

Fig. I. Electrical analog of hydraul ics of card iovascular sys tem model. Three parallel circuits compose the sys temic circulation. The s t ructure of this model is similar to the PHYSBE benchmark . Te rms are defined in the text.

Page 3: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

Real-time cardiovascular simulation

F l o w E q u a t i o n s

Q 1_to_2 = m a x [ (P_ I - P 2) / (R_RV ÷R PA) , 0 ] - - pulmonary valve

Q 2_to_3 = (P_2 - P_3) / R_PC

I ( P _ 3 - P_4) / R_PV, 0] - - mitral valve L

r(P_4 - P ~) / (R Lv • R SA~, 01 - - aortic L - - - J valve - P 6 ) / R BA

Q 3 t o 4 = max

Q_4_to 5 = max

Q 5 t o 6 = ( P 5

Q 5 to 7 =(P_5 - P 7) / R MA

Q 5 t o 8 =(P 5 - P_8) / R SKA

Q_6 to_9 =(P_6 - P_9) / R BV

Q 7 t o 9 = ( P 7 - P 9) / R MV

Q 8 to_9 =(P 8 - P 9) / R SKV

Q _ 9 _ t o j max [(P_9 - P_I~ / R V R , 0] - - tr icuspid valve

Derivative Equations

dP 1 =(Q 9 to 1 - Q 1 to 2) , E RV + P 1 • dE_RV / E RV

dP 2 = (Q 1 t o 2 - Q 2 to 3) • E PA

dP_3 ,, (Q 2..to_3 - Q 3..to_4) • E_PV

d P 4 = ( Q 3 t o 4 - Q _ 4 t o 5 ) ° E L M ÷ P 4 . d E L V / E LV

d P 5 = ( Q 4 t o 5 - Q 5 t o 6 - Q 5 t o 7 - Q S t o 8 ) * E SA

a lP6 = (Q_Sto_6 - Q_6_to_9) • E_M

dP_7 =(Q_5_to 7 - Q_7_to 9) * E_B

dP 8 =(Q 5 t o 8 - Q 8_to 9) ° E SK

931

dP 9 =(Q_6_to_9 ÷Q_7 to_9 ÷Q_8 to_9 - Q 9 to 1) *E_R

Fig. 2. Equations for the model represented in Fig. 1. The elastances of the heart shown in Fig. 1 are divided into two components: an active element, E(t), and a passive element, Eo. This is useful for physiologic understanding as these components represent the systolic and diastolic heart properties, respectively. For com- putational purposes this detail can be dropped by adding the two elastances to yield a left ventricular elastance E__LV and right ventricular elastance E__RV. (Abbreviations are explained in Table 2.)

pumping organs, the left and right ventricles. These are illustrated as time-varying elast- ances in Fig. 1112]. The model also contains two passive circuits, the pulmonary and systemic circulations. Each receives blood from one pump and delivers it to the other. One-way valves keep the blood flowing in one direction. The systemic circulation is divided into blood flow to three regions of the body. The electrical analog of the model is shown in Fig. 1, and the differential equations describing the system in state-variable form are shown in Fig. 2. The state variables were taken as voltages across the capacitors (pressure). Where possible, equations requiring division were rewritten as a multiplication by the reciprocal to avoid the slower division process.

Two features of the model that are unique in our implementation are the resistances internal to each ventricle[13] and the variation in heart rate. Figure 3 illustrates the method used to vary heart rate. Changes are brought about by changing the number of integration steps in the cardiac cycle as well as changing the time period of each step. This reproduces

Page 4: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

932 NZLS S. PETERSON et al.

100 / / Stepsize _ 60

¢~" 8090 ~ (sec) - "H~" N

20 4'0 60 8'o 1 .0 Heart Rate (HR)

B/rain

Systole ~I~ Diastole - I a •

,,,/ \ °Jr/ ,,

1'0 2'0 3'0 4'0 5'0 60 70 Point Number (n)

Fig. 3. The procedure for varying heart rate involves two changes: integration stepsize and number of steps per cycle. The lower heart rate (a) has more points (lefthand graph). This causes an extension of the diastolic portion of E(t) through addition of more zero valued points (righthand graph).

the observation that the diastolic (filling) period is preferentially shortened by increases in heart rate.

Parameters for the model for Table 1 come from two sources. The time course of the change in capacitance of the pumping elements is taken from experiments in our own research laboratory on dogs; these parameters were then scaled to apply to humans. The circulatory parameters were taken from published reports in the scientific literature. This collection of results from several workers required tuning before it would predict behavior in an "average" individual. The tuned system was required to simultaneously predict accepted values of cardiac output, stroke volume, filling volume, stop-flow pressure and pulsatile pressures inside, behind and in front of each heart[14]. The model represents the human cardiovascular system. All model parameters are accessible to modification within the slave computer. Different host computer-student interfaces may be designed to focus attention on various topics and therefore limit student access to parameters as desired.

Design objectives

Any system as complex as the model presented will require a powerful, yet clear interface if it is to be widely used by students. We have found that the appropriate interface converts an interesting--but inaccessible--research model into a compelling teaching vehicle. It is, therefore, important to allocate sufficient computing resources to this task, and in our simulation, equal amounts of computing power have been devoted to interface and model solution.

Graphic control of the simulation was considered crucial[15, 16], for it makes the system both more engaging and simpler to operate. Our approach uses the metaphor of the lab- oratory, where controllable mode[ parameters are represented graphically as laboratory devices. Only seven keys are used, to minimize student input errors.

The design of the interface separates input controls to the simulator from the data representing its responses. Data are displayed in both analog format on either stripchart or x-y recorders and in time-averaged format on the host computer's CRT display. Several

Page 5: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

Real-time cardiovascular simulation 933

Table 1. Parameter values

Resistors

R__RV 100.0 dyn sec cm -5 R__PA 50.0 dyn sec cm -~ R__PC 50.0 dyn sec cm -5 R___PV 5.33 dyn sec cm -5 R___LV 100.0 dyn sec cm -~ R__SA 80.25 dyn sec cm --~ R__BA 1293.3 dyn sec cm -5 R.__BV 127.47 dyn sec cm -~ R___MA 7260.2 dyn sec cm -5 R___MV 677.3 dyn sec cm -5 R___SKA 17104.2 dyn sec cm -5 L S K V 1690.9 dyn sec cm -5 L V R 6.0 dyn sec cm --~

Capacitors

C__PA 2.0E-3 dyn-~ sec cm -~ C__PV 0.012 dyn -~ sec cm -5 C__SA 1.2E-3 dyn i seccm 5 C__B 0.054 dyn- t sec cm-5 C__M 0.0103 dyn- i sec cm --~ C__SK 4.1E-3 dyn -~ sec cm -5 C__VR 0.955 dyn- t sec cm -5

Elastances

E(t) (right max) 435.44 d.vn cm -~ Eo (rightl 22. I dyn cm --~ E(t) (left max) 1404.65 dyn cm -5 Eo (left) 30.77 dyn cm -5

E__RV = E(t)right -:- Eo right E__LV = E(t)left -:- Eo left

t y p e s o f d ig i ta l g r a p h i c s d i s p l a y s m i g h t be p o s s i b l e w i t h th i s o n e m o d e l , e a c h f o c u s i n g on

d i f f e r e n t c o n c e p t s a b o u t t h e c a r d i o v a s c u l a r s y s t e m . D e s i g n o f s p e c i a l i z e d d i s p l a y s p e r m i t s

f o c u s i n g o f s t u d e n t a t t e n t i o n o n s p e c i f i c l e a r n i n g g o a l s , w i t h o u t o t h e r d a t a b e c o m i n g

d i s t r a c t i n g . B i t - m a p p e d g r a p h i c s , c o m m o n l y f o u n d o n p e r s o n a l c o m p u t e r s a n d u n c o m -

m o n l y o n m i n i c o m p u t e r s , w e r e d e e m e d e s s e n t i a l to o u r g r a p h i c a n d a n i m a t i o n g o a l s .

Table 2. Abbreviations

R.._rx Resistance C__~x Compliance E__rx Elastance (Stiffness) where xx is

RV Right ventricle PA Pulmonary artery PV Pulmonary veins LV Left ventricle SA Systemic artery MA Muscle artery MV Muscle vein BA Body artery BV Body vein SKA Skin artery SKV Skin vein VR Great veins

Page 6: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

934 NILS S. PETERSON et al .

IMPLEMENTATION

Computer hardware

The single-board computer system consists of an Intel iSBC 86/05, with iSBX 328 digital-analog converter and 8087 numeric coprocessor. The single-board computer also contains interval timers, serial interface, random access memory (RAM) and sockets for read-only memory (EPROM). This device was chosen as the most economical approach to achieving a numeric throughput of 50,000 floating point operations per second (FLOPS) with 80-bit precision and eight-channel analog output. Code for this computer was de- veloped in assembler using an Intel development station.

The user interface is provided by an IBM PC/XT computer with 8087, color graphics and serial communication support. Code on the IBM computer was developed in a mixture of UCSD Pascal and assembler. Communication between the two machines is on standard RS-232 asynchronous serial line. A software protocol, with error detection, is used to synchronize communications to bursts which occur at the end of each heart beat.

Numerical solutions

Three constraints governed the selection of the numerical solution technique: maximal allowable time step between reports of analog results, maximum computational workload (50,000 FLOPS) and global solution accuracy. The digital analog converter outputs a constant voltage until a new value is loaded. To minimize staircased analog traces, we were constrained to update the D-A converter every 10 msec or less. Solution accuracy was an important consideration, both to minimize local errors which would lead to inexact responses and to prevent drift of the system from its basal state during extended operation. Blood volume is an essential input to the model, and we observed that even solutions with seemingly small global errors tended to drift--losing blood--from their normal op- eration state. Computational throughput of the 8087 numeric coprocessor limited the nu- meric solution options available if real-time performance was to be achieved. The Runge- Kutta second-order method with a nominal 10-msec stepsize was ultimately selected.

To select the solver, numerical experiments were conducted on a mainframe computer and compared against a nominally ideal solution. This standard was created with the IMSL stiff equation solver, DGEAR, in double precision. DGEAR is a variable stepsize, variable order method based on Gear's stiff equation solver[17]. It was permitted to use its internal algorithms to identify the best solution technique and was required to report interpolated results at fixed intervals. We initially determined that variable stepsize routines would require more overhead per step than we could afford; therefore, we only tested Euler first-order, Runge-Kutta second-, third- and fourth-order, and Fehlberg fifth-order rou- tines. Stepsizes between 5 and I0 msec were tried with each method. A sum of squares error was calculated comparing each method to the DGEAR standard.

Computational workload can be calculated for each method by counting the number of floating point operations required for each derivative evaluation, multiplied by the evaluations required per step and adding the overhead required to advance the state one time-step. The Runge-Kutta second-order method, for example, requires two derivative evaluations and then an equally weighted polynominal advance from the current state to the new one. This totals 157 floating point calculations per time-step.

The methods were compared through the ratio of global error to computational work- load required during one second of real-time solution. Comparisons were made over a range of the integration stepsize parameter, as the heart rate changes would alter the required stepsize. If two methods had equal workloads, the superior algorithm was con-

Page 7: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

Real-time cardiovascular simulation 935

sidered to be the one with the smallest error. In practice, the extremes were easily elim- inated, but the second- and third-order methods were difficult to distinguish.

Commtmications with the simulator

Any personal computer which is capable of RS-232 serial communications at 4800 bits per second (baud) may be used as a host. This approach permits a relatively inexpensive computer to be used as a host to a very powerful simulation system. Our development environment is atypical in that it uses an IBM PC/XT computer .

The communicat ions protocol relies on the host computer signaling its readiness through the Request to Send (RTS) signal, an auxiliary line in the RS-232 protocol. When this has been done, the slave simulator begins to execute the cardiovascular model. At the end of each beat the simulator transmits a packet that describes the beat-mean data for the previous beat. Subsequent to the receipt of the simulator 's transmission, the host may transmit a packet of control information. This information may take several forms, each designed to allow a particular type of access to the model. This simple handshaking of data permits the host computer to exert a wide variety of controls over the simulator. altering the analog data displayed and model parameters.

The exchange of data is performed synchronously, initiated at the end of each beat by the slave and mediated by the host through the RTS control signal. This method is very simple to implement on most microcomputers . However , its limited error checking and recovery can lead to a loss of communicat ions. Subsequent to implementing this design, we began using the host to perform calculations on the data before commands were re- turned by the slave. This increased the risk of communications failure.

Systent outputs

Figure 4 illustrates the control of the analog and mean data that will be displayed. It depicts three types of measurement: pressure, flow and volume. These are clustered into three channels of data: two are analog and will be present on BNC connectors 1 and 2 of the hardware simulator. The third channel of data is beat-mean data and will be displayed on the host microcomputer . In our current interface this mean data is presented on a simulated stripchart, but it could also be used to drive a histogram or numeric display.

To select a type of data for display the student uses two function keys. One key controls the position of a star pointer. This pointer indicates which item is currently considered active by the computer . Initially, the star points to the column of BNC connectors and the mean data stripchart. These are arranged vertically at the tar right of Fig, 4. We have given seven function keys special names, indicated in the text by asterisk delimiters. Pressing *Star* systematically moves a star-shaped cursor among these three data display options. To select one, the student uses *Yes*.

A new star pointer will appear in the bank of transducers selected. Now the *Star* will move only among this set of pressure, flow and volume transducers, the left coluumn in Fig. 4. Again pressing *Yes* selects a type of t ransducer and causes a catheter to be drawn from the t ransducer to a point in the drawing of the circulatory system. A new star also appears at the tip of the catheter . Now, as *Star* is pressed, the star jumps around the drawing of the circulatory system, landing at places where the type of data appropriate to the t ransducer may be measured. Finally, when the desired site is reached, pressing *Yes* causes the host computer to update the type of data displayed on the channel selected. If the data is to be analog, this requires the host to transmit a command to the slave to alter its data display operations. This interface was designed to resemble laboratory catheterization.

Page 8: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

936 YILS S. PETERSON et al.

*"' 4"" 8 N - .

' . . . .

P l t ' ~ e S .

i F l o e

~i q o I ,

i F l o w

~i~ I , t o 1 .

P ~ e s .

F l o w

U o l .

Chan

.,," ,.. (.1,.._:)

C h a n / --%

.) ___~'

Me an

l i n t

t

2

Fig. 4. Screen for control of data to be displayed. Channels 1 and 2 are analog and will be on BNC connectors I and 2 of the hardware simulator. A mean data stripchart will be displayed by the host PC. Channel 1 is connected to right ventricular pressure. Channel 2 connects to pulmonary artery pressure. Channel 3 shows mean flow through pulmonary capillaries: this is total cardiac output.

Stripcharts and pressure-volume loops

By placing analog pressure t ransducers in the left heart and the systemic arteries, and connect ing an analog paper str ipchart recorder , it is possible to record real-t ime pressure events ; see Figs. 5 and 6. These events will show transients wheneve r the pa ramete r control section of the user interface is manipulated to change the model parameters . These displays closely cor respond both quanti tat ively and qualitatively to measured data.

The use of the x and y inputs on an oscill iscope or an x-y pen recorder permit the display of one data trace plotted against another. One such display is the ins tantaneous left ventr icular pressure vs volume loop. The p r e s s u r e - v o l u m e loop is clinically important , because it gives a very concise display of all the events in the cardiac cycle. This phase plot is similar to the Carnot cycle of a heat engine. It is created by placing one analog volume ca the ter and one analog pressure ca theter in the left heart . The outputs are sent to the two axes of the display device, producing a tracing similar to Fig. 7.

Model supplementation by active host intervention

While the topology of the model is fixed by the code stored in the read-only m e m o r y (EPROM) of the slave computer , it is still possible to provide some extra behaviors not coded into the original model. When planning the original model for the simulator, we wished to include only those features in which we were confident. During later s imulator testing, we found some nonlinear behaviors , not present in the original model , that are important in some disease states. These have been incorporated through a feedback con- trol implemented within the host computer .

Page 9: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

Real-time cardiovascular simulation 937

Fig. 5. Analog results from simulator. At (A) the left heart strength was reduced 50%. It was restored at (B~. Top to bottom, traces show pulmonary artery pressure (Ppa); pulmonary venous pressure, as measured clinicall? by pulmonary capillary wedge (Ppcwl: left ventricular pressure (Ply); and systemic artery pressure (Psa). Data scaling is arbitrary and varies between channels.

The basic model provides for a linear passive compliance during the diastolic or filling phase of the cardiac cycle. This is indicated by elastance Eo of each ventricle in Fig. 1. The pressure-volume loop, Fig. 6, shows a linear approximation for the filling compliance in a normal heart. Often when the heart is weakened or diseased, it operates at a much higher filling volume. At this volume a marked nonlinearity is present. It is possible to approximate this simple exponential behavior through a host-mediated feedback. The nonlinear p ressure -vo lume relation is represented in the host as

P = a * e x p ( b * V),

which is rearranged to an elastance ( P / V ) by differentiation

d P / d V = a * b * exp(b * V),

Page 10: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

938

mm& 540 * 00

520.00

500.00

60.00

20.00

f

f 40.00

20.00

NILS S. PETERSON er al.

0.00 .SO 5.00

Seconds 1.20 2.00 2.20

Fig. 6. Analog results redigitized by laboratory data acquisition system. From top to bottom: system artery Pressure (Psa). left ventricular pressure (Plv) and pulmonary capillary wedge pressure (Ppcw).

where P is the desired end diastolic pressure in the ventricfe, 5’ is the end diastolic volume and a and b are constants, The slave returns to the host the V value at the end of each beat. The vafue of the passive linear capacitor in the siave may be reset by the host, using the equation

EO = LI * b * exp(b * V).

This new value changes the slope of the linear diastolic pressure-volume relationship for the subsequent beat. The calculation must be done once for each ventricular chamber. The net result, with updates taking place each beat, is a piecewise linear approximation to the exponential end diastolic pressure-volume relationship. This curvature may be seen in the lower right corner of the loops in Fig. 7.

We also added a reflex action in the same manner. In the normal animal the baroreflex control of heart rate functions by sensing the pressure in the arteries and using this to vary heart rhythm. We simulated this neural reflex with the host computer. Each beat the slave computer returns the mean arterial pressure for the previous beat. The host calculates a weighted mean of the previous five beats. The weighting places greatest emphasis on the most recent beat. A new heart rate is calculated from

Psa meant = 0.429 * PsaK + 0.260 + PsaK_, + 0.158 * PsaK_?

+ 0.095 * PsaK_3 + 0.058 * PsaKw3,

Page 11: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

Real-time cardiovascular simulation 939

mmHg t B O . O 0

t e O . O 0

i 4 0 . 0 0

i 2 0 . 0 0

i O 0 . O 0

8 0 . 0 0

6 0 . 0 0

4 0 . O 0

; ~ 0 . O 0

0 . 0 0

0

f - 1

i I

k i

t

1 i L F

I J

I__ t

"x

k , . . . . . . _ _ _ _ _ _ .

L u

\ \

( I I f

"x~_. \

\

i 1 f i I J

q - . , ,

• O 0 " ~ 0 . O 0 1 0 0 . 0 1 ~ 0 . 0 2 0 0 . 0

Volume ml

Fig. 7. Analog left ventricular pressure vs volume results redigitized by data acquisition system. Three levels of blood volume are shown: normal (solid line), 82% of normal (broken line) and 139% of normal (dash dot line). Lower right-hand corner of loops lie on exponential curve created by host modification of diastolic pressure- volume relationship (see text).

Hear t_ ._Per iod ( sec /bea t ) =

1.0

3.0 - 2.333 * 1.0

1.0 + exp[0 .05 * (P . . . . - PSame~.K)]

Heart___rate (bea t s / ra in ) = 6 0 / H e a r t _ _ P e r i o d ,

w h e r e Psa . . . . K is the c u r r e n t w e i g h t e d m e a n p r e s s u r e in the a r t e r i e s . PsaK is the m e a n j u s t r e p o r t e d by the s i m u l a t o r and PsaK_ ; a re the p r e v i o u s i bea t s . P,orm is a nomina l p r e s s u r e , u sed as a r e f e r e n c e . The resul t is t r a n s m i t t e d to the s i m u l a t o r on the nex t i n t e r c h a n g e o f da ta , c l o s ing the f e e d b a c k loop. Th rough this m e c h a n i s m the hos t a t t e m p t s to i nc rea se hea r t ra te to c o m p e n s a t e for fal l ing a r te r ia l p r e s s u r e s , and to r e d u c e ra te in o r d e r to l o w e r e l e v a t e d p r e s s u r e s . Aga in , this d e m o n s t r a t e s a p o s t - c o d i n g a l t e r a t i on o f the s l ave c o m p u t e r to c a p t u r e an a d d e d a s p e c t o f r e a l - s y s t e m .

C O N C L U S I O N

W e have d e m o n s t r a t e d the po ten t i a l o f us ing i n e x p e n s i v e p e r s o n a l c o m p u t e r s in con- j u n c t i o n with spec ia l p u r p o s e s imu la t i on h a r d w a r e to c r e a t e r ea l - t ime s imu la t ions o f corn-

Page 12: REAL-TIME CARDIOVASCULAR SIMULATION USING · PDF fileREAL-TIME CARDIOVASCULAR ... P_I~ / RVR, 0] -- tricuspid ... change in capacitance of the pumping elements is taken from experiments

940 NILS S. PETERSOY et al.

plex cardiovascular events. A similar approach could be used to model complex processes- in other systems.

The use of a host computer with graphics permits the construction of multiple user interfaces for a single simulation engine. One might imagine an interface for pharmaco- kinetics and a separate one for basic physiology experiments. Only those aspects of the physiologic model that are important to the problem need be presented on the interface screen. Other details, while present in the model, are hidden to enhance the clarity of the interface. Additionally, these interfaces may have imbedded within them other types of controls which are not present in the slave computer model, for example, reflex actions. This is a far superior way of generating student interfaces than can be achieved with a single, fixed analog control panel.

The hardware simulator approach we have presented may be further generalized by modifying the slave simulator to permit it to load code for a specific model from the host. Such a system could use the same basic hardware to present many different simulations, thus greatly extending the utility of the special-purpose hardware.

Acknowledgement--This work was partially' supported by Public Health Service Grant No. 21462.

REFERENCES

1. T. G. Coleman, Simulation of biological systems: The circulation of blood. Simulation Today 28, 201-204 (1977).

2. G. A. Bekey. and J. E. W. Beneken. Identification of biological systems: a survey. Automatica 14, 41-47 (1978).

3. J. McLeod, PHYSBE--a physiological simulation benchmark experiment. Simulation 7, 324-329 (1966). 4. J. McLeod. PHYSBE--a year later. Simulation I0 .37-45 (1968). 5. E. E. L. Mitchell, PHYSBE in the Raytheon scientific simulation Language (RSSL). Simulation 22, 81-86

(1974). 6. G, A. Korn. J. McLeod and J. Wait. DARE/PHYSBE. Simulation 15, 229-231 11970). 7. C. J. Dickinson, C. E. Goldsmith and D. L. Sackett. MACMAN: A digital computer model for teaching

some basic principles of hemodynamics. J. Clin. Comput. 2, 42-50 (1973). 8. J. E. Randall, and T. G. Coleman. Microcomputer implementation of a comprehensive physiological model.

In Modeling and Simulation of Microcomputers (Edited by L. A. Leventhal), pp. 26-30. Society for Com- puter Simulation, La Jolla, California (1981).

9. J. Lefevre and J. Baretto. Didactic microcomputer simulation in cardiac dynamics. IEEE Frontiers Eng. Comput. Health Care 195-198 (1983).

10. K. B. Campbell, M. Zeglen, T. Kagehiro and H. Rigas. A pulsatile cardiovascular computer model for teaching heart-blood vessel interaction. The Physiologist 25, 155-162 (1982).

11. R. Beeukwes and N. Braslow, The cardiovascular analog trainer: a real-time physiological simulator. Physiol. Teacher 3, 4-7 (1974).

12. H. Suga and K. Sagawa, Models of cardiac contraction. Simulation 27, 181 (1976). 13. K. B. Campbell, J. A. Ringo, Y. Wakao, P. A. Klavano and J. E. Alexander, Internal capacitance and

resistance allow prediction of fight ventricular outflow. Am. J. Physiol. 243 H99-HII2 (1982). 14. N. S. Peterson and K. B. Campbell. Teaching Cardiovascular Integration with Computer Laboratories. The

Physiologist, 28, 159-169. 15. N. Peterson, Designing a simulated laboratory. BYTE June, 287-296 (1984). 16. N. S. Peterson and K. B. Campbell. Simulated laboratory for teaching cardiac mechanics. The Physiologist

27, 165-169 (1984). 17. C. W. Gear, Numerical Initial Value Problems in Ordinary Differential Equations. Prentice-Hall. Englewood

Cliffs, NJ (1971).