Homework 5: Love in the time of Hodgkin

I NTRODUCTION TO T HEORETICAL N EUROSCIENCE , S PRING 2015
Homework 5
Love in the time of Hodgkin-Huxley
Due 2pm, March 5, 2015
Romeo & Juliet: A (dynamical systems) love story
In this problem we will study a model of the star-crossed lovers—in an alternate, less fatal universe. Our simple model, due to the mathematician Steven H. Strogatz, has two variables whose
behavior we would like to determine as a function of time:
R(t ) = Romeo’s feelings toward Juliet at time t ,
J (t ) = Juliet’s feelings toward Romeo at time t .
When R(t ) > 0, Romeo loves Juliet; when R(t ) < 0, Romeo hates Juliet; and when R(t ) = 0, Romeo
is indifferent to Juliet. J (t ) similarly represents Juliet’s feelings toward Romeo.
1. What system of differential equations for R(t ) and J (t ) describes the situation in which Romeo
and Juliet’s feelings toward each other remain constant over time? (“O, swear not by the
moon, the inconstant moon.”)
2. What system of differential equations for R(t ) and J (t ) describes the situation in which Romeo’s
love for Juliet is constantly increasing while Juliet’s love for Romeo is constantly decreasing?
3. Suppose now that Romeo loves Juliet, but unfortunately Juliet is a fickle lover: the more
Romeo loves her, the more Juliet wants to run away and hide. But when Romeo gets discouraged and backs off, Juliet begins to find him strangely attractive. Romeo, on the other
1
hand, tends to echo Juliet’s feelings: he warms up when Juliet loves him, and grows cold when
Juliet hates him.
a) What is a simple system of differential equations for R(t ) and J (t ) that describes the
above situation, and what is the fixed point of this system, i.e., at what value of J and R
do their values not change in time? What interpretation does this point have?
b) Write a program that uses Euler’s method with ∆t = 0.0001 to simulate the system from
part (a) for about T = 10 (our time units are arbitrary here). Start with the initial conditions R(0) = 0, J (0) = J 0 , using J 0 = 1, 2, 3. Create a plot showing R(t ) and J (t ) for J 0 = 1,
then produce a plot showing R vs. J for all three starting conditions as representative
trajectories in the R-J plane (that’s R(t ) on the x-axis and J (t ) on the y-axis). What do
the solutions tell you about Romeo and Juliet’s fate as a couple? In this type of situation
the fixed point at the origin is called a center.
Hint: This is the first time we’ve had to simulate two variables simultaneously, but the
idea is the same as before. There are now two righthand sides, so we need a function
that returns both:
def f (R , J ):
dRdt = J
dJdt = -R
return dRdt , dJdt
Similarly, the loop that solves the differential equation now looks like (assuming the
arrays R and J have been initialized as before)
R [0] = 0
J [0] = J0
for i in xrange (1 , len ( t )):
dRdt , dJdt = f ( R [i -1] , J [i -1])
R [ i ] = R [i -1] + dRdt * dt
J [ i ] = J [i -1] + dJdt * dt
As in the previous homework, since you have to solve the system for several values of
J0, it is best to wrap the whole thing in a function that takes J0 as an argument.
You already know how to plot R(t ) and J (t ) as functions of time (include a legend!), and
it is no different plotting R(t ) vs. J (t ). However, since time is not shown in these plots
it is difficult to know in what direction things are moving. So it’s nice to include a little
arrow, and one trick for doing so is
u = 0
plt . arrow ( R [ u ] , J [ u ] , R [ u +1] - R [ u ] , J [ u +1] - J [ u ] ,
head_width =0.2 , head_length =0.25 , fc = ’ black ’ , ec = ’ black ’)
Here u indicates where along the plot you would like put the arrow, and is set to the
beginning (in the simplified Hodgkin-Huxley model later you may want to set this to
2
something like u = len(t)//4). Unfortunately, specifying the size of the arrow is a
bit unintuitive and you will have to play with head_width and head_length for each
graph to make the arrowhead look nice. Meanwhile, fc and ec are face color and edge
color, respectively, and should of course be changed to match the color of your lines.
4. Cautious lovers. A more general model of Romeo and Juliet should of course include the
effects of their own feelings:
dR
= aR + b J ,
dt
dJ
= cR + d J .
dt
For instance, a > 0, b > 0 describes the case where Romeo is an “eager beaver”: he gets excited by Juliet’s love for him, and is further spurred on by his own affectionate feelings for
her.
Here we will focus on what is probably closer to modern practice: a < 0, b > 0, or the “cautious lover.” Can two identically cautious lovers get together? That is, what happens when
Romeo and Juliet’s relationship is governed by the following system of equations?
dR
= −R + b J ,
dt
dJ
= bR − J .
dt
(1)
The negative term represents cautiousness (each person tries to avoid throwing themselves
at the other) and b is a measure of responsiveness (they both get excited by the other’s advances).
a) What is the fixed point of the system in Eq. (1)?
b) Write a program that uses Euler’s method to solve for the case where b = 1/2, using various initial conditions R(0) = R 0 , J (0) = J 0 (be sure to cover all quadrants, say -3, -2, -1,
1, 2, 3 for each). This will require a double for-loop. Include a figure with representative trajectories in the R-J plane. What interpretation can you give for the result? What
property does the point R = J = 0 have? In this type of situation the fixed point is called
a stable node.
c) Write a program that uses Euler’s method to solve for the case where b = 10, using various initial conditions R(0) = R 0 , J (0) = J 0 (again, be sure to cover all quadrants). Include
a figure with representative trajectories in the R-J plane. What interpretation can you
give for the result? In this type of situation the fixed point at the origin is called a saddle
point.
Hint: In this problem some of the solutions grow without bound very quickly, so you’ll
have to be careful with the total integration time. For each initial condition, start with
3
something small, say T = 0.05, then increase the range for different starting points until
you get a reasonably full picture of the trajectory.
A simplified Hodgkin-Huxley model
5. In this problem we consider the following, “simplified” form of the Hodgkin-Huxley equations:
dV
1
= −(a + bV + cV 2 )(V − E Na ) − eR(V − E K ) + I ext ,
dt
g
dR
τR
= −R + pV + q.
dt
τV
(2)
Here V (t ) is the membrane potential and the dimensionless R(t ) represents a recovery variable that combines the effects of the closing of Na+ channels and opening of K+ channels.
Note that R does not stand for resistance.
The two-dimensional equations above are less complicated than they appear at first sight.
First, because there are two variables, there are two time constants, τV = 4 ms and τR = 5 ms.
E Na = 65 mV and E K = −85 mV are the reversal potentials for Na+ and K+ , respectively. We set
the conductance to g = 1 nS; thus currents are now in pA to keep the membrane potential in
mV. The remaining constants are
a = 17.8,
b = 0.48 (mV)−1 ,
c = 0.0032 (mV)−2 ,
e = 26,
p = 0.014 (mV)−1 ,
q = 1.
a) Use Euler’s method with a time step of ∆t = 0.02 ms to simulate the system in Eq. (2)
with I ext = 50 pA for 50 ms. Plot both V (t ) and R(t ); because the two variables have
very different scales, you will need to plot them separately, or look up how to use two
different axes (i.e., left and right axes) in the same plot. How is the trajectory of R(t )
related to that of V (t )? What is the firing rate of the neuron during this time?
Hint: In this model the spikes are generated “organically,” so there is no need for any
manual resets of the membrane potential. As a result, however, the old way of detecting
spikes will not quite work, because the spikes have finite width. You will instead want
to use something like the following:
4
if V [i -1] < Vth and V [ i ] >= Vth :
spiketimes . append ( t [ i ])
b) Plot the solution from part (a) in the phase plane with V (t ) on the x-axis and R(t ) on
the y-axis. What can you say about what the system is doing? This behavior is called a
limit cycle, and is the nonlinear analogue of the circular (and unrealistic, in biological
systems) orbits we saw for Romeo and Juliet.
c) Plot the f -I curve for currents from 0 to 200 pA, in 5 pA intervals. For this part make
sure you simulate the neuron for a long enough time, especially for low currents.
5