Top Banner
Mathematical Modeling in Biological Systems Summer School at the Institute of Natural Sciences Shanghai Jiao Tong University Lecture Notes June 6 - June 10 Adam Stinchcombe © 2016
61

Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Mar 23, 2018

Download

Documents

VuHanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Mathematical Modeling in Biological Systems

Summer School at the Institute of Natural Sciences

Shanghai Jiao Tong University

Lecture Notes

June 6 - June 10

Adam Stinchcombe © 2016

Page 2: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Contents

Introduction 3

Models of Neuronal Membrane Voltage 41.1 The Hodgkin-Huxley Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 The Cable Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.3 The Integrate and Fire Model . . . . . . . . . . . . . . . . . . . . . . . . . . 121.4 Computer Lab: Simulating Neuronal Models . . . . . . . . . . . . . . . . . 14

1.4.1 Space Clamped Hodgkin-Huxley Equations . . . . . . . . . . . . . . 141.4.2 The Cable Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . 151.4.3 Pulse-Coupled Integrate-and-Fire Neurons . . . . . . . . . . . . . . . 15

Compartment Models of Disease 172.1 The Kermack-McKendrick Model . . . . . . . . . . . . . . . . . . . . . . . . 17

2.1.1 The SIS Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.1.2 Stochastic SIR Model . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.2 Computer Lab: Disease Spread over a Network . . . . . . . . . . . . . . . . 242.2.1 A Network Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242.2.2 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

Mammalian Ovulation 283.1 The Lacker/Peskin Model of Mammalian Ovulation . . . . . . . . . . . . . 283.2 Computer Lab: Optimal Control of Mammalian Ovulation . . . . . . . . . . 34

Stochastic Gene Expression 374.1 The Random Telegraph Model . . . . . . . . . . . . . . . . . . . . . . . . . 37

4.1.1 Solution of the Steady-State mRNA Distribution . . . . . . . . . . . 434.2 Fitting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

4.2.1 Switching Time Distributions with Maximum Likelihood . . . . . . . 444.3 Computer Lab: Fitting Data . . . . . . . . . . . . . . . . . . . . . . . . . . 45

4.3.1 The gamma Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 45

1

Page 3: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

4.3.2 Lotka-Volterra Equations . . . . . . . . . . . . . . . . . . . . . . . . 46

A Model of the Circulatory System 505.1 Static Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505.2 Dynamic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555.3 Computer Lab: Computing the Power of the Heart . . . . . . . . . . . . . . 58

5.3.1 Given Aortic Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585.3.2 Dynamic Circulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 595.3.3 Additional Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

2

Page 4: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Introduction

One of my favorite quotes is from John von Neumann that says “If people do not believethat mathematics is simple, it is only because they do not realize how complicated life is”.One objective of mathematical biology is to simplify biology by making it mathematical.To many this is paradoxical, but it is almost self-evident to those that are fluent in thelanguage that is mathematics.

There are a vast number of excellent resources available if you wish to study the topicof mathematical biology more completely. Some of the material from these notes canbe found in Hoppensteadt and Peskin Modeling and Simulation in Medicine and the LifeSciences. Keener and Sneyd Mathematical Physiology and Murray Mathematical Biologyare widely considered to be the preeminent references on the topic. Edelstein-KeshetMathematical Models in Biology has been the textbook for the mathematical biology courseat the University of Michigan for a number of years. Britton Essential Mathematical Biologyis a very nice read.

Presented here are a small number of topics that the author has found interesting. Eachlecture topic is accompanied with computer lab exercises. The labs have been created forMatlab, but could easily have been developed for other platforms. The purpose of thelabs is to learn by doing and experience the many practical issues related to modeling inthe biological sciences.

Nearly all of the models take the form of a differential equation. Take care to appreciate themodel hypotheses implicit in these equations. Once the base model is specified, I attemptto modify and extend it. This is how all mathematical models should be viewed - waitingto be tailed to your novel application. The extension often comes in the form of posingsome optimization problem around the model. I believe that this leads to the most excitinguses for most models.

I would be happy to receive feedback on the lectures, labs, or these notes. Please contactme at [email protected] with any input.

Cheers, Adam R Stinchcombe (Department of Mathematics, University of Michigan)

3

Page 5: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Models of Neuronal MembraneVoltage

1.1 The Hodgkin-Huxley Model

The most famous mathematical model, certain in biology, but likely in all of science is theHodgkin-Huxley model of the electrical activity of squid giant axon. It is important tomention that this is a regular squid and a giant axon, not a regular axon of a giant squid.The large axon runs the length of the squid and is so large that it is easy to insert wires toperform experiments. This axon is used to send a message that triggers an escape responsewhen the animal is threatened. We will see that the speed of the message and the size ofthe axon are related.

Alan Lloyd Hodgkin and Andrew Huxley received the 1963 Nobel Prize in Physiology orMedicine for their modeling and experimental work. You might recognize the Huxley nameas that of writer Aldous Huxley. Andrew and Aldous were half-brothers. This model is thefoundation for our understand of the electrical activity of nearly all cells. The observationthey were trying to explain was the action potential, a quick rise and fall of the membranevoltage that propagated down the axon. The key insight was that the membranes ofcells have variable conductance that dynamically depends on voltage. See Fig. 1.1 for areproduction of a figure from the original Hodgkin-Huxley paper showing the simulatedaction potential.

In several experiments, a silver wire was inserted on the interior of the axon. Since thewire has a high conductivity (a low resistance), the voltage across the membrane becameuniform along the length of the axon. This configuration is called ’space-clamped’ sincethe voltage is constant along the axon.

The cell membrane is a lipid bilayer, see Fig. 1.2. Two layers of hydrophilic ‘heads’ pointoutward to the extracellular and intracellular regions. Hydrophobic ‘tails’ point towardseach other. It is difficult for charged ions to pass through this Being a capacitor, currents

4

Page 6: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 1.1: Simulated action potential in the squid giant axon. From Hodgkin AL, Huxley AF. 1952.

Figure 1.2: (left) The lipid bi-layer of the cell membrane. (right) A circuit diagram for a neuron.

onto and off-of the membrane drive changes in the membrane voltage, that is the differenceis electrostatic potential between the inside and outside of the cell. The circuit diagram(of each patch of membrane) is shown in Fig. 1.2. The cell membrane acts as a capacitorwith capacitance Cm. Specialized channels allow ions to pass through the membrane. Theresistance experienced by these currents are variable, time and voltage dependent. It willbe convenient to work with conductance g, the reciprocal of resistance, since conductancesadd in parallel and all of the ion channels are in parallel with each other. Since thesecurrents are driven by differences in concentrations, they are supported by a battery withvoltage E. A current source due to ionic pumps, mostly the sodium-potassium pump,maintain the natural concentration gradient.

It will be sufficient to consider three separate currents: sodium, potassium, and a leak

5

Page 7: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

current (typically carried of chloride ions). Since the cell actively maintains a concentrationdifference in sodium and potassium - sodium is relatively low and potassium is relativelyhigh on the interior of the cell - the currents are effectively driven by a battery. The batterypotentials are known as reversal potentials. By some estimates, two thirds of the metabolicenergy expenditures of neurons goes to maintaining these concentration gradients, primarilythrough the sodium-potassium pump. Clearly, this concentration gradient is important tothe functioning of the neuron.

The current-balance equation, in which ionic currents are balanced by the capacitive cur-rent, is given as

CmdV

dt=∑i

Ii = −gNa(V − ENa)− gK(V − EK)− gL(V − EL). (1.1)

The conductances are gNa, gK, and gL for the sodium, potassium, and leak currents respec-tively. The corresponding reversal potentials are ENa, EK, and EL.

We can re-write Eq. (1.1) as

CmdV

dt= g(E − V ), (1.2)

g = gNa + gK + gL, (1.3)

E =gNaENa + gKEK + gLEL

gNa + gK + gL. (1.4)

Equation (1.2) shows that the voltage exponentially tracks E. Since E is a weightedsum of the reversal potentials, with weights that are proportional to the correspondingconductance, the membrane voltage heads towards the reversal potential for the ion typewith the most conductance. The reversal potentials are order as EK < EL < ENa. Wewill see that the membrane conducts sodium to drive the membrane voltage up which isreturned down when the membrane conducts potassium.

Suppose that g and E were constant in Eq. (1.2). The solution for V would be an expo-nential relaxation towards V = E,

V (t) = E + exp

(− g

Cmt

)(V (0)− E). (1.5)

This is clearly not going to produce an action potential. However, changes to the con-ductances for the different ion types would dynamically change E and V since V tracksE.

6

Page 8: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

The conductances are varied dynamically by writing them in the form,

gNa = gNam3h, (1.6)

gK = gKn4, (1.7)

gL = gL. (1.8)

The dynamic variables m(t), h(t), and n(t) and are known as gating variables since theycorrespond to the fraction of open, physical gates in the ion channels. Hodgkin and Huxleychose the form of the currents to fit their data. It was confirmed much later that thesodium channel consists of three activating, independent gates one inactivating gate, whilethe potassium has four activating, independent gates. The leak current is not gated. Thegating variables remain between zero and one making the conductances with a bar themaximal conductances.

The gates open and close randomly and independently. This leads to the first-order, macro-scopic kinetics of

dm

dt= αm(V )(1−m)− βm(V )m, (1.9)

dh

dt= αh(V )(1− h)− βh(V )h, (1.10)

dn

dt= αn(V )(1− n)− βn(V )n. (1.11)

The rates of opening α and closing β depend on voltage.

The opening and closing rate functions were fit to experimental data giving

αm(V ) =0.1V + 4

1− exp(−0.1V − 4)βm(V ) = 4 exp(−(V + 65)/18)

αh(V ) = 0.07 exp(−(V + 65)/20) βh(V ) =1

1 + exp(−3.5− 0.1V )

αn(V ) =0.01V + 0.55

1− exp(−0.1V − 5.5)βn(V ) = 0.125 exp(−(V + 65)/80)

The model parameters given the values,

gNa = 120 mS/cm2, ENa = 50 mV,

gK = 36 mS/cm2, EK = −77 mV,

gL = 0.3 mS/cm2, EL = −54.4 mV,

Cm = 1µF/cm2.

7

Page 9: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

We will assume that the reversal potentials are constant, but in actuality they do vary abit during an action potential.

In summary, the Hodgkin-Huxley equations are a system of four differential equations formembrane voltage V ,

CmdV

dt= −gNam

3h(V − ENa)− gKn4(V − EK)− gL(V − EL), (1.12)

and the gating variables m, h, and n governed by Eqs. (1.9)-(1.11).

It is somewhat more insightful to write the gating variable dynamics as a relaxation toan equilibrium value such as τm

dmdt = m −m∞ using the timescale τm = αm/ (αm + βm)

and equilibrium value m∞ = αm/ (αm + βm). Plots showing their dependence on voltageare given in Fig. 1.3. You see that m and n activate the sodium and potassium currentsrespectively at high voltage, while h inactivates the sodium current when the voltage ishigh. The fastest gating variable is m, while n and h are considerably slower.

-100 -50 0 50V

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

m∞

, n ∞

, h ∞

-100 -50 0 50V

0

1

2

3

4

5

6

7

8

m, τ

n, τ

h (ms)

mnh

Figure 1.3: The timescales and equilibrium values for the gating variables as functions of voltage.

The action potential is explained as a fast positive feedback for which increases in voltageopen sodium channels that let more sodium in causing further increases in the voltage.This process causes the initial rapid increase in voltage. The slower potassium channelsopen in response to the high voltage, as well as the sodium channels are inactivated. This

