644 Homework 1

In this assignment, you will experiment with XPPAUT (Download), to implement a simple integrate-and-fire neuron model.

1. XPPAUT Basics

Here's a working script for an integrate-and-fire neuron, following the conventions used in Dayan and Abbott (2001) chapter 5, section 5.4. Save this file inf1.ode and run xppaut with the following command:

	./xppaut inf1.ode
or give the full path (on CS unix: you need X11 access):
	/user/choe/pub/xppaut/xppaut inf1.ode

Integrating
Once you have a window like below (without the plots),

	press [i] and [g] in sequence, 
and you'll see the result. There are two traces, one is the membrane voltage (white), and the other is the steady-state voltage (red). The input was a step input of amplitude 2.0nA, duration 50ms. Note that your threshold should be below the steady-state in order to make the neuron to fire. When the input turns off (I=0), the steady state tends to the resting membrane potential.

Quitting
To quit from the program,

	press [f] and [q] and [y] in sequence.

Clearning the plot
To clear the plot,

	press [e].

Interacting with XPPAUT: Parameter adjustment
There are several buttons on top of the xppaut window:

Click on the [Param] button and you'll be able to change simulation parameters interactively.

For example, change Vthresh from -50 to -40, and click [Ok] in the parameters window. Then go to the main window and press [e] to clear the plot and then [i] [g] to integrate with the new parameter. You will see that the neuron does not fire this time, since the steady state is below the threshold.

Interacting with XPPAUT: Data
Another useful button is the [Data] button, which allows you to view the actual numerical data for each dynamic variable, and save the whole thing into a text file.

You can see that there are three columns, each representing time, V, and Vinf. Clicking on [Write] (2nd row, 2nd column) will allow you to save the data to a file.

Change the filename to whatever you desire, and click [Ok] to save. You can then use your favorite plotting program to plot the data.

2. Programming XPPAUT

XPPAUT script
The complete file is shown below. There are five sections, parameters, input, model ODE, simulation configuration, and plotting. The comments below are self-explanatory, so take a careful look before you begin. The "#" character is used for comments, so you can selectively comment out and uncomment parts of the code (especially in section 2. Input) and press [i] [g]. There are three important lines:

  1. init V=-50

    This line sets the initial value of the variable V. Without this, [i] [g] won't work.

  2. dV/dt=((Erest-V)+R*I)/tau

    This is the heart of the simulation. Note that tau was moved to the right.

  3. global 1 (V-Vthresh) {V=Erest}

    This is the spike generation mechanism. When (V-Vthresh) becomes zero, the expression in the braces {V=Erest} gets evaluated.

All the rest are book-keeping stuff or plotting-related.
############################################################################
# Integrate-and-Fire model
# From Dayan and Abbott (2001), section 5.4.
# Parameters are from Fig 5.5.
#
# Written in xppaut by Yoonsuck Choe http://faculty.cs.tamu.edu/choe
# Tue Feb 20 09:36:35 CST 2007
############################################################################

#########################################
# 1. parameters
#########################################

# capacitance: uF
param C=1.0

# resistance : Mohm
param R=10.0

# spike threshold: mV
param Vthresh=-50

# resting membrane potential: mV
param Erest=-65

########################################
# 2. Input: try commenting out different options below.
########################################
#
# 1. constant current: nA
#  I=2.0

# 2. A sinusoidal input (function of t): nA
# I=sin(t/5.0)+2.0

# 3. A step input (heav is the Heaviside step function): nA
  I=heav(-t+50)*2.0

# time constant = R*C: ms
# - to use an expression, you need to define this as a variable rather
#   than a parameter (no "param")
tau=R*C

#########################################
# 3. Model ODE
#########################################
init V=-50

dV/dt=((Erest-V)+R*I)/tau

# reset condition: when (V-theta)=0, the part in {...} gets evaluated.
global 1 (V-Vthresh) {V=Erest}

#########################################
# 4. Simulation configuration
#########################################

# simulation duration
@ total=150

########################################
# 5. Plotting
########################################

# auxiliary variables for plotting
#
# This plots V_infinity, the steady state voltage given a constant input I
aux Vinf=Erest+R*I

# number of plots
@ nplot=2

# designate variables to plot (define yp2, yp3, etc. for 2nd, 3rd plots, etc.)
@ yp1=V
@ yp2=Vinf

# plotting range
@ xlo=0,xhi=150
@ ylo=-75.0,yhi=-10

done

3. Assignment

For this assignment, you will conduct three tasks:
  1. Adjusting parameters in inf1.ode to study the behavior of integrate-and-fire neurons.
  2. Adding Spike-Rate-Adaptation to inf1.ode.
  3. Implementing coupled integrate-and-fire neurons.

3.1 Effect of various parameters on INF behavior

  1. With the step input, reduce R to 8.5, and integrate. (1) for this, what becomes of the time constant tau? (2) what happens to the firing rate? (3) why? (4) What becomes of the steady-state voltage with fixed input I=2.0? Derive it analytically and compare with the computational results.
  2. With the step input, restore R to 10.0, and reduce C to 0.85, and integrate. (1) what becomes of the time constant tau? (2) what happens to the firing rate? (3) why? and why is it different from case 1 above even when the time constant is the same? (4) What becomes of the steady-state voltage with fixed input I=2.0? Derive it analytically and compare with the computational results.
  3. Devise other experiments and make predictions, and run the experiment. For example, you can lower the threshold, or increase of decrease the current I, etc. [Optional]

3.2 Adding Spike-Rate-Adaptation to inf1.ode

Add spike-rate adaptation term to inf1.ode and run experiment similar to Figure 5.6. Does the additional term give you the desired effect? Use equation 5.13 and 5.14. Report your results.

Use these parameters, which are not explicitly stated in the textbook: C=0.3, R_m=90.0, r_m=45.0, Delta_gsra=0.06. You may also use a constant input I=2.0. Don't forget to do {gsra = gsra+Delta_gsra} when a spike occurs (use the global statement).

Run the following experiments and report your results. First, predict what will happen before you run the experiment, and give a reason why you think it will be that way. Then run it, confirming/disproving your insight. Report what you learned.

  1. Decrease E_K to -90. Compare to E_K=-70.
  2. Increase E_K to -65. Compare to E_K=-70.
  3. Reset E_K to -70, and set tau_g to 50. Compare to tau_g=100.

3.3 Implementing coupled integrate-and-fire neurons

Implement coupled integrate-and-fire neurons shown in Figure 5.20. You may have to use equation 5.43 and equation 5.35 (turn this into ode: see Ermentrout (2002), chapter 3 [PDF]).

Try these experiments and report the results:

  1. The only quantity that is not defined in the textbook is tau_m: Find tau_m that fits the data shown in Figure 5.20. (Actually, tau_m is given in Figure 5.20.)
  2. With the same setup as above, try different initial membrane voltage for the two neurons. For example, -70 mV and -65 mV, etc. Does the behavior change (e.g., no longer synchronized or desynchronized) for different initial conditions? (Make the initial value a parameter so that you can easily control in your xppaut session.)
  3. The PSP time constant tau_s is fairly slow (10ms). Try reducing it or increasing to see if different synchronization behavior results. (Make it a parameter and dynamically changing it in xpp's param window.) Try successively halving or doubling the time constant.

Thu Jan 28 16:29:04 CST 2010 Yoonsuck Choe