tau dV/dt = Vrest - V + Rm Ie(t)
V(t+)=Vreset when V(t-)=Vthresh
# integrate and fire
# here is the ODE
v'=(-v+vrest + rm*ie(t))/tau
init v=-65
#
# here is the reset condition - when v-vthreh=0 in the increasing
# direction, reset the voltage
global 1 v-vthresh {v=vreset}
# here is the stimulus
ie(t)=a0+a1*sin(w1*t)+a2*sin(w2*t)
# here are parameters
# voltage - mV time - msec current - nanoamp R - MOhm
par vrest=-65,vthresh=-50,vreset=-70,tau=15
par rm=10
# stimulus parameters
par a0=1.5,a1=.75,w1=.05,a2=.75,w2=.12345
# plot the stimulus
aux stim=rm*ie(t)-vrest
# set up simulation parameters
@ total=500,dt=.1
# set up plot parameters
@ nplot=2,xlo=0,xhi=500,ylo=-75,yhi=-35, yp2=stim
# extend the maximal storage - XPP stores only 5000 pts by default
@ maxstor=20000
done
Run this file and look at the output. You will see that the I&F model tends to fire on the upstroke of the stimulus rather than the peak. Try a pure sine stimulus: change a1=1.5,a2=0 and vary the frequency w1 Count the spikes in a 1000 msec stimulation for a variety of frequencies, say 2 > w1 > .01
The following is a similar file but this time the stimulus is low-pass filtered white noise iafnoise.ode
# integrate and fire with noise
# here is the ODE
v'=(-v+vrest + rm*ie)/tau
init v=-65
#
# here is the reset condition - when v-vthreh=0 in the increasing
# direction, reset the voltage
global 1 v-vthresh {v=vreset}
# here is the stimulus
ie'=(-ie+a1*normal(0,1))*w1
# here are parameters
# voltage - mV time - msec current - nanoamp R - MOhm
par vrest=-65,vthresh=-50,vreset=-70,tau=15
par rm=10
# stimulus parameters
par a1=30,w1=.05
# plot the stimulus
aux stim=rm*ie+vrest
# set up simulation parameters
@ total=500,dt=.1,meth=euler,bound=1000
@ nplot=2,xlo=0,xhi=500,ylo=-75,yhi=-35
@ yp2=stim,maxstor=20000
done
The stimulus satisfies:
where w1 is the filter frequency and N(t) is delta-correlated noise with amplitude a1 . Try different values of w1. Whenever you have noise, you should use Euler's method. Here are some notes numerical integration of differential equations.
dg/dt = (-g + a delta(t))/taua
tau dV/dt = Vrest - V + Rm I(t) -g(V-EK)
dg/dt = (-g + a/gL delta(t))/taua
Each time the cell fires, g is incremented by dg=a/gL and decays with a time constant taua . Here is the XPP file iafadap.ode :
# iafadap.ode
v'=(vrest-v + rm*ie(t)-g*(v-ek))/tau
g'=-g/taua
init v=-65,g=0
# I increment adaptation whenever the spike fires -- g=g+dg
global 1 v-vthresh {v=vreset;g=g+dg}
# heav(t) is the step function
ie(t)=amp*heav(t-ton)*heav(toff-t)
par vrest=-65,vthresh=-50,vreset=-65,tau=15,rm=10
par ek=-85,dg=.1,taua=100
par amp=4,ton=50,toff=200
aux stim=rm*ie(t)+vrest
@ total=500,dt=.1,maxstor=10000
@ xhi=500,yhi=-45,ylo=-85,nplot=2,yp2=stim
done
Try this. Then set the adaptation to zero dg=0 and see the difference. Try different parameters such as the magnitude of the stimulus, amp and the time constant of adaptation taua of the degree of adaptation dg .
tau dV/dt = (Vrest - V + Rm I -g(V-EK))P
dg/dt = -Pg/taua
V(0)=Vreset
V(1)=Vthresh
g(0)=g(1)+dg
Here is the XPP file iafrbvp.ode if you want to try it. Use the Bndryval Show option to see it solve the BVP. Change parameters a litte at a time and resolve it if you want.
Note that a is a positive parameter with dimensions of 1/volt that governs the "excitability" of the model. If V exceeds the threshold, Vthr, then the solutions to this equation blow up in a finite amount of time. This is the spike. The voltage is then reset to -infinity. If I(t) is constant and large enough, the neuron will blow up periodically. I will leav it as an exercise for you to find the period:
Since this is really not possible to handle numerically (since infinity is not a computer-friendly concept), we can make a change of variables to obtain the so-called "theta" model. Let
where
b = (Vthr-Vrest)/2
Then x(t) satisfies:
Find parameters in the theta model which match this assuming that R=50 MOhm and tau=30 msec. The only free parameters are a,b. Note the firing rate in the figure is in Hz but the FI curve given in the formula above is in spikes per millisecond!