8

Page 10: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

stops the inwards flow of sodium and allows potassium to exit the cell causing a decrease involtage. from the sodium current followed by a slow correction from the potassium current.Once near the resting potential, the gates return to their equilibrium configuration and thewhole system returns to equilibrium.

The action potential can also be explained by the dynamics given by Eq. (1.12) andEqs. (1.9)-(1.11). In Fig. 1.4, the stages of the action potential are represented with twostate variable planes. Trajectories are shown in light gray that would result if under eitherfixed n and h variables or m = m∞ and h = b0 − b1n. For low voltage, the V -m planeis bistable. If the voltage is pushed above the separatrix, the system state will be driventowards the high-voltage equilibrium in the rising phase of the action potential. Once nearthe equilibrium the slow scale catches up as n and h change. This causes the high-voltageequilibrium and the unstable saddle to move towards each other and annihilate during theplateau of the action potential. The only equilibrium is the one with low voltage, so thestate is driven down and undershoots the reseting voltage. On the slow time scale, thefast phase-plane is returned to the bi-stable configuration as the voltage creeps back up torest.

1.2 The Cable Equation

To produce a spatially extended version of the model, consider the voltage and gatingvariables to be functions of x, the distance along the axon in addition to time. An axialcurrent i(x, t) must also be incorporated into the model. If ρ is the resistivity of the ionicsolution inside the axon and the axon is assumed to be a cylinder of radius R then accordingto Ohm’s law,

i = −πR2

ρ

∂V

∂x. (1.13)

In each segment of the axon with arbitrary ends a and b, gradients in the axial currentgive rise to currents I(x, t) onto the membrane that must appear in the current-balanceequation:

i(b, t)− i(a, t) =

∫ b

a

∂i

∂xdx = −

∫ b

aI(x, t)2πR dx, (1.14)

I(x, t) = − 1

2πR

∂i

∂x=R

∂2V

∂x2. (1.15)

The so-called cable equation is thus,

CmdV

dt+ gNam

3h(V − ENa) + gKn4(V − EK) + gL(V − EL) =

R

∂2V

∂x2. (1.16)

9

Page 11: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 1.4: Two cross sections of the state space, the V -m and V -n planes, at five times showing the stagesof the action potential.

10

Page 12: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

The gating variables are functions of time, with the space variable x acting like a parameter,governed by Eq (1.9) - (1.11). In particular, the gating variables are governed by

τs∂s

∂t= s∞(V )− s. (1.17)

in which s may stand for m, n, or h.

The second derivative of voltage would suggest that voltage diffuses along the axon. How-ever, because of the excitability of the Hodgkin-Huxley model, the propagation of voltagealong the axon will be very different from diffusion.

We would like to solve this cable equation numerically in the hope of finding traveling wavesolutions. By a traveling wave, we mean a solution of the form V (x, t) = V (x−νt) in whichV is a function of a single variable that gives the profile of the action potential and ν is thespeed of the action potential. This action potential travels down the axon from the somato the axon terminal to transmit the message ‘escape’ in the squid.

The cable equation is a partial differential equation. We need to specify the domain for x,which we will say is finite x ∈ [0, L]. At each end, we need to specify boundary conditions.To match an experiment, you might specify a voltage using a Dirichlet boundary condition,V (0) = V0. You could also specify that there is no current out the end with a Neumannboundary condition ∂V

∂x (0) = 0. It is somewhat artificial, but convenient to specify periodic

boundary conditions. We thus impose V (0) = V (L) and ∂V∂x (0) = ∂V

∂x (L). We need twoconditions since the cable equation has two spatial derivatives. We should make surethat L is large so that the end-effects introduced by this artificial boundary condition areinsignificant. We use L = 100 cm, which is much longer than the length of the squid.

We discretize by taking a fixed spacing in space ∆x and a fixed timestep ∆t. Let vkj =

V (j∆x, k∆t) and sk+1/2j = s(j∆x, (k+ 1/2)∆t) where s = m,h, n. We make the following

discretization of the cable equation. It is called a ‘leap-frog’ method since the gatingvariables are updated assuming fixed voltage and the voltage is updated assuming that thegating variables are fixed. The discrete equations are

sk+1/2j − sk−1/2

j

∆t= αs(v

kj )

(1−

sk+1/2j + s

k−1/2j

2

)− β(vkj )

(sk+1/2j + s

k−1/2j

2

), (1.18)

Cm

vk+1j − vkj

∆t= −gk+1/2

j

(vk+1j + vkj

2− Ek+1/2

j

)+R

(D+D−

vk+1 + vk

2

)j

. (1.19)

Trapezoidal rule discretization gives good numerical stability here. The finite difference

11

Page 13: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

operators are (D+φ

)j

=φj+1 − φj

∆x, (1.20)(

D−φ)j

=φj − φj−1

∆x. (1.21)

Thus, (D+D−φ

)j

=(D−D+φ

)j

=φj+1 − 2φj + φj−1

(∆x)2. (1.22)

We solve Eq. (1.18) for sk+1/2j and Eq. (1.19) for vk+1

j . Note that in Eq. (1.18), the un-knowns at different j are uncoupled. Since the equation is linear, it can be solved explicitly.In Eq. (1.19), the unknowns are coupled through the operator D+D−. Equation (1.19)is a tridiagonal system in that each equation couples vk+1

j to vk+1j+1 and vk+1

j−1 . Techni-cally, the system is a cyclic tridiagonal system since we have assumed periodic boundaryconditions.

On each timestep, we must evaluate an update formula for the gating variables and thenwe must solve a linear system to advance the voltage. The matrix that needs to be invertedchanges on each timestep, but only its diagonal changes. Also, the matrix is symmetric.There are fast methods available for inverting such a matrix in O(J) work and memory forJ points in space.

A numerically computed solution is shown in Fig. 1.5. The initial condition is that allvariables are their equilibrium values except at x = 20 cm where the voltage is abovethreshold. We see an action potential traveling forward and backward. The two wavesare a result of the system’s symmetry. In an actual axon, this symmetry is broken by theboundary condition at the soma where the action potential is initiated.

1.3 The Integrate and Fire Model

A model that can reproduce the action potential is a triumph. However, for understandinglarge populations of neurons, a model of the sub-threshold dynamics only is a lot moretractable. It is thus common to assume that the membrane conductance is constant andwrite the membrane voltage dynamics and solution as

τdV

dt= E − V, (1.23)

V (t) = E + e−t/τ (V (0)− E) , (1.24)

12

Page 14: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0 10 20 30 40 50 60 70 80 90 100-100

-80

-60

-40

-20

0

20

40

V (m

V)

time=10.600 ms

0 10 20 30 40 50 60 70 80 90 100x (cm)

0

0.2

0.4

0.6

0.8

1

m, n

, h

Figure 1.5: A solution to the cable equation with periodic boundary conditions at t = 10.6 ms. An actionpotential travels both directions from its initiation point at x = 20 cm.

in which τ is the the membrane time constant given as the membrane conductance dividedby the membrane capacitance. To account for the action potential, we declare that when-ever the voltage crosses V = Vth that an action potential occurs. We then reset the voltageto its resting voltage. It is common to introduce a refractory period during which the volt-age is held at rest to account for the slow return to rest apparent in the Hodgkin-Huxleyaction potential.

The dynamics described above are shown in Fig. 1.6. In addition, the two neurons arecoupled. When one neuron fires, the other has its voltage jumped up by a fixed amount.As seen in the figure, this is enough to synchronize the two neurons so that they firetogether and share the identical voltage from then on. This form of coupling is known aspulse coupling.

The main benefit to using the simple integrate-and-fire neuron dynamics is that largepopulations are easier to simulated. When a large population of neurons are pulse coupled,many interesting dynamics can result, some of which you will observe in the computerlab.

13

Page 15: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0 50 100 150time (ms)

0

10

20

30

40

50

60

70

mem

bran

e vo

ltage

(mV

)

Figure 1.6: Integrate-and-fire dynamics. Two neurons exponentially tend toward 100mV. When one neuronreaches threshold at 70mV, it is reset to 0mV and the other neuron is instantaneously advanced by 3mV.After a few firing events, the neurons synchronize and fire together. Thereafter they share the exact samevoltage.

1.4 Computer Lab: Simulating Neuronal Models

Reference: Mathematical Aspects of Neurophysiology Charlie Peskin, Handwritten LectureNotes, 2000In this computer lab, we will numerically solve the integrate-and-fire model for a populationof neurons. This will allow us to study synchrony. We will also solve the (space-clamped)Hodgkin-Huxley equations and the cable equations permitting the study of excitability,refractory period, and traveling wave action potentials.

1.4.1 Space Clamped Hodgkin-Huxley Equations

1. We will use a Matlab ODE solver (ode23s) to simulate an action potential in theHodgkin-Huxley equation for the squid giant axon. This is implemented for youin solveHH.m. The right-hand side of the differential equation is implemented inHHrhs.m. Add code to the end of solveHH.m that plots the gating variables versestime.

2. The gating variables are initially at their equilibrium values for the resting membranepotential. Run many simulations with different initial membrane voltages to deter-mine the threshold value for an action potential. What is the (approximate) value of

14

Page 16: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

the threshold?

3. For an initial membrane potential of -20mV, plot m vs t and on the same axis plotm∞(V (t)) vs t. Also, plot h vs n. There are two common approximations made inthis model: a) the gating variable m is set at each instant to m∞ and b) the h andn gating variables are constrained by h = 1 − n. From your plots, comment on thequality of these approximations. Find a new line h = b0 − b1n that is a better fit. Ifavailable, cftool or polyfit make performing this task easy. Create a plot showingh vs n during an action potential with your line of best fit and h = 1− n.

4. You want a) the original model, b) the model with m = m∞ , c) the model withm = m∞ and h = 1 − n, and d) the model with m = m∞ and h = b0 − b1n .Simulate an action potential for each of these four cases and show membrane voltageversus time all on the same plot. You will need to change the differential equationin HHrhs.m for each case. How well are the peak voltage, the minimum voltage, thetime until the peak occurs, the action potential width, and the time to return to theresting potential from the minimum estimated using the approximations?

1.4.2 The Cable Equation

5. Simulate the action potential propagating down the cable. Run solveCable.m. Whydo the forward and backward traveling action potentials not pass through one an-other?

6. Compute the speed of the action potential. You may want to adjust the numericalparameters to check that your results are accurate. Find the time of the voltagepeak at a location down the axon. Be careful to avoid the back propagating actionpotential. Does the action potential speed depend on the initial membrane potential?How does action potential speed depend on the radius of the axon, R. Produce aplot of action potential speed versus R. Why is the giant axon of the squid so large?

1.4.3 Pulse-Coupled Integrate-and-Fire Neurons

7. The integrate-and-fire neuron model is a simple model for neuronal membrane voltagedynamics. The sub-threshold membrane voltage V is governed by τ dVdt = E−V withmembrane time constant τ and reversal potential E. Upon reaching threshold Vth, themembrane voltage is reset to Vr. This model is solved in intfire.m with resettinghandled by Matlab ODE events. Of course, the sub-threshold dynamics can besolved analytically, as was done in lecture, but the approach here is more versatile.The provided code allows you to change the number of neurons; specify differentmembrane time constants, reset voltages, threshold voltages, and reversal potentials;

15

Page 17: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

account for refractory periods; and wire the neurons together in any way you please.Read through and then run intfire.m. Count the number of spikes until the neuronssynchronize and check the value of spikesbeforesync.

