.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/brette_gerstner_fig_3d.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_brette_gerstner_fig_3d.py: Testing the adapting exponential integrate and fire model in NEST (Brette and Gerstner Fig 3D) ---------------------------------------------------------------------------------------------- .. only:: html ---- Run this example as a Jupyter notebook: .. card:: :width: 25% :margin: 2 :text-align: center :link: https://lab.ebrains.eu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fnest%2Fnest-simulator-examples&urlpath=lab%2Ftree%2Fnest-simulator-examples%2Fnotebooks%2Fnotebooks%2Fbrette_gerstner_fig_3d.ipynb&branch=main :link-alt: JupyterHub service .. image:: https://nest-simulator.org/TryItOnEBRAINS.png .. grid:: 1 1 1 1 :padding: 0 0 2 0 .. grid-item:: :class: sd-text-muted :margin: 0 0 3 0 :padding: 0 0 3 0 :columns: 4 See :ref:`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 3D 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). References ~~~~~~~~~~ .. [1] Brette R and Gerstner W (2005). Adaptive exponential integrate-and-fire model as an effective description of neuronal activity J. Neurophysiology. https://doi.org/10.1152/jn.00686.2005 .. GENERATED FROM PYTHON SOURCE LINES 40-47 .. code-block:: Python import matplotlib.pyplot as plt import nest import nest.voltage_trace nest.ResetKernel() .. GENERATED FROM PYTHON SOURCE LINES 48-50 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. .. GENERATED FROM PYTHON SOURCE LINES 50-54 .. code-block:: Python nest.resolution = 0.1 neuron = nest.Create("aeif_cond_exp") .. GENERATED FROM PYTHON SOURCE LINES 55-56 Set the parameters of the neuron according to the paper. .. GENERATED FROM PYTHON SOURCE LINES 56-59 .. code-block:: Python neuron.set(V_peak=20.0, E_L=-60.0, a=80.0, b=80.5, tau_w=720.0) .. GENERATED FROM PYTHON SOURCE LINES 60-61 Create and configure the stimulus which is a step current. .. GENERATED FROM PYTHON SOURCE LINES 61-66 .. code-block:: Python dc = nest.Create("dc_generator") dc.set(amplitude=-800.0, start=0.0, stop=400.0) .. GENERATED FROM PYTHON SOURCE LINES 67-68 We connect the DC generators. .. GENERATED FROM PYTHON SOURCE LINES 68-71 .. code-block:: Python nest.Connect(dc, neuron, "all_to_all") .. GENERATED FROM PYTHON SOURCE LINES 72-74 And add a ``voltmeter`` to sample the membrane potentials from the neuron in intervals of 0.1 ms. .. GENERATED FROM PYTHON SOURCE LINES 74-78 .. code-block:: Python voltmeter = nest.Create("voltmeter", params={"interval": 0.1}) nest.Connect(voltmeter, neuron) .. GENERATED FROM PYTHON SOURCE LINES 79-81 Finally, we simulate for 1000 ms and plot a voltage trace to produce the figure. .. GENERATED FROM PYTHON SOURCE LINES 81-87 .. code-block:: Python nest.Simulate(1000.0) nest.voltage_trace.from_device(voltmeter) plt.axis([0, 1000, -85, 0]) plt.show() .. _sphx_glr_download_auto_examples_brette_gerstner_fig_3d.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: brette_gerstner_fig_3d.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: brette_gerstner_fig_3d.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_