.. 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 Click :ref:`here ` 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) ---------------------------------------------------------------------------------------------- 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:: default import nest import nest.voltage_trace import matplotlib.pyplot as plt 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:: default 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:: default neuron.set(V_peak=20., 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:: default 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:: default 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:: default 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:: default nest.Simulate(1000.0) nest.voltage_trace.from_device(voltmeter) plt.axis([0, 1000, -85, 0]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _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-python :download:`Download Python source code: brette_gerstner_fig_3d.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: brette_gerstner_fig_3d.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_