8. Do the neurons synchronize when only neuron one gives kicks to neuron two? Changethe connection matrix to C=[0,1;0,0].

9. Return to all-to-all connections. Vary the kick size ε from 0.5mV to 10mV. Plot thenumber of spikes until synchrony as a function of the kick size. You may need toincrease tf if the neurons don’t synchronize by then.

10. Answer one of the four following questions by discussing a plot of your design:

(a) Do a pair of neurons synchronize for negative kicks, ε < 0?

(b) For all-to-all connections, how does the time until synchrony depend on thenumber of neurons N?

(c) Do a pair of neurons with different membrane time constants synchronize?

(d) How does a refractory period affect synchrony?

16

Page 18: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Compartment Models of Disease

2.1 The Kermack-McKendrick Model

Mathematical epidemiology was first formalized by Kermack and McKendrick in 1927.Their model includes many simplifications, but nonetheless has proven very useful in un-derstanding several diseases and has formed the basis for many public health decisions.The model describes the dynamics of compartments or populations of individuals possess-ing a common characteristic that makes them similar and are treated identically within themodel. The goal of the model is to describe how a communicable disease spreads within apopulation of people.

Each compartment is described by an attribute shared by all people within the compart-ment. We will begin with three compartments. The first is the susceptibles, those that donot have the infection, but could possibly get it if they come into contact with an infectedindividual. The second compartment is for the infective indivduals. They have the diseaseand are capable of infecting others. We will not account for an incubation period, so oncea person becomes infected, they are immediately able to infect others. Those infected willeventually recover. We assume that the disease is immunising, so that an individual havingonce recovered cannot become infected again. Therefore, we have another compartmentfor recovered individuals. For some diseases, it would be more appropriate to return arecovered individual to the susceptible compartment.

Suppose that each infected individual has κ interactions with others that could possiblylead to transmission and that this number of contacts is independent of the populationsize. If S is the size of the susceptible population and N is the size of the total population,then κS/N of the interactions are with susceptible individuals. If some fraction τ (calledthe transmissibility of the infectious disease) of the interactions result in transmission,then each infected individual infects κτS/N susceptible individuals per unit time. Thus,β = κτ/N is the proportionality constant for susceptibles becoming infected. The overallrate is thus βSI where I is the population size of the infected individuals. Additionally,we assume that infected individuals recover at a fixed rate γ leading to a decrease in the

17

Page 19: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

infected population with rate γI.

The resulting differential equations governing the population sizes are

dS

dt= −βSI, (2.25)

dI

dt= βSI − γI, (2.26)

dR

dt= γI. (2.27)

This type of model has proven effective for infectious diseases like mumps, measles, andrubella. It is widely known as the Kermack-McKendrick model or the SIR model. Thecore assumption of the model is predicated on the population being “well-mixed” in thatthe susceptible population interacts uniformly with the infected population. A constantproportion of those contacts lead to infection. No individuals are identified or distinguishedin this model. Also, we have described the population sizes as continuous variables. Sincecompartments are filled with people, the total number is necessarily a discrete number,we are implicitly assuming that the populations are large. There is no practical differencebetween 20,000.1 people and 20,000 people, but there is between 2.1 and 2 people.

The total population size N = S + I + R is conserved. People move from compartmentto compartment, but are not created or destroyed. If disease infection typically leads todeath, you may think of the recovered population size as a tally of the dead in whichcase the title ‘recovered’ is a euphemism. The recovered population essentially records thenumber of people who were once infected since the R dynamics is driven by I and doesn’taffect either the S or I dynamics. The R variable is expressed as a functional of the Ivariable,

R(t) = R(0) + γ

∫ t

0I(τ) dτ. (2.28)

The basic reproductive number, R0, is the key value that determines the behavior of anydisease spread model. This common notation of R0 is unfortunate - don’t confuse it withthe recovered population size. The basic reproductive number is interpreted as the averagenumber of infections resulting from each infected person. This notion extends to manydifferent epidemiological models, not just the SIR model. When R0 is greater than one, anoutbreak is likely. One of the most contagious diseases, in terms of the basic reproductiverate, is measles with R0 = 18. The recent Ebola outbreak in West Africa had R0 estimatedfrom 1.5 to 2.2. In the above SIR model, the basic reproductive rate is βS, the numberof susceptible individuals infected per unit time by each infected individual, multiplied by1/γ, the time an infected individual is infected. With R0 = βS/γ, we see that I is increasewhen R0 > 1. Note that R0 depends on the (initial) size of the susceptible population. It

18

Page 20: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

will be important to remember that the susceptibles are critical to drive the spread of thedisease. They are the fuel for the fire.

Numerically computed solutions to the SIR model appear in Fig. 2.7 for R0 < 1 andR0 > 1. The plots below the trajectories are known as ternary plots. Since S+ I +R = Nis constant, the solutions S(t), I(t), and R(t) are constrained to be on a plane in the S, I,Rstate space. Accounting for the constraints that S > 0, I > 0, and R > 0, the state spaceis restricted to an equilateral triangle. Taking an isometric view of the equilateral trianglegives the ternary plot. A point inside the triangle has the S, I, R coordinates determinedby the perpendicular distance to each side of the triangle. Viviani’s theorem that the sumof perpendicular distances equals the height in an equilateral triangle, makes this a sensiblecoordinate system.

0 1 2 3 4 5 6 7 8 9 10time

0

20

40

60

80

100

compartments

R0 = 0.7125

SIR

I=N

R=NS=N

0 1 2 3 4 5 6 7 8 9 10time

0

20

40

60

80

100

compartments

R0 = 2.375

SIR

I=N

R=NS=N

Figure 2.7: Two solutions to Eqs. (2.25)-(2.27) with N = 100. Initially, there are no recovereds and 5% ofthe population is infected. The β parameter has been changed so that R0 < 1 on the left and R0 > 1 onthe right.

The differential equation Eqs. (2.25)-(2.27) have non-isolated equilibrium points: I = 0with S and R free. Typically, we consider N to be a parameter, leaving a one-dimensionalspace of equilibrium solutions, which we will parameterize by 0 < S < N . In the ternaryplots of Fig. 2.7, these equilibrium solutions are on the bottom side of the equilateraltriangle.

The Jacobian of the system evaluated at the equilibria is 0 −βS 00 βS − γ 00 γ 0

, (2.29)

with the double eigenvalue 0 and the eigenvalue βS − γ. The two zero eigenvalues arise

19

Page 21: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

due to the non-isolated equilibria. A basis for the zero eigenspace is {(1, 0, 0)>, (0, 0, 1)>}.In other words, as long as I remains zero, the system will still have an equilibrium. Weconclude that the equilibria are stable if S < γ/β, so that the remaining eigenvalue isnegative. The equilibria with S sufficiently small are stable.

My logic is not valid since the equilibria are non-hyperbolic (the Jacobian matrix haseigenvalues with real part zero). I will be more convincing now. Since S monotonicallydecreases, see Eq (2.25), we are permitted to solve for I as a function of S. Divide Eq (2.26)by Eq. (2.25) to obtain

dI

dS=γI − βSIβSI

βS− 1, (2.30)

with solution

I =γ

βlog

(S

S(0)

)− S + I(0) + S(0). (2.31)

Equation (2.31) gives an implicit relationship between S and I along the solution trajectory.The equilibria that is asymptotically approached is given by solving Eq. (2.31) for S withI = 0 to get

Seq = −γβW

(−S(0)β

γexp

(−βγ

(I(0) + S(0))

)), (2.32)

in which W (·) is the Lambert-W function. In Fig. 2.8, Req = N − Seq is plotted as afunction of βN .

We see that the disease always eventually dies out, leaving some fraction of the populationin the recovered compartment. Many public health decisions are based on the maximalnumber of infected instead of the steady number of recovereds since a large number of sickpeople results in public outcry. The maximum number infected is determined by solvingfor S in Eq. (2.30) after setting the derivative to zero. The value of S when I is maximalis Smax = γ/β, which from Eq. (2.31) gives

Imax = Smax log(Smax/S(0))− Smax + I(0) + S(0), (2.33)

for R0 > 1. If R0 < 1 then Imax = I(0).

We now know everything about solutions to this differential equation. We know thatsolutions will approach I = 0 with a value of S given by Eq. (2.32). If R0 > 1 then I willincrease before decreasing achieving a maximum given by Eq. (2.33). The model has threeparameters (β,γ, and N), but typically either β or γ is set to one by rescaling time. Thissimple model has proven effective for understanding the spread of many diseases.

20

Page 22: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

10-1 100 101

βN

0

10

20

30

40

50

60

70

80

90

100

R(∞

)

Figure 2.8: The steady-state number of recovereds implied by Eq. (2.32) for N = 100, R(0) = 0, γ = 1,and a range of β. Each curve has a different value of I(0) from 1 to 99 (in steps of 7) and S(0) is selectedso that N = 100. Near R0 = 1 there is a transition from only a few people having been infected to nearlythe entire population being inflected by the disease.

2.1.1 The SIS Model

If when an infected recovers, he becomes susceptible to the (non-immunizing) disease, thenthe SIS model is more appropriate:

dS

dt= −βSI + γI, (2.34)

dI

dt= βSI − γI. (2.35)

Since the total N = S + I is conserved, the model can be written as

dS

dt= (γ − βS)(N − S). (2.36)

The fixed points are S = N and S = γ/β. When γ < βN , S = N is unstable and S = γ/βis stable. In this case, we call the disease as endemic as it will persist forever. When therecovery rate is large, γ > βN , S = N is stable and is the only valid steady-state. Thedisease is transient and will eventually die out.

21

Page 23: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

If we rescale, the susceptible population size by N , S = S/N , and rescale time by γ, τ = γt,we get the non-dimensional model

dS

dτ= (1− S)(1−R0S), (2.37)

in which R0 = βN/γ is the basic reproductive number. In Fig. 2.9, a bifurcation diagram inR0 is shown. There is an exchange of stability between the two equilibria at R0 = 1, knownas a transcritical bifurcation, as the disease changes from transient to endemic.

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2R0

0

0.5

1

1.5

2

2.5

3

Seq

Figure 2.9: Bifurcation diagram for the non-dimensional SIS model, Eq. (2.37), showing a transcriticalbifurcation.

2.1.2 Stochastic SIR Model

We will now consider a stochastic version of the SIR model. We will assume that thecompartments are discrete in that the number of susceptible, infected, or recovered peopleis a non-negative integer and interpret the rates in Eqs. (2.25)-(2.27) as transition proba-bilities per unit time. We thus consider two reactions: 1) a susceptible individual becomesinfected with probability per unit time βI and 2) an infected individual recovers with prob-ability per unit time γ. An event then is either a susceptible individual becoming infectedor an infected individual recovering. We assume that the random times between eventsis exponentially distributed with the appropriate rate. This assumption implies that thetime between events in memoryless. Since the number of infected individuals changes uponevery event, the rates associated with these events change with each event.

22

Page 24: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

There are two approaches to simulating this process. The first is a discrete event simulation(also know as the Gillipse method or the stochastic simulation algorithm). In this method,pseudo-random numbers determine the times of each of the two events and the simulationprogresses by jumping to the time of the first event, update the state according to the event,sampling new times for the events, and repeating. This produces an exact realization of thestochastic process. A second approach is known as the τ -leaping method in which we makea fix timestep δt (the variable τ is usually used for the timestep) and decide independentlywhether each event occurred. This is an approximation in that if both events occur duringthe finite timestep then when the first event occurred the rates should have changed, butwere not. The τ -leaping method method can be slow if many steps do not result in anyevents, whereas a discrete event simulation will be slow when there are many events.

