Cardiac Dynamics Due: 12/4 at 11:59 PM 1 Mathematical and Biological Background Cardiac Arrythmia is a name for a large family of cardiac behavior that show abnormalilites in the electrical behavior of the heart. For instance, too fast or too slow heart beats can cause irregular activity and even death. Some arrythmias can exhibit little danger (such as heart palpitations) and some can result in sudden death (such as stroke or embolism). From a biological perspective, cardiac cells contract when the voltage across the cell membrane depolarizes the cell and stay contracted until repolarization. This change in voltage is created by the flux of several electrically charged ions passing through the membrane, such as sodium, calcium, potassium, etc. The flux of such ions through the membrane is controlled by several gates that open and close dynamically. d Figure 1: A typical action potential. Cardiac dynamics are typically modelled with a set of nonlinear ordinary differential equations (ODEs). These systems can get very large, and each equation can be very complicated. However, to capture certain behavior, one often works with very simple models. In our case, we ll be using a 2-variable model to study the behavior of the flux of voltage. In general, the functions involved in cardiac models (even 2-variable models) are very complicated and cannot be solved analytically. Therefore, the use of numerical solvers like ode45 in MATLAB are incredibly useful. 2 Problem Statement 2.1 The Model: The model we ll consider has a voltage variable v and a gating variable h: = kv(v a)(v 1) vh + stimulus, ( dh = ɛ 0 + µ ) 1h ( h kv(v a 1)), (1) v + µ 2 where k, a, ɛ 0, µ 1, and µ 2 are constant parameters. The stimulus parameter is discussed in the following section. We will investigate the case where k = 8, a = 0.15, ɛ 0 = 0.002, µ 1 = 0.2, and µ 2 = 0.3. (R. Aliev 1
and A. Panfilov. A simple two-variable model of cardiac excitation. Chaos, Solitons, and Fractals, 7(3), 293-301 (1996).) In this model v represents the voltage across the cell membrane and h represents a gating variable. h can be thought of as a physical gate blocking or allowing current to pass: h = 0 means that the gate is open and voltage can pass freely if the cell is stimulated; h = 1 means the gate is closed and no voltage can pass. 2.2 Periodic Stimulation Cardiac cells need to be stimulated in order to function properly, and for a steady heart beat this stimulation must come periodically. This period is a parameter we will define as T. Thus, if we want one stimulation every 100 units of our time variable t, we set T = 100. Thus, in order to simulate realistic cardiac behavior, we must incorporate the stimulation period T. In the templates provided the following code does this: if (mod (t,t) >= 10.0) && (mod (t,t) <= 13.0) stim = 0.25; else stim = 0.0; end This will give enough of a push every T units of time to stimulate the cell. 2.3 Action Potential Duration One quantity of great interest and importance is the Action Potential Duration (APD). Formally, the APD is the duration from the time a cell is stimulated (and depolarizes) to the time it repolarizes. Heuristically, this measures the time duration that a heart cell is contracted. In our case we choose v c = 0.1 to be the critical voltage at which we measure the beginning and end of an Action Potential. Mathematically, we calculate an APD as follows: APD beat = t down t up, (2) where t up is the time at which the voltage v passes v c on the way up and t down is the next time at which the voltage v passes v c on the way down. Figure 2: One action potential duration (APD). 2
3 Problem Exercises Two template.m-files are provided to help you with the programming portion of the lab. In order to run simulations, all you need to do is write the correct ODEs in the system template.m file and insert the correct parameters in the script template.m. Then, executing the script template.m file will run the simulation. However, it is up to you to figure out how to plot the data and do any further computations needed to complete the project. 3.1 Analytical Work 1. (For exercises 1-3 consider the system defined by the set of equations (1) with stimulus = 0 and the parameters above.) Show that (v, h) = (0, 0) is a fixed point of the system. Biologically this point corresponds to a resting state in which the cell is polarized and not contracted. Give a biological explanation as to why this point needs to be a stable fixed point rather than a unstable fixed point. 2. Near the fixed point (0, 0), we can approximate the behavior of the nonlinear system via the linear system of differential equations ( ) v = J(0, 0), dh h where J(v, h), the Jacobian, for a system of differential equations is a matrix given by = f(v, h), dh = g(v, h), f v J(v, h) = g g. (3) v h Use this approximation to the nonlinear system to determine the stability of the fixed point (0, 0). 3. Plot the nullclines of the system, putting v on the horizontal axis and h on the vertical axis. Include the direction of movement in each seperate region (i.e. is the flow north-west, north-east, south-west, or south-east). These arrows can be added by hand after plotting the nullclines, just make sure that your figure is neat. 4. Now suppose, from (v, h) = (0, 0), we add a large enough (positive) stimulus to the voltage (as in the stimulus code above). In what direction will the trajectory move initially? Just looking at the nullclines, what is the maximum value v will attain? 5. Again, plot the nullclines of the system as you did in exercise 3. This time, roughly draw in the trajectory starting at (v, h) = (0, 0) given a stimulus like the one described above. Is the flow clockwise or counter-clockwise? If no more stimuli are given, where will the particle end up as t? 3.2 Numerical Simulations 1. Using ode45 in MATLAB, simulate this system starting from an initial condition (v 0, h 0 ) = (0, 0) for t from 0 to 500 with a timestep of 0.2 and a stimulation period T = 100 (the timestep is already included in the provided template). For information regarding ode45, refer to the APPM 2460 webpage. Plot and label both v and h versus t in the same figure (for help on this, see Appendix B). Also, plot and label h versus v (v on the horizontal axis, h on the vertical). How does this last plot compare to the nullclines of the system? f h 3
2. Again, simulate the system from the same inital conditions, same timestep, and same stimulation period, but now for t from 0 to 1000. Calculate the APD of the last full beat using the calculation discussed in section 2.3. This APD corresponds to the steady-state APD. What is the steady-state APD for T = 100? (Do not plot anything.) 3. Repeat what you did in the previous problem for T = 90, 80, 70, 60, and 50. That is, find the steadystate APD for each different stimulation period T. For these values of T (including T = 100 as well), plot and label the steady-state APD versus stimulation period T. 4. Does the steady-state APD increase or decrease with T? What does this mean from a biological viewpoint? That is, heuristically, what is happening in the heart cell as it is stimulated more frequently? One important feature of cardiac tissue is that the APD must be a certain length in order for the organism to survive, especially for large animals like humans. Why is this important? 5. Again, simulate the system from the same inital conditions, same timestep, T = 100, and t from 0 to 1000. Calculate the minimum value of h between the last two beats (call this variable h). This is a local minima in the h versus t plot and is essentially a measure of how much the heart cell has been allowed to relax before the next stimulation (smaller h more relaxed). This last h corresponds to the steady-state h. What is the steady-state h for T = 100? (Do not plot anything.) 6. Repeat what you did in (5) the previous problem for T = 90, 80, 70, 60, and 50. That is, find the steady-state h for each different stimulation period T. For these values of T (including T = 100 as well), plot and label the steady-state h versus stimulation period T. Does the steady-state h increase or decrease with T? 7. Finally, plot and label steady-state APD versus steady-state h. Does steady-state APD increase or decrease with steady-state h? Use this information to describe the role of the two variables and how they interact with each other. 4 Lab Report Your report needs to accurately and consistently describe the steps you took in checking the solutions of the partial differential equations and initial conditions. It should also contain the appropriate plots and in-depth explanation of the behavior of the solutions. This report should have the look and feel of a technical paper, NOT a worksheet with an introduction and conclusion attached! An outline is included below. 1. Your report should begin with an introduction. This should briefly describe what you plan to say in the body of your report. You should also provide a brief list of the mathematical concepts that you will use to make your arguments and perform your calculations. 2. The details of your work should be described in the body of your report. This should include at least everything listed in the Problem Exercises section. 3. Finally, you should summarize what you have accomplished in a conclusion. No new information or new results should appear in your conclusion. You should only review the highlights of what you wrote about in the body of your paper. Briefly, what were you investigating? What were the overall results? Do you have any suggestions to better analyze/describe the same problem which were not addressed in your current work? 4. Finally, you should include an appendix that contains any equations, code, etc. that does not flow well in the body. Remember, you can and probably should include figures in the body as long as it doesn t break up the flow. Remember: DO NOT NUMBER YOUR REPORT LIKE A HOMEWORK ASSIGNMENT. It should flow like a real-world report. See the Diff Eq Lab website (APPM 2460) for help on using ode45 in MATALB. Submit a.pdf of your lab report and any code used for this project to D2L by 11:59 pm on December 4. 4
A Turning MATLAB figures into images To turn a MATALB figure into an image (say, a.png file), go to file Save As, then choose the folder you would like to save the image in, choose the file type (e.g..png), then name your file (e.g. image1.png). This will save the image as a.png file named image1 in the folder you chose. B Plotting more than one curve in the same figure To do this, you need to utilize the hold on and hold off commands. Hold on allows you to keep plotting things on the same figure without deleting previous curves. Hold off turns this feature off. For instance, to plot both sin x and cos x on the same plot do the following: x = 0:pi/16:2*pi; figure(1); hold on; plot(x,sin(x), r- ); plot(x,cos(x), b-. ); legend( sin(x), cos(x) ); hold off; This yields the plot in 3. Note that (1) the third argument in the plot commands defines the kind of line Figure 3: Plotting sin x and cos x. that the curve will be plotted with (here sin x will be plotted in a red line and cos x will be plotted in a blue dotted-dashed line) and (2) the legend command labels the curves (it automatically keeps track of the order in which the curves were plotted, so you just need to list the labels in the same order you plotted the curves). 5