You should find the Single Neuron Equation assignment as a pdf on the course calendar at http://geofhagopian.net/m2c/M2C-S18/M2C-S18-Syllabus.pdf (under week 4 on the calendar). Use this space to start a collaboration with a partner on CoCalc, if you like. You can also use other means to complete the project.
Single Neuron Equation
Background theory
Biologists are currently applying mathematical modeling to a wide range of problems. One such problem involves
the function of nerve cells (neurons) in the brain. These cells generate electrical impulses that move along their
axons, affecting the activity of neighboring cells. Even for a single neuron, a complete model using what is currently
known about its firing mechanism may take several equations, Since the human brain conatains on the order of neurons,
an exact model is not feasible. In this application you will be looking at a very simplified model for an isolated population
of neurons all having similar properties.
Let denote the percent of neurons firing at time , normalized to be between 0 (low activity) and 1 (high activity).
A simple model representing the change of activity level in the population is given by the differential equation
where is the level of activity coming from the cells external to the population, is a common threshold level for
cells in the set, and is a response function that models the change in activity level due to a given input.
We will use a standard “sigmoidal” response function .
The nonlinear function can be seen to increase monotonically from 0 to 1 as increases from to . It
is called a sigmoidal function because it has a sort of stylized S-shape. You may remember that solutions of the logistic growth
equation had this same shape.
<image=neuron01.png>
Find a formula for the derivative of , and show that it satisfies the identity
*Hint: Mostly algebra.*
<image="neuron01.png">
Draw a graph of for and . Where is the slope a maximum? Is it the same in each case?
Explain how the graph of differs from the graph of .
Because the value of is always between 0 and 1, if the slope is negative and
if it is positive. This means that any equilibrium solutions, that is, values of where
must lie between 0 and 1. It also implies that the arrows on the phase line are always pointing down above and
up below
Figure 2.27 shows the graphs of (the dashed line) and the response function
for and . It can be seen that for small there will be one equilibrium solution near and
for large there will be one equilibrium near . This seems reasonable since a high threshold means it
takes a lot of input to produce very much activity. For in the middle range, however, there can be three
equilibrium solutions.
*In Sage, use commands like
* `z,S=var('z S')`
`p0=plot()`
`p1=plot()`
`show(p0+p1)`
(z-Theta) shifts the graph left or right
Slope is maximum at x = 0 for all values of a
3) Draw phase lines for with
Label each equilibrium point as a sink, source or node. You will need a numerical equation solver to find the
equilibrium values; that is, the value of where . As a check,
the three equilibria for are and
*Hint To get some idea of where to hunt for what, it's helpful to have a graph of the seven curves for *
. In Sage,
g=Graphics()
x,y=var('x y')
p=plot(x,(x,-.2,1.2))
g=g+p
for i in range(4,11):
p=plot(1/(1+e^(-10*(x+0.2-i/10))),(x,-0.2,1.2))
g=g+p
show(g)
To find the numerical approximations in Sage, you can use the find_root
command.
Hint: The easiest way to get the bifurcation curve is just to connect the dots by hand with a smooth curve.
Make a bifurcation diagram by putting the seven phase lines from problem (3) in a row and joining the equilibrium points.
From the bifurcation diagram, estimate the two bifurcation values of where the number of equilibrium points
changes from one to three, and then from three back to one.
*Hint: I think it’s better to use the figure showing the functions *
superimposed on
Find the two bifurcation values of analytically. You will need to solve two simultaneous equations obtained
by using the fact that at a bifurcation value of the curves and have a point
of tangency. At this point the -values are equal and the slopes are also equal.
Hint: Teasing a numerical solution to a system of non-linear equations out of Sage is not straight-forward.
Wolfram Alpha chugs away at it for a while and then gives up. You may resort to guess and check...we already know about where
to look, after all. There is a clever way, I think.
Use your computer algebra system to draw a slope field for the ode with and .
Let vary from 0 to 20. Use initial values and . Describe what happens to the
activity as .
Hint: In order to accomplish this in Sage, it's helpful to write the code for the building the numerical solutions.
The code below was adapted from the Mendel University (located in Brno, Czech Republic) site http://user.mendelu.cz/marik/sage/dr.pdf.
In Czeck, "krok" must mean something like "step size":
t,x=var('t x')
def rk(fnc,t0,x0,krok,t1):
g=fast_float(fnc,'t x','x')
n=int((1.0)*(t1-t0)/krok)
t00=t0; x00=x0
soln=[[t00,x00]]
for i in range(n+1):
m1=g(t00,x00)
m2=g(t00+krok/2,x00+m1*krok/2)
x00=x00+krok*m2
t00=t00+krok
soln.append([t00,x00])
return soln
(t_min,t_max,x_min,x_max)=(0,20,0,1)
f(t,x)=-x+1/(1+e^(-10*(x+0.2-0.7)))
A=plot_slope_field(f(t,x),(t, t_min, t_max), (x, x_min, x_max))
B=list_plot(rk(f(t,x), 0, 0.1, 0.1, t_max), plotjoined=True)
C=list_plot(rk(f(t,x), 0, 0.3, 0.1, t_max), plotjoined=True)
D=list_plot(rk(f(t,x), 0, 0.5, 0.1, t_max), plotjoined=True)
E=list_plot(rk(f(t,x), 0, 0.7, 0.1, t_max), plotjoined=True)
F=list_plot(rk(f(t,x), 0, 0.9, 0.1, t_max), plotjoined=True)
show(A+B+C+D+E+F,ymin=x_min,ymax=x_max,xmin=t_min,xmax=t_max)
This is somewhat shy of rk4
, but it seems to work well enough and we get the slope field A on which we can use list_plot
to superimpose the 5 solutions.
Redo problem (7) with periodic input . With this time varying input the equation
is no longer autonomous. Explain carefully how the activity differs from that described in (7). Do you think
there is a periodic solution separating the two types of solutions in the periodic case? This is an interesting
problem and it might be a good time to look at the paper “Qualitative tools for studying periodic solutions
and bifurcations as applied to the periodically harvested logistic equation” by Diego Benardete, V.W.Noonburg,
and B. Pollina, Amer. Math. Monthy, vol 115, 202-219(2008). It discusses, in a very readable way, how one
goes about determining the answer to such a question.
*HINT: At first it may seem simple enough to replace the 0.2 in the exponent of with the sinusoid in Sage,
but as you may have come to expect, you get a cascade of red error messages. This caused me to look at the help file
for the fast_flot()
function and modify it's call as shown below:
t,x=var('t x')
(t_min, t_max, x_min,x_max)=(0,20,0,1)
def rk(fnc,t0,x0,krok,t1):
g=fast_float(fnc,'t','x') #,'x')
n=int((1.0)*(t1-t0)/krok)
t00=t0; x00=x0
soln=[[t00,x00]]
for i in range(n+1):
m1=g(t00,x00)
m2=g(t00+krok/2,x00+m1*krok/2)
x00=x00+krok*m2
t00=t00+krok
soln.append([t00,x00])
return soln
f(t,x)=-x+1/(1+e^(-10*(x+0.2*(1+sin(t))-0.7)))
A=plot_slope_field(f(t,x),(t, t_min, t_max), (x, x_min, x_max))
B=list_plot(rk(f(t,x), 0, 0.1, 0.1, t_max), plotjoined=True)
C=list_plot(rk(f(t,x), 0, 0.3, 0.1, t_max), plotjoined=True)
D=list_plot(rk(f(t,x), 0, 0.5, 0.1, t_max), plotjoined=True)
E=list_plot(rk(f(t,x), 0, 0.7, 0.1, t_max), plotjoined=True)
F=list_plot(rk(f(t,x), 0, 0.9, 0.1, t_max), plotjoined=True)
show(A+B+C+D+E+F,ymin=x_min,ymax=x_max,xmin=t_min,xmax=t_max)
This should work!