We will employ the τ -leaping method. You keep track of the number of susceptible S andinfected I individuals. On each timestep, you sample the binomial distribution with Strials and success probability ∆tβI to determine how many people move from susceptibleto the infected compartment. You also sample the binomial distribution with I trials andsuccess probability ∆tγ to determine the number of people who move from the infectedto the recovered compartment. By using the binomial distribution, we are asking if eachsusceptible individual became infected or not independently with the appropriate proba-bility. Likewise, we ask if each infected individual recovers. The probability mass functionsare

Pr(new infecteds = k) =

(S

k

)(∆tβI)k(1−∆tβI)S−k (2.38)

Pr(new recovereds = k) =

(I

k

)(∆tγ)k(1−∆tγ)I−k. (2.39)

You repeat this process of stepping by ∆t until the number of infected individuals reacheszero, which eventually occurs with probability one. If either ∆tβI or ∆tγ exceed one then∆t should be made smaller.

Many realizations of the stochastic process are shown in Fig. 2.10 beginning with oneinfected individual in a population of 100. Since we are using a fairly large population,the realizations look very similar. The disease is very infectious with R0 = 10 and in eachof the realizations everyone in the population became infected at some point. Notice akey difference between the stochastic and deterministic models is that the number infectedexactly reaches zero at some finite time, whereas in the deterministic model I = 0 is onlyapproached asymptotically.

Lets compute the time at which I = 0, tf , which should give us an idea of how longthe disease should last. Note that tf is a random variable and we would like to know itsprobability density function. There is an analytical solution to this hitting time problemby realizing that we have a finite Markov chain with absorbing states I = 0. However, the

23

Page 25: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0 1 2 3 4 5 6 7 8time

0

10

20

30

40

50

60

70

80

90

100

# of

peo

ple

SIR

Figure 2.10: Six realizations of the stochastic SIR model with β = 1/10 and γ = 1. The initial condition isS(0) = 99, I(0) = 1, and R(0) = 0.

result is obtained with less effort using the simulation. The results are shown in Fig. 2.11.The terminal number of recovereds should be compared with that in Fig. 2.8.

2.2 Computer Lab: Disease Spread over a Network

In this lab you will use Matlab to solve the ordinary differential equation associated withthe SIR compartment model for the spread of a disease. You will study how the diseasespreads across a network of populations.

2.2.1 A Network Model

When modeling the global spread of disease, the assumption of a well-mixed population isoften called into question. People are not totally free to mix between countries. We willaddress this concern by simulating a network of populations. You should view each popu-lation as a well-mixed country and the network connections represent the travel permittedbetween countries.

24

Page 26: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

10-1 100 101

βN

0

2

4

6

8

10

12

t f

10-1 100 101

βN

0

20

40

60

80

100

R(t

f)

Figure 2.11: As function of β, the distribution of hitting times for I = 0 (top) is shown with 17th and 83rd percentiles in dash-dot lines, 33rd and 64th percentiles in dashed lines, and the median in a solid line.The distribution for the terminal number of recovereds (bottom) in shown in the same manner. The initialcondition is S(0) = 99, I(0) = 1, and R(0) = 0 and γ = 1. To get good estimates for the percentiles, 105

simulations were performed for each of 128 values of β.

In the network of populations, each population has its own S, I, and R. We will indexthem with i. For generality, we will allow the parameters β and γ to vary from populationto population. The dynamics are

dSidt

= −βiSiIi +∑j

T Si,jSj −

∑j

T Sj,iSi, (2.40)

dIidt

= βiSiIi − γiIi +∑j

T Ii,jIj −

∑j

T Ij,iIi, (2.41)

dRidt

= γiIi +∑j

TRi,jRj −

∑j

TRj,iRi. (2.42)

The coefficients T Si,j , T I

i,j , and TRi,j are the travel rates from population j and to population

i for the susceptibles, infectives, and recovereds respectively. Note that the susceptiblesfrom one population become the susceptibles in another and likewise for infectives andrecovereds. The travel rates of the susceptibles, infectives, and recovereds can be different.

25

Page 27: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

The positive terms correspond to people entering population i from each other population(sum over j). The negative terms correspond to people leaving population i to each otherpopulation (sum over j). Note that the subscripts i and j have changed positions. Thesetravel rates determine if travel is possible (a non-zero value) and how frequently traveloccurs. Note that the total global population N =

∑i(Si + Ii +Ri) is conserved.

2.2.2 Assignment

1. Download the Matlab program onepopulation.m. Read the code and commentsto determine how it works. The core of the program is the call to ode45 to solvethe ordinary differential equation. Note that I have been vague about the units. Bysetting γ = 1, I am essentially saying that my unit of time is 1/γ, the typical time foran infected individual to recover. The population sizes should be compared againstthe total population of N and interpreted as fractions of the population.

2. Run the program that simulates one population. Reduce the value of β and note thereduction in the size of the outbreak in both the maximum number of infected andthe terminal number of recovereds. Modify the initial condition so that there areinitially more infective individuals (reduce the size of the initial susceptibles so thatthe total population size is the same). How does this affect the size of the outbreak?

3. Download the Matlab program SIRpopulations.m. Observe how the differentialequations are entered in the right-hand side function in SIR rhs. Run the programand make sure you understand the output plots. The top panel shows the distributionof the populations over time. The first population is on the bottom of the stackedarea curves. The pie chart shows the sizes of the compartments. Moving counter-clockwise, the S, I, and R values for each population (if they are large enough)are shown as fractions of the global population at a sequence of times. After theanimation finishes, a table of the final global distribution is shown.

4. Set all of the travel rates to zero (Tnone) and observe that the populations behaveindependently. Set the travel rates using one of the provided structures (circle, achain, all-to-all, etc) and validate that the output makes sense.

5. When only susceptibles can travel, how are the long-run numbers of recovereds inthe network of populations different than that for one population? Set all of theγ equal to 1 and the β equal to 2.0 / 6000. For each provided network structurefor the susceptibles travel rates (set the others to none) and each of the numbers ofpopulations from 1 to 6, report using a table the percentage of recovereds in steady-state. Keep the total global population at 6000 and use equal initial population sizes.Explain anything that you find interesting. Refer to R0 in your explanation. You

26

Page 28: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

may want to use showpieannimation = false; so that you don’t have to wait forthe animation each time.

6. How does travel of infectives spread the disease? Consider four populations with theoriginal γ and β and no travel for susceptibles or recovereds. Reduce the base travelrate to ν = 0.01. You may need to increase the final time of the simulation to findthe steady state. For each provided network structure, report the final distribution ofrecovereds and discuss the time courses of the disease spread. Can population 3, withits lower R0, prevent the spread of the disease in the one direction circular network?How does the time delay between outbreaks reveal the travel network structure?

27

Page 29: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Mammalian Ovulation

3.1 The Lacker/Peskin Model of Mammalian Ovulation

Reference: Regulation of Ovulation Number in Mammals

A large reserve pool of follicles is formed before birth in many female mammals. Eachfollicle in the reserve pool consists of an oocyte (egg) and a few surrounding supportingcells. Follicles continually initiate growth from this reserve pool. This growth is driven byfollicle-stimulating hormone (FSH) secreted from the pituitary gland of the hypothalamus.Although hundreds of follicles develop each menstrual cycle, only a few follicles, typicallyone in humans, fully mature.

The developing follicles release estradiol, which stimulates the pituitary gland to releasemore FSH, which in-turn causes the follicles to grow and release more estradiol. This posi-tive feedback loop gives rise to dramatic growth in the follicles. A small number of folliclesend up being dominant as relatively small follicles have their growth inhibited.

In the dominant follicles, the release of the oocyte is triggered by a surge in anotherpituitary hormone, the luteinizing hormone (LH). This egg release is known as ovulation.The ruptured follicle becomes a corpus lutem that is responsible for the release of thehormone progesterone, which among other functions, serves to stop the release of LH andFSH. We will refer to the number of eggs released during ovulation as the ovulation number.See Fig. 3.12 for a diagram of show the blood serum concentrations of the four hormonesdiscussed vary over the menstrual cycle. Figure 3.13 shows how the follicles communicatewith each other and the pituitary gland via the blood stream.

We will formulate a model of the follicular phase of the menstrual cycle. Consider asystem of N interacting follicles. Each follicle is characterized by it estradiol secretionrate si(t), i = 1, . . . , N . Assume that estradiol is distributed in the plasma volume V atconcentration ξ(t) and that it is removed at a rate proportional to its concentration, γξ.

28

Page 30: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 3.12: A diagram of the essential hormones of the menstrual cycle. From Martin How FemaleHormones Affect Your Diet .

Therefore,

Vdξ

dt=

N∑i=1

si(t)− γξ. (3.43)

Supposing that si(t) slowly varies on the time scale given by V/γ,

ξ(t) =1

γ

N∑i=1

si(t) =

N∑i=1

ξi, (3.44)

so that ξi(t) is the contribution that each follicle makes to ξ(t). Follicle estradiol secretionrate is a marker of follicle maturity and so ξi(t) should be interpreted as both the maturityof the ith follicle and its estradiol secretion rate.

We further assume that the blood serum concentrations of estradiol controls the releaseof FSH and LH and that the instantaneous serum concentration of FSH and LH, in turn,regulate the rate of follicle maturation. Thus, at each instant, the response of each follicledepends on the follicle’s maturity as,

dξidt

= f(ξi, ξ), (3.45)

for some function f(ξi, ξ) that accounts for the ith follicle’s interaction with all other folli-cles.

29

Page 31: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 3.13: A diagram of the interaction between the follicles and pituitary gland via the blood stream.From Lacker Regulation of ovulation number in mammals. A follicle interaction law that controls matura-tion.

It will be easier to understand f(ξi, ξ) as an exponential growth rate and so we write themodel as

dξidt

= ξiφ(ξi, ξ), i = 1, . . . , N, (3.46)

ξ =

N∑i=1

ξi, (3.47)

φ(ξi, ξ) = 1− (ξ −M1ξi)(ξ −M2ξi), (3.48)

ξi(0) ∼ U(0, ε). (3.49)

The choice of the form of φ(ξi, ξ) has been made to reproduce (no pun intended) what isknown about this biological system. Most importantly, as the follicle matures it becomesmore sensitive to FSH so that both development of less mature follicles is inhibited duringlater stages of growth and FSH can initiate early growth for immature follicles. This choiceof φ promotes the growth of follicles whose maturities lie in a certain range. Initially the ξivalues are small and the φ function appears flat over that small range. Follicles with sizes

30

Page 32: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

in the preferred range only have a slight increase in growth rate. However, this advantageis enough to lead to the dominance of only a few follicles. As ξ becomes larger, thepreferred sizes are given more of a growth advantage. See Fig. 3.14. The follicles competewith each other for growth-inducing FSH leading to a run-away process culminating inovulation.

0 2 4 6 8 10 12 14 16 18 20ξi

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

φ

×104

Figure 3.14: φ plotted against ξi for at a sequence of times. Follicles with preferred sizes are given a positivegrowth rate. This advantage is made more significant at later times when ξ is large. The follicle sizes andthe φ values are plotted with circles. Six follicles eventually dominate, with nearly the same follicle sizes,while the rest of the follicles are driven to zero size. The parameters are N = 1000, ε = 10−4, M1 = 5.5,and M2 = 20.5.

