Testing the adapting exponential integrate and fire model in NEST (Brette and Gerstner Fig 2C)

Run this example as a Jupyter notebook:

See our guide for more information and troubleshooting.

This example tests the adaptive integrate and fire model (AdEx) according to Brette and Gerstner [1] reproduces Figure 2C of the paper. Note that Brette and Gerstner give the value for b in nA. To be consistent with the other parameters in the equations, b must be converted to pA (pico Ampere).


import matplotlib.pyplot as plt
import nest
import nest.voltage_trace


First we make sure that the resolution of the simulation is 0.1 ms. This is important, since the slop of the action potential is very steep.

nest.resolution = 0.1
neuron = nest.Create("aeif_cond_alpha")

a and b are parameters of the adex model. Their values come from the publication.

neuron.set(a=4.0, b=80.5)

Next we define the stimulus protocol. There are two DC generators, producing stimulus currents during two time-intervals.

dc = nest.Create("dc_generator", 2)
dc.set(amplitude=[500.0, 800.0], start=[0.0, 500.0], stop=[200.0, 1000.0])

We connect the DC generators.

nest.Connect(dc, neuron, "all_to_all")

And add a voltmeter to sample the membrane potentials from the neuron in intervals of 0.1 ms.

voltmeter = nest.Create("voltmeter", params={"interval": 0.1})
nest.Connect(voltmeter, neuron)

Finally, we simulate for 1000 ms and plot a voltage trace to produce the figure.


plt.axis([0, 1000, -80, -20])

Gallery generated by Sphinx-Gallery