Each follicle is treated the same in its interaction with rest of the population of follicles.If we wanted the interaction to be different for each follicle then we would have made φvary with the follicle index i. This symmetry will turn out to be useful. Without loss ofgenerality, we will assume M1 ≤ M2. These two parameters will need to be selected totailor the model to the particular mammalian species of interest. We will begin with valuesof M1 = 5.5 and M2 = 20.5.

Dormant follicles are continually beginning to develop at random times throughout thecycle. As a model, we suppose that there is a specific number of follicles N of various sizesthat begin developing at the start of each cycle. Therefore, the initial follicle sizes havebeen selected to be independent and identically distributed uniformly on the interval [0, ε].

31

Page 33: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

The additional parameter ε is small and whose specific value that is not very consequentialfor the model outcomes. We use the condition ε � 1/N so that E[ξ(0)] � 1. The valuefor ε does affect the time until ovulation occurs.

Since the initial condition is random, the solution is random. In particular, the ovulationnumber is a random variable. Note that since ξi(0) are independent and identically dis-tributed, ξ(0) is very nearly normally distributed according to the central limit theorem.A typical solution to the model is represented in Fig. 3.15.

Figure 3.15: A simulation resulting in an ovulation number of 6 for N = 1000, M1 = 5.5, and M2 = 20.5.For the dominant follicles, ξi(t) is plotted in blue. The first-to-third quartiles of the distribution of folliclesizes is the shaded region with the black curve showing the median. The dashed curve is a plot of ξ(t).

A few comments will help you appreciate the behavior of this model. The order of the folliclesizes is preserved in time. If ξ1(0) ≤ ξ1(0) ≤ . . . ≤ ξN (0) then ξ1(t) ≤ ξ1(t) ≤ . . . ≤ ξN (t)for t ≥ 0. This follows from a simple contradiction argument that if they are to changeorder then at some time two follicles will have to have the size and the previously smallerfollicle with have to be increasing in size faster than the other one. However, two follicles ofthe same size must have the same growth rate from the differential equation. This makesit impossible for the order of follicle sizes to change.

The model typically exhibits finite time blow-up. It is possible, and common, for manyfollicles to have their sizes approach infinity. When this occurs for multiple follicles, theirsizes all asymptote to infinity at the same time, while the remaining follicles have theirsizes driven to zero. This blow-up gives a clear indication that ovulation has occurred.The number of eggs released is assumed to be equal to the number of follicles that have

32

Page 34: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

sizes that approach infinity even though in reality not all large follicles release an egg. Atthis finite time blow-up, the amount of LH being released by the pituitary gland is alsobecoming infinitely large. This very large release of LH can readily be detected in theblood serum. This LH surge is what home ovulation predictor kits detect. Since the modelvariable ξi can also be interpreted as follicle maturity, a blow-up in ξi corresponds nicelyto the remarkable change in size undergone by follicles, growing to the impressive size ofaround 20mm.

Observe that φ = 0 and ξi = 0 implies that ξ = 1. Initially, when ξ < 1, all butexceptionally large follicles will have a positive growth rate. Once the follicles have grownenough so that ξ > 1, the smallest follicles will have a negative growth rate and will bedriven to zero. With continued growth, more follicles will fall below the threshold, thesmaller root of φ = 0, ξSS

− below, which increases with ξ. This process is how the folliclescompete for dominance within the model.

For simplicity, we will consider a special initial condition for which M follicles have identicalsizes and the remaining N −M follicles remain dormant. The differential equation thenbecomes

dξ1

dt= ξ1φ(ξ1,Mξ1) = ξ1

(1− ξ2

1M), M = (M −M1)(M −M2), (3.50)

ξi(t) = ξ1(t), i = 2, . . . ,M, (3.51)

ξi(t) = 0, i = M + 1, . . . , N. (3.52)

When M > 0, the differential equation has three real equilibria, ξ1 = −1/√M, 0, 1/

√M ,

which are stable, unstable, and stable respectively. When M < 0, ξ1 = 0 is the only realequilibrium and it is unstable. Therefore, the solution goes to infinity when M1 < M < M2

for all non-zero initial conditions and asymptotes to 1/√M otherwise. Additionally, the

solution is explicitly

ξ1(t) =ξ1(0)√

e−2t + (1− e−2t)Mξ1(0)2

(3.53)

and we see that the blow-up time is t = 12 log

(1− 1

Mξ1(0)2

). We have learned from the

symmetrical initial condition that the ovulation numbers are restricted to be between M1

and M2.

Consider the equilibria of the differential equation. In equilibrium, the follicles sizes areeither zero ξSS

0 = 0 or one of

ξSS± =

M1 +M2

2M1M2ξ ±

√(M2 −M1

2M1M2

)2

ξ2 +1

M1M2. (3.54)

33

Page 35: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Note that ξSS− < 0 for ξ < 1.

To determine the steady-states of the system, we are seeking two non-negative integernumbers MSS

− ≥ 0 and MSS+ ≥ 0 so that

MSS+ ξSS

+ +MSS− ξSS− = ξ, (3.55)

MSS+ +MSS

− ≤ N, (3.56)

ξ < 1 =⇒ MSS− = 0. (3.57)

Since φ is a downward opening parabola for any value of ξ, when MSS− 6= 0 the equilibrium

solution will be unstable. Seeking stable equilibria, we take MSS− = 0, in which case

ξ =MSS

+√(M1−MSS

+ )(M2−MSS+ )

, so that MSS+ = 0, . . . ,min(N, M1M2

M1+M2) give valid solutions.

We have only considered stability with regard to perturbations in each ξi holding ξ fixed.However, we jump to the conclusion that there will be some stable equilibria with somenon-zero follicle sizes. Thus, the long-run behavior of the system will be either an approachto a stable equilibrium or a blow-up to infinity for some number (the range determined byM1 and M2) of dominant follicles. The former is known as an anovulatory state and thelater is ovulation.

Having introduced and studied a model of mammalian ovulation, it is natural to attemptto control the process as we will do in the computer lab.

3.2 Computer Lab: Optimal Control of Mammalian Ovula-tion

In this lab you will use Matlab to solve the ordinary differential equation associated withthe Lacker/Peskin model of ovulation. You will modify the model to account for one formof birth control and solve an optimal control problem to prevent ovulation.

1. Download simulate LackerPeskin.m and ovulation.m. Run the latter. The ordi-nary differential equation solver ode23s is used to integrate Eqs. (3.46)–(3.49). Anevent is used to detect ovulation and stop the simulation when a follicle achievesa size above xiimax. In the plot, the first-to-third quartiles of the values of ξi(t)is shaded and the median is plotted with a black line. The sizes of the dominantfollicles are plotted in blue. Note the logarithmic scale. Repeated runs of the codeshould give different results since the initial condition is random. Change N = 200as that is a more reasonable for the number of follicles that develop each cycle inyoung and healthy human females.

34

Page 36: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

2. Write a function, called ovulation number distribution.m, that takes as inputthe parameter structure, uses a for-loop to solve the differential equation for manyinitial conditions, and returns as output estimates of 1) the distribution of ovulationnumbers; 2) the average ovulation time (ignoring those for which ovulation did notoccur); and 3) the probability of ovulation. Use histc to compute the probabilitymass function for the ovulation number from the samples. This function will beuseful for the next three steps.

3. In the model, a variable number of eggs are released depending on the parameters M1

and M2. For a grid of these parameters (each on [0,25]), produce contour plots forthe probability of ovulation, the probability of an ovulation number of one, and theprobability of an ovulation number of two. Use contourf. A template is providedin M1M2contours.m. For each value of M1 and M2, this will require many hundredsof simulations to get an accurate estimate of the probability. This might take a longtime to run. Try using parfor to compute your independent for-loop iterates inparallel.

4. Make a choice of parameters M1 and M2 so as to be consistent with the estimatedhuman probabilities of 93% and 7% for ovulation numbers of one and two. Therelease of two eggs accounts for the approximately 3% occurrence rate of fraternaltwins.

5. In the model development, we did not specify the units of time. Since the differ-ential equation is autonomous, we are free to scale time, t → λt, without alteringthe solution behavior. Scale time so that, on average, ovulation occurs at T = 14days. In particular, multiply the right-hand side of each differential equation byλ so that on average ovulation occurs at T = 14. Note that this is mostly acosmetic change to the model. Implement the scaling in the indicated location insimulate LackerPeskin.m.

6. We need to modify the model so as to account for birth control, which acts primarilyby changing the progesterone level in the blood stream. We first need to describethe natural release of progesterone in the body. During a natural cycle, progesteronecan be found in high levels during the lateral phase, after ovulation. Leading up toand mostly after ovulation, the ovaries release progesterone to shutoff the positivefeedback loop that drove the development of the follicles.

We introduce an additional variable for the blood progesterone concentration, P (t).Since progesterone in the blood serum is quickly degraded, we will assume that P (t)is proportional to the total instantaneous rate of progesterone increase. These sourceswill be both natural N(t) and artificial D(t).

We model the natural release of progesterone by mature follicles as N(t) ∝ ξ. Wemodel the affect of progesterone on the positive feedback cycle driving the growth

35

Page 37: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

of the follicles as a shift in the φ function. Thus, we modify the φ function asφ′ = φ(ξi, ξ) − αξ − βD(t). The function D(t) is left to our choosing. Modify theright-hand side of the differential equation in simulate LackerPeskin.m. Rememberto pass a function handle for D(t) to the rhs function. Start with the parametersα = 0.5 and β = 2, but you may need to adjust them so that the behavior isreasonable.

7. To specify an optimization problem, we must pick an objective and some constraints.We will consider only time from 0 to T = 14 days. The drug release rate mustbe non-negative, D(t) ≥ 0. So that ovulation does not occur, we will impose thatξ(T ) = 0. We could impose that each follicle size at time T is zero, ξi(T ) = 0, butthat would be N conditions instead of one and since ξi ≥ 0, these conditions areequivalent. Remember that since the model has a random initial condition, we arereally requiring Pr{ξi(T ) = 0} = 1.

There are several possible objectives. Here are some possibilities:

(a) min maxt∈[0,T ]D(t) so that maximum amount of drug used is as small as possible

(b) min∫ T

0 D(t)dt so that the total amount of drug used is as small as possible

(c) mint∈[0,T ] |D′(t)| so that changes in the drug are kept to a minimum

Choose the one objective that you think is most reasonable.

8. We will take a direct approach to numerical optimal control. Choose one of the fol-lowing families of functions. They each represent a subset of admissible functions forD(t) and we will select the best within that subset by optimizing for its parameters.Note that some families are incompatible with some of the above objectives.

(a) a polynomial of degree K, D(t) =∑K

k=0 aktk

(b) a Fourier series with K frequencies, D(t) = a0+∑K

k=1

[ak sin

(2πk t

T

)+ bk cos

(2πk t

T

)](c) a bang-bang control with K switch times, D(t) = Dmax

∑Kk=1(−1)k+1H(t− tk)

9. Solve the constrained optimization problem using fminsearch. Impose a penalty forviolating the constraint ξ(T ) = 0 by adding κξ(T ) to your objective for some largevalue of κ. You will need to run multiple simulations (for each evaluation of theobjective function) to account for the random initial condition. What parametersdid the optimization procedure return? What is the value of the objective function?

36

Page 38: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Stochastic Gene Expression

4.1 The Random Telegraph Model

The central dogma of molecular biology is that information stored in DNA, as a sequenceof nucleotides, flows from DNA to RNA and then to protein. This basic biological processof gene expression is extremely important as the rudimentary process underlying all lifeon earth. It is then surprising to find out that gene expression is subject to considerableintrinsic noise. Chemical reactions are inherently probabilistic events, which can onlybe described deterministically when large numbers of reactants are present. Since geneexpression involves only a small number of molecules (there is only a couple of copies ofthe gene, upwards of a dozen transcripts, etc), it is intrinsically noisy.

In a broad sense, noise is associated with unreliability. However, this is certainly not thecase in the vast majority of genetic systems. It is important to study the many ways inwhich life has figured out how to manage and utilize gene expression noise.

In Fig. 4.16, you will see a microscope image from an in situ hybridization experimentshowing a distribution of the number of mRNA transcripts (for a single gene) in an isogeniccolony of cells.

We present here a mathematical model of gene expression. The reaction scheme for themodel is summarized by the diagram:

Idwell time T0

←→ Adwell time T1

, (4.58)

Aν−→ A + mRNA, (4.59)

mRNAδ−→ Ø. (4.60)

A gene of interest fluctuates randomly, Eq. (4.58), between an active state A, in whichtranscription occurs, and an inactive state I, in which transcription cannot occur. The

37

Page 39: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 4.16: Microscope image from an in situ hybridization experiment showing individual mRNA tran-scripts (of a single gene) in a population of isogenic cells. Cell nuclei are colored blue and mRNA transcriptsare green.

phrase “transcriptional burst” refers to the synthesis of mRNA during active-gene epochsseparated by periods in which the gene is transcriptionally inactive.

In Eq. (4.58), T0 and T1 are random variables with probability densities fT0 and fT1 respec-tively. When the gene is in the active state, Eq. (4.59), the synthesis of mRNA molecules isgoverned by a Poisson process, with a probability per unit time of a synthesis event equalto ν. Each mRNA molecule is stochastically degraded, Eq. (4.60), with probabilities perunit time, per molecule, of δ.

We ignore spatial effects including diffusion of mRNA and mRNA export from the nucleus.We neglect feedback that would affect the gene state based on the amount of protein.The production and degradation of both mRNA is considered to be a simple birth-deathprocess, which is a reasonable first approximation.

38

Page 40: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

A realization of the stochastic process for M(t) is shown in Fig. 4.17.

0 1 2 3 4 5 60

2

4

6

8

10

12

time

M(t

)

T1

T0

Figure 4.17: The gene state, shown in black, is either active or inactive. The durations in each state arerandom variables, T1, T0. When the gene is active, mRNA is produced. mRNA is degraded whether thegene is active or inactive. At each instant of time M is a random variable.

In this model, there are two sources of noise. The first is noise from the small number ofmolecules involved arising from the random creation and degradation times. The second isthe random activation and inactivation of the gene. These effects can be separated moreclearly by assuming that that the mRNA is a continuous variable. There is a fantasticresult that by solving the continuous mRNA model first, you can obtain an exact solutionto the discrete mRNA problem.

In particular, the probability mass function for the discrete random mRNA copy number,M , can be derived from the probability density function for the continuous random mRNAcopy number, Y , in an analogous continuous mRNA model problem. The continuousmRNA problem is not used as an approximate model. Instead, it is used as a mathematicaltool to determine, exactly, the mRNA distributions in the fully discrete problem.

In the continuous mRNA model, transcription and degradation of mRNA are deterministicprocesses for any given history of the dichotomous random gene-state function, Z(t); thecontinuous mRNA copy number, Y (t), is random only because the gene-state function is

39

Page 41: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

random. The random differential equation for the continuous mRNA copy number is

dY

dt= ν Z(t)− δ Y, (4.61)

where Z(t) is the dichotomous random gene-state function. For any given gene-state historyfunction Z(t), Eq. (4.61) can be solved analytically. Given the specific initial condition thatY (0) = 0,

Y (t) =

∫ t

0ν Z(t′) exp

(− (t− t′) δ

)dt′. (4.62)

A plot of one realization of Z(t) and Y (t) is shown in Fig. 4.18.

Figure 4.18: The gene state Z(t) in black switches back and forth from on to off. The continuous mRNAnumber Y (t) exponentially tends towards two different values depending on whether the gene is off or on.

We define fY(y, t) to be the probability density function for Y (t), i.e., fY(y, t) dy =Pr{Y (t) ∈ (y, y + dy)}. It is worth noting that the continuous mRNA copy numbercannot exceed ν/δ, provided that Y (0) ∈ [0, ν/δ], because ν/δ is the steady-state valuethat Y approaches when the gene is fixed in the active state. Consequently, Y (t) ∈ [0, ν/δ]for all t.

See Fig. 4.19 for the discrete mRNA distribution arising from the continuous mRNA densityfor different parameters.

In the discrete mRNA version of the reaction scheme depicted in Eq. (4.58)–(4.60) thesynthesis and degradation events occur at points in time. Synthesis occurs with probabilityper unit time, νZ(t), and each synthesis event increases the mRNA copy number by 1.

40

Page 42: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0

0.05

0.1

0.15

0.2

(0.5, 0.5) (5, 0.1, 2, 0.25)

f Y∞, p

M∞

(5, 0.5) (5, 1, 2, 0.25)

0 5 10 150

0.05

0.1

0.15

0.2

(0.5, 5) (5, 0.1, 2, 2.5)

f Y∞, p

M∞

Y, M0 5 10 15

(5, 5) (5, 1, 2, 2.5)

Y, M

A B

DC

Figure 4.19: In steady-state, the discrete mRNA probability mass function p∞M and the continuous mRNAprobability density f∞Y .

Degradation occurs with probability per unit time, per molecule, δ, and each degradationevent decreases the mRNA copy number by 1. The solution for the probability massfunction for the random mRNA copy number M(t) in this classical birth-death process,with any given Z(t), is a Poisson probability mass function at each point in time witha mean given by Y (t), as defined in Eq. (4.62), i.e., the solution to the correspondingcontinuous mRNA problem above. The unconditioned probability mass function for M(t)is given by

pM(m, t) =

∫ ν/δ

0pM |Y (m; y) fY(y, t) dy

=

∫ ν/δ

0

ym

m!e−yfY(y, t) dy, for m ∈ Z ≥ 0. (4.63)

Knowledge of fY(y, t) for the continuous mRNA problem fully specifies the probabilitymass function for mRNA copy number in the discrete problem. The details of gene-stateswitching is encapsulated in fY(y, t). Note that Eq. (4.63) reflects the fact that, in the

41

Page 43: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

fully discrete problem, the random mRNA copy number M is not bounded, even thoughits continuous analog Y is bounded by ν/δ.

At this point we specialize to particular gene state dwell time distributions. We chooseexponential distributions T0 ∼ Exp(λ) and T1 ∼ Exp(γ). We are therefore assuming thatthere is a fixed probability per unit time λ that a gene in the inactive state I switches tothe active state A and a fixed probability per unit time γ that a gene in the active state Aswitches to the inactive state I.

Lets derive a pair of differential equations for the joint probability density-mass function,fY,Z(y, z, t) for z = 0, 1. The probability in a region (y, y + dy) changes due to differencesin fluxes at the boundaries and sources/sinks of probability. There is an advective flux dueto mRNA degradation, fY,Z(y, z, t)δy, and an advection flux due to transcription whenthe gene is active (z = 1), fY,Z(y, z, t)νz. There are sources and sinks associated withswitching. The hazard of switching from an inactive to active gene state is λ and fromactive to inactive is γ.

The resulting coupled pair of partial differential equations for the joint probability densityfunction is

∂tfY,Z(y, 1, t) = − ∂

∂y[(ν − δy)fY,Z(y, 1, t)] + λfY,Z(y, 0, t)− γfY,Z(y, 1, t), (4.64)

∂tfY,Z(y, 0, t) = − ∂

∂y[(−δy)fY,Z(y, 0, t)]− λfY,Z(y, 0, t) + γfY,Z(y, 1, t). (4.65)

Since probability cannot enter from below y = 0 when the gene is active or from abovey = ν/δ when the gene is inactive, we have the boundary conditions fY,Z(y, 1, t) = 0 =fY,Z(ν/δ, 0, t). Noting the direction of the characteristics at the y = 0 and y = ν/δboundaries, combined with an initial condition, we have a well-posed problem for the jointprobability density-mass function.

We can solve for the steady-state by setting the time derivatives equal to zero. The resultingfirst order boundary value problem can be solved analytically. We obtain the following forthe marginal mRNA distribution f∞Y (y) ≡ f∞Y,Z(y, 0) + f∞Y,Z(y, 1),

f∞Y (y) =δ

ν

Γ(λ+γδ

)Γ(λδ

)Γ(γδ

) (δyν

)λδ−1(

1− δy

ν

) γδ−1

. (4.66)

A unique solution from the one-dimensional space of solutions has been obtained by im-

posing the condition that∫ ν/δ

0 f∞Y (y) dy = 1. This is known as a β-density function withshape parameters λ/δ and γ/δ and scale parameter ν/δ.

Substituting the solution for the continuous mRNA problem Eq.(4.66) into Eq. (4.63) andintroducing x = δy/ν, we obtain a solution for the steady-state discrete mRNA probability

42

Page 44: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

mass function

p∞M (m) =Γ(λ+γδ

)Γ(λδ

)Γ(γδ

) (νδ )mm!

∫ 1

0e−

νδxxm+λ

δ−1(1− x)

γδ−1 dx, (4.67)

=Γ(λ+γδ

)Γ(λδ

) Γ(λδ +m

)Γ(λ+γδ +m

) 1F1

δ+m;

λ+ γ

δ+m;−ν

δ

). (4.68)

We chose to represent the probability mass function in terms of the special function 1F1,the confluent hypergeometric function of the first kind.

4.1.1 Solution of the Steady-State mRNA Distribution

Despite the different representations of the steady-state mRNA distribution as an integraland a hypergeometric distribution, numeric evaluation of the steady-state mRNA distri-bution is challenging. Both quadrature on the integral and using a library function forevaluating 1F1, have been found to be unreliable and slow for the range of parameter typ-ically encountered. A fast and reliable method of evaluating the distribution is a practicalnecessity.

Recently, a three-term recurrence relation for the steady mRNA distribution was given byJiao et al.,

m(m+1)p∞M(m+1)−m(ν+λ+γ+m−1)p∞M(m)+ν(λ+m−1)p∞M(m−1) = 0,m ≥ 1. (4.69)

To evaluate the probability mass function, we truncate the distribution at a maximumM . This value can be selected at some large multiple of the mean of the distribution,µM = νλ/(λ + γ). If the probability mass function values are placed in a vector p, thenEq. (4.69) are linear conditions of the entries of this vector,

Ap = 0, (4.70)

for a tridiagonal matrix A. The first value beyond the truncation, pM(M + 1), is assumedto be zero in the last row of Eq. (4.70). There are a total of M linear relations for theM + 1 unknowns in Eq. (4.70). We augment two additional linear constraints. For thefinite number of values of m the total probability is one and that the mean is correct,

M∑m=0

pM(m) = 1, (4.71)

M∑m=0

pM(m)m = µM. (4.72)

43

Page 45: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Additionally, the value of the probability mass function should be non-negative. If we finda negative value then we simplify repeat with a larger value of M .

Inverting the linear system to compute the probability mass function is faster and more ac-curate than evaluating the distribution directly from Eq. (4.67) or Eq. (4.68). In Matlab,we typically find that inverting the linear system is 30,000 times faster than evaluating thehypergeometric function.

4.2 Fitting Data

4.2.1 Switching Time Distributions with Maximum Likelihood

It would be convenient if experimentalists could directly measure the gene state. Supposethat we have independent samples of the dwell times in the active state, {tk}Kk=1. Wehypothesize that these times were sampled from the one-parameter exponential distributionwith density f(t;λ) = λ exp(−λt) for t ≥ 0. We will estimate λ from the samples by formingthe likelihood function

L(λ; t1, . . . , tK) =K∏k=1

f(tk;λ). (4.73)

In the likelihood function, we view the distribution parameter(s), λ, as variable(s) and thesample values as parameters.

We will choose λ as to maximize L of the given samples. For the exponential distribution,we obtain the natural result that λ should be estimated as the reciprocal of the average ofthe samples, as follows. Take the logarithm of the likelihood (since the likelihood and thelog-likelihood have the same extremums), set the derivative with respect to λ to zero, andsolve for λ:

0 =d

dλlogL =

d

K∑k=1

(log λ− λtk) =K

λ−

K∑k=1

tk, (4.74)

1

λ=

1

K

K∑k=1

tk. (4.75)

One conclusion that can be drawn from Eq. (4.75) is that any samples can be fit to anexponential distribution. However, the quality of the fit must be called into question.In Fig. 4.20, we show the log-likelihood function plotted against λ. The samples weregenerated from an exponential distribution with λ = 1. As the number of samples increases,the maximum in the likelihood is less flat indicating a good fit.

44

Page 46: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 4.20: The log-likelihood function for a hypothesized exponential distribution for samples from anexponential distribution with λ = 1. From darkest to lightest, the values of K are 10, 30, 100, and 300.Vertical dashed lines indicate the maximum likelihood estimate of λ.

4.3 Computer Lab: Fitting Data

In this lab you will fit parameters to two sets of data. You will fit a gamma distribution tosynthetic data using maximum likelihood. You will also fit the Lotka-Volterra equationsto some real data using two different approaches.

4.3.1 The gamma Distribution

1. The gamma distribution with mean µ and shape parameter k > 0 has the probabilitydensity function

f(t; k, µ) =kk

Γ(k)µkxk−1ekt/µ for t > 0. (4.76)

It arises from processes that sum independent exponentially distributed random vari-ables. Use the function gamrnd to produce 10, 000 samples from the distribution withk = 3 and µ = 1. Use the histogram function with ‘Normalization’, ‘pdf’ tocheck your results.

2. Write down the log-likelihood for the gamma distribution with K samples. Showthat the maximum likelihood estimate for µ is the sample average. Show that the

45

Page 47: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

maximum likelihood estimate of k satisfies the non-linear equation,

log(k)− ψ(k) = log

(K∑k=1

tk

)− 1

K

K∑k=1

log(tk), (4.77)

in which ψ(k) is digamma function, the logarithmic derivative of the gamma function.Prove that this equation one and only one solution for k > 0 for any set of samples{tk}Kk=1.

3. Use fzero to find the maximum likelihood estimates for k and µ from the syntheticdata you generated in the first step. A decent guess for k is the sample mean squareddivided by the sample variance - a relationship that is true for the gamma distri-bution. You must pretend that you don’t know that value of k for the underlyingdistribution. Also, since ψ throws an error for negative inputs, it is better to solvefor√k using the command kest = fzero( @(sqk) log(sqk^2) - psi(sqk^2) -

log(mean(t)) + mean(log(t)), sqrt(mean(t)^2/var(t)) )^2;.

4. For between 2 and 100 samples, repeat this process 100,000 times. Plot the resultingdistribution of estimates for k. Your plot should look similar to that in Fig. 4.21. Isthis a good procedure to estimate k?

4.3.2 Lotka-Volterra Equations

The Lotka-Volterra equations represent a dynamic model of the continuous populationsizes of a predator species y and a prey species x. In the absence of predators, the preypopulation grows exponentially with rate a and in the absence of prey the predator pop-ulation decays exponentially with rate b. The two populations interact multiplicatively sothat the prey population is decreased by the presence of the predators and the predatorpopulation is increased by the presence of the prey. The rate of predation upon the prey isassumed proportional to the rate at which the predators and the prey meet. The systemof differential equations are

dx

dt= ax− pxy, (4.78)

dy

dt= −by + qxy. (4.79)

There are four positive parameters, a, b, p, and q.

The system has two equilibria: mutual extinction (0, 0) and co-existence (b/q, a/p). Fromlinearization, (0, 0) is a saddle (the eigenvalues are a and −b) and (a/p, b/q) is an unstablespiral (the eigenvalues are ±i

√ab). The system has periodic orbits. There is a quantity

46

Page 48: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

10 20 30 40 50 60 70 80 90 100# samples

0

1

2

3

4

5

6

k est

Figure 4.21: Distribution is maximum likelihood estimates of k in the gamma distribution. The first andthird quartiles are shown with dashed lines and median with a solid line. The thin blue line is true valuefor k.

conserved along trajectories,

V = −qx+ b log(x)− py + a log(y), (4.80)

which has closed and bounded level sets. Note that the periodic orbits are not isolated, sothey are not considered limit cycles.

For its time, we have some excellent data on the populations of snowshoe hares (prey) andlynx (predators) in British North America as estimated by the recorded pellets acquiredby trappers from 1900 to 1920 for the Hudson’s Bay Company. The data is plotted inFig. 4.22. It is clear that the populations follow once another. A rising hare population isfollowed by a rising lynx population, which drives the hare population down. We desire tofit the Lotka-Volterra model to this data.

Here is your assignment:

5. Least-Squares Fitting: Define the error between the model (x, y) and the data(ti, xi, yi) as ∑

i

(x(ti)− xi)2 + (y(ti)− yi)2 . (4.81)

47

Page 49: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0 2 4 6 8 10 12 14 16 18 20t

0

10

20

30

40

50

60

70

80

popu

latio

n siz

e (1

000'

s)

lynxhare

Figure 4.22: Snowshoe hares and lynx estimated population sizes in British North America. Time t is yearssince 1900.

The code in fit lynx hare.m uses fminsearch to find the parameters a, b, p, andq. Note that the initial condition are also determined by the optimization routine.Run the code and record the resulting parameters.

6. Despite its ubiquity, least-squares is criticized for being overly sensitive to outliers.Test this by changing some data points by say 5%. What percentage change resultsin the parameters? Modify the code to use least absolute deviations,∑

i

|x(ti)− xi|+ |y(ti)− yi| , (4.82)

and repeat. Are there other objectives that you could use in the optimization routine?

7. The above code numerically integrated the differential equation to determine themodel solutions, which was the most time consuming part of the optimization routine.We will now use the conserved quantity Eq. (4.80). Use fminserach to find V , a, b,p, q so that the square difference between the left and right-hand sides of Eq. (4.80),summed over the data are as little as possible. Use the starter code in Vfit.m. Do youneed to use the data time values? If the optimization produces negative parameters,either penalize negative parameters with terms in the error like exp(−10a) or impose

48

Page 50: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

the positivity constraints with fmincon. Why or why not do you obtain the sameparameters as for the least-squares fitting? Was it a good idea to use the conservedquantity to fit the model?

49

Page 51: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

A Model of the CirculatorySystem

5.1 Static Model

Reference: Modeling and Simulation in Medicine and the Life Sciences by Frank C. Hop-pensteadt and Charles Peskin (2nd ed.) ISBN: 978-0387215716

The human heart is a pair of pumps made of muscle tissue. Its has four chambers. Theright atrium and the left atrium are located on the top. The right ventricle and left ventricleare located at the bottom. See Fig. 5.23. The left heart moves oxygenated blood fromlungs out to the body, while the right heart moves de-oxygenated blood from the bodyback to the lungs. Electrical activity within the heart cells, very similar to that of neuronsas discussed in the first section, causes the cells to contract in an organized fashion.

When the heart contracts in the systolic phase, the pressure in the aorta rises to its maxi-mum. When the heart rests, in the diastolic phase, the blood is drawn into the heart. Ittakes blood about a minute to circulate through the cardiovascular system.

Well will use subscripts, ‘S’ for systemic, ‘A’ for arterial, ‘P’ for pulmonary, and ‘V’ forveinous. In each collection of blood vessels, three variables are related: volume V in liters,pressure P in mmHg (1atm=760mmHg), and flow Q in liters per minute. The followingtable shows typical values in each system. Note that the total blood volume is about5L.

P (mmHg) V (L)

SA 100 1.0SV 2 3.5PA 15 0.1PV 5 0.4

The stroke volume, that is the amount of blood ejected by the heart on each beat, isabout 0.070 L/beat and the heart rate is about 80 beats/min giving a cardiac output of

50

Page 52: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

5.6 L/min.

We will model the relationship between pressure, volume, and flow in blood vessels intwo different ways. In a resistance vessel, flow is proportional to the pressure difference,Q = (Pin − Pout)/R for some constant resistance R. Such a vessel can support a pressuredifference and has fixed volume. In a compliance vessel, volume is linearly related withpressure, V = Vd + CP for some dead volume Vd and compliance C. Such a vessel can-not support a pressure difference and has a pressure dependent volume. These are bothidealization to the behavior of real vessels. There are two assumptions here. First, we areassuming that a vessel s either a resistance or a compliance vessel and not a combinationof the two. Second, V vs. P and Q vs. (Pin − Pout) is assumed to be linear.

Figure 5.23: A diagram of the circulatory system. Oxygenated blood flows out of the left heart to the bodythrough the systemic arteries to the system veins, where the oxygen is release to the tissues and carbondioxide is picked up. The blood returns to the right heart and goes out the pulmonary arteries and backthrough the pulmonary veins where picks up oxygen from the lungs to deposits carbon dioxide.

51

Page 53: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

The heart, diagrammed in Fig. 5.25, is a pair of pumps that move blood from low to highpressure. We will model the ventricles as compliances vessels with time-varying compliance.Our choice for these functions of time are plotted in Fig. 5.24. The compliance changesperiodically over a heartbeat. The compliance is largest at diastole and lowest at systole.The stroke volume of the heart can be written as the difference its volume during diastoleand systole. Neglecting the latter, we find that the time-averaged blood flow through theheart is given by Q = FCdiastolePin, in which F is the heart rate, Cdiastole is the complianceduring diastole, and Pin is the pressure for the in-flow compliance vessel.

0 0.5 1 1.5time (sec)

0

0.005

0.01

0.015

0.02

0.025

0.03

0.035

0.04

C (L

/mm

Hg)

LVRV

Figure 5.24: Time-varying compliances of the heart’s left ventricle (LV) and right ventricle (RV) over twoheartbeats. The maximal compliance occurs are diastole and the minimum compliance occurs at systole.

See Fig. 5.26 showing the major vessels of the circulation. We have lumped all of the vesselscomprising the major vessel systems into single vessels. For example, all of the systemicarteries are treated as a single compliance vessel.

For time-averaged flow, the inflows and outflows of each vessel much be equal. We call theflow Q = QS = QP = QL = QR. We have obtained a model of steady circulation with nine

52

Page 54: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 5.25: A diagram of the heart. Source.

unknowns Q,PSA, PSV, PPA, PPV, VSA, VSV, VPA, VPV are linearly related,

RS −1 1 0 0 0 0 0 0RP 0 0 −1 1 0 0 0 01 0 −FCR 0 0 0 0 0 01 0 0 0 −FCL 0 0 0 00 −CSA 0 0 0 1 0 0 00 0 −CSV 0 0 0 1 0 00 0 0 −CPA 0 0 0 1 00 0 0 0 −CPV 0 0 0 10 0 0 0 0 1 1 1 1

QPSA

PSV

PPA

PPV

VSA

VSV

VPA

VPV

=

00000000V0

. (5.83)

The last relation expresses the fact that the total blood volume is a fixed parameter V0.Inverting the linear system in Eq. (5.83) allows use to solve the model expressing the modelvariables in terms of parameters.

We study two scenarios using this model. The first is the performance of the circulatorysystem during exercise and the second is blood loss. During exercise, the tissues demandmore blood by reducing the resistance of the system capillaries. In the model, this is areduction in RS. Blood loss corresponds to a reduction in V0. See Fig. 5.27 for a plots of

53

Page 55: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Figure 5.26: A lumped model of the vessels of the circulatory system. Blood flows from the left heart to thesystemic arteries (a compliance vessel) through the systemic capillaries (a resistance vessel) to the systemicveins (a compliance vessel) back to the left heart. Blood continues on from the left heart to the pulmonaryarteries (a compliance vessel) through the pulmonary capillaries (a resistance vessel) to the pulmonary veins(a compliance vessel) and back to the left heart. The new parameters are KL = FCL and KR = FCR fordiastolic compliances CL and CR for the left and right ventricles.

the dependence of PSA, Q, and F on these two parameters. We conclude that people wouldeasily faint - this occurs when PSA is below 60mmHg - for moderate exercise or during aloss of blood.

The problem with the model (people do not often faint during moderate exercise) is thatwe have keep the heart rate F fixed. During exercise and blood loss, the heart rateincreases. The baroreceptor reflex is a homeostatic mechanisms that maintains constantblood pressure. This rapid negative feedback loop increases or decreases the heart ratein response to decreasing or increasing blood pressure in the systemic arteries. This isaccomplished by specialized neurons, baroreceptors, that sense stretching and relay thecorresponding pressure measurement to the brainstem which can cause changes to theheart rate as needed.

We can modify the model, assuming perfect feedback control, by changing PSA = P∗ intoa constant parameter and allowing F to vary. Since F appears in the matrix in Eq. (5.83),the model is no longer linear. To solve the model, we temporally assume that F is given,solve for the volumes in terms of parameters (ignoring the total volume equation) and then

54

Page 56: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

solve for F in the total volume equation. We find that

F =CLV0 − P∗ [CL (CSA + CSV) + CR (CPA + CPV)]

CLCR(CPAP∗RP + CSAP∗RS −RSV0), (5.84)

Q =CLV0 − P∗ [CL (CSA + CSV) + CR (CPA + CPV)]

CLCPARP −RS (CLCSV + CPACR + CPVCR). (5.85)

The results for the controlled steady circulation model are also shown in Fig. 5.27. We seethat for both exercise and blood loss, the heart rate increases to maintain blood pressurein the systemic arteries.

Rs

8 10 12 14 16 18 20 22 24 26 28

P sa

60

80

100

120

140

uncontrolled controlled approx controlled

Rs

8 10 12 14 16 18 20 22 24 26 28

Q

4

6

8

10

12

14

Rs

8 10 12 14 16 18 20 22 24 26 28

F

50

100

150

200

V0

3 3.5 4 4.5 5 5.5 6 6.5 7P sa

60

80

100

120

uncontrolled controlled approx controlled

V0

3 3.5 4 4.5 5 5.5 6 6.5 7

Q

4

5

6

7

V0

3 3.5 4 4.5 5 5.5 6 6.5 7

F

60

80

100

120

140

160

Figure 5.27: The response of the controlled and uncontrolled circulation model for varying Rs (as duringexercise) and V0 (as for blood loss).

5.2 Dynamic Model

To make the model dynamic, we allow vessels to (temporarily) experience differences be-tween inflow and outflow rates. This causes a change in volume,

dV

dt= Qin −Qout. (5.86)

55

Page 57: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Before studying the entire dynamic circulatory system (as in the computer lab), we consideronly the left side of the heart connected to the systemic arteries. We will presently assumethat the pressure in the left atrium is known and solve of the pressures and volumes in theleft ventricle and systemic arteries. Critically to the operation of the circulatory systemare the values. The left heart has two valves: the inflow mitral (Mi) valve and the outflowaortic (Ao) valve. We model the valves are resistance vessels. The variables involved atdisplayed in Fig. 5.28.

Figure 5.28: A diagram of the variables involved in the arterial pulse. Source: Modeling and Simulationin Medicine and the Life Sciences by Frank C. Hoppensteadt and Charles Peskin (2nd ed.) ISBN: 978-0387215716

The volume change and compliance relations for the left ventricle and systemic arteriesare

dVLV

dt= QMi −QAo, (5.87)

dVSA

dt= QAo −QS, (5.88)

VLV = (VLV)d + CLVPLV, (5.89)

VSA = (VSA)d + CSAPSA. (5.90)

56

Page 58: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

Recall that CLV is a given function of time. The flows are given as

QMi = SMiPLA − PLV

RMi, (5.91)

QAo = SAoPLV − PSA

RAo, (5.92)

QS =PS

RS. (5.93)

The variables SMi and SAo indicate whether the values are open or not. To ensure that theflow is one directional, if PLA > PLV then SMi = 1 and SMi = 0 otherwise. If PLV > PSA

then SAo = 1 and SAo = 0 otherwise.

Rearranging the equations as differential equations for the pressures, we obtain

d

dt(CLVPLV) =

SMi(PLA − PLV)

RMi− SAo(PLV − PSA)

RAo, (5.94)

CSAd

dtPSA =

SAo(PLV − PSA)

RAo− PSA

Rs. (5.95)

These differential equations might at first glance look linear, but since SMi and SAo dependon PLV and PSA, they are non-linear. Also note that they are non-autonomous since CLV

is a given function of time.

The differential equations Eq. (5.94) and Eq. (5.95) change continuously, but not smoothlyas the valves change states. An adaptive scheme will refine the stepsize at these times.Depending on the scheme, artifactual numerical oscillations can occur near the times ofvalve closing or opening.

Figure 5.29 shows the numerically computed solution to Eq. (5.94) and Eq. (5.95) usingMatlab’s ode23s. There are three parts of the periodic solution. 1) Both valves areclosed. PSA exponentially decays towards zero with time constant CSARs while CLVPLV

is constant. 2) The mitral valve is open and the aortic valve is closed. PSA continues todecay exponentially and PLV evolves independently of PSA. 3) The mitral valve is closedand the aortic valve is open. The two pressures are nearly equal (with the left ventriclepressure slightly larger). This slight difference nonetheless drives a significant flow sinceRAo is small.

The behavior of the right heart is similar to that of the left heart. In the computer lab wewill connect the two sides of the heart with the rest of the circulatory system.

57

Page 59: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

0 0.5 1 1.5 2 2.5 3closed

openSMi

SAo

0 0.5 1 1.5 2 2.5 3time (sec)

0

20

40

60

80

100

120

140pr

essu

re (m

mH

g)PLV

PSA

Figure 5.29: A numerically computed solution to Eq. (5.94) and Eq. (5.95).

5.3 Computer Lab: Computing the Power of the Heart

5.3.1 Given Aortic Flow

1. Run sa.m, which will produce one figure showing the specified flow through the aorticvalve and the resulting pressure in the systemic arteries. The flow through the aorticvalve is given QAo(t) and the pressure in the systemic arteries is updated on eachusing timestep using backward Euler (in Psa new) for the differential equation beingsolved is

CsadPSA

dt= QAo(t)−

PSA

Rs. (5.96)

This is Eq. (5.95) with QAo(t) specified.

2. Trace through the code to find out where the figure is generated. Label the x and yaxes (using xlabel() and ylabel()) of each of the panels in each of the figures.

3. Modify the code to plot only one period (from the end of the simulation) and use aplot style ‘-o’ so that we can see the points.

4. Adjust (manually) the parameter Csa in the file in sa.m so that systemic bloodpressure has roughly a maximum of 120mmHg and minimum 80mmHg.

5. Change dt so that it is half the size. Modify the code so that the output from the

58

Page 60: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

next simulation is shown on the same figure as before in a new color. You will haveto remove clf and add hold all.

6. Reduce dt by another factor of 2 three more times. You will have a total of fivecurves. What is happening to Psa(t) as you reduce dt? What is happening to QAo(t)as you reduce dt? You may need to zoom in.

7. The solution to Eq. (5.96) is

Psa(t+ ∆t) = Psa(t) exp

(− ∆t

RsCsa

)+

1

Csa

∫ t+∆t

tQAo(τ) exp

(− t+ ∆t− τ

RsCsa

)dτ.

(5.97)Use this formula and integral to produce a more accurate update of Psa. Write afunction Psa new alt that you call instead of Psa new. You will need to call QAo now.

5.3.2 Dynamic Circulation

8. Run circ.m, which will produce four figures. This program simulates the dynamicversion of the full circulation model.

9. Trace through the code to find out where the figures are generated. Label the x andy axes (using xlabel() and ylabel()) of each of the panels in each of the figures.For the plots with more than one graph shown, provide a legend using the legend()

command.

10. In in circ.m set CHECK=0 to avoid some of the copious output. The parametersshould still be displayed.

11. Modify the code to plot only one period (from the end of the simulation) and tosimulate for twice the time.

12. Adjust (manually) the parameters Csa and Cpa in the file in circ.m so that systemicblood pressure p(isa) has roughly a maximum of 120mmHg and the pulmonaryblood pressure p(ipa) has roughly a maximum of 25mmHg. The minimum values,which should be around 80mmHg and 8mmHg, will be off. This is in part due to ourneglecting the “dead” volume of the compliance vessels. Continue to use these newvalues for Csa and Cpa.

13. Write a Matlab function that computes the work done by a pressure-volume loop.Some background is described here. Start with the template for the function provided(calcWork.m). Note that you are making an approximation that gets better as dt ismade smaller. Express the work in units of Joules (J). Remember 1000L = 1m3 and1mmHg = 133.3Pa = 133.3N/m2.

59

Page 61: Mathematical Modeling in Biological Systems Summer …stinch/SJTU/notes.pdf ·  · 2016-06-10lecture topic is accompanied with computer lab ... and n(t) and are known as gating variables

14. For resting (nominal) conditions, answer the following questions. Does the left sideor the right side of the heart do more work? What is the power consumption ofthe heart? Note that you have calculated the work per beat - use the heart rate todetermine the work rate (power). Compare your value to the various values listedhere.

5.3.3 Additional Exercises

Only attempt if you have additional time during the lab or become really interested in thiscirculation model.

15. Modify the dynamic circulation program to account for the thoracic cavity. Theheart and lungs are contained in this cavity, which has a slightly lower pressure thanthe atmosphere. You will have an additional parameter (Pthorax). The pressure inpulmonary arteries, Ppa, should be replaced with Ppa−Pthorax. As should the pressurein the pulmonary ventricles Ppv, the left ventricle Plv, and the right centricle Prv. Thisshould not be done for the pressures in the systemic arteries Psa and the systemicveins Psv since those vessels are outside of the thoracic cavity.

16. Study the performance of the heart as Pthorax is varied. Create a plot of work done(by the heart) per beat vs. Pthorax. Each point on the plot will require a separatesimulation. A reasonable (normal) value for Pthorax is -4mmHg. During open heartsurgery when the thorax is open to the air (so that Pthorax = 0), does the heart have towork more or less hard? Could stress on the heart be reduced by pressurizing (eitherincrease or decrease the room pressure relative to the atmosphere) the operatingroom?

60