From 98f2a7aa211dadbcfdf5f896915598678dbd5c5a Mon Sep 17 00:00:00 2001 From: ackurth Date: Thu, 1 Feb 2024 10:33:01 +0100 Subject: [PATCH 01/12] Add model documentation for Co-authored-by: jasperalbers --- models/iaf_psc_delta.h | 122 ++++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 37 deletions(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 6a5be45aa3..d99b6dbbb5 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -33,18 +33,86 @@ namespace nest { - +// Disable clang-formatting for documentation due to over-wide table. +// clang-format off /* BeginUserDocs: neuron, integrate-and-fire, current-based Short description +++++++++++++++++ -Current-based leaky integrate-and-fire neuron model with delta-shaped -postsynaptic currents +Leaky integrate-and-fire model with delta-shaped input currents Description +++++++++++ +``iaf_psc_delta`` is a leaky integrate-and-fire neuron model with + +* a hard threshold, +* a fixed refractory period, +* no adaptation mechanisms, +* :math:`\delta`-shaped synaptic input currents. + +Membrane potential evolution, spike emission, and refractoriness +................................................................ + +The membrane potential evolves according to + +.. math:: + + \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} + +where the synaptic input current :math:`I_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is +a constant input current set as a model parameter. + +A spike is emitted at time step :math:`t^*=t_{k+1}` if + +.. math:: + + V_\text{m}(t_k) < V_{th} \quad\text{and}\quad V_\text{m}(t_{k+1})\geq V_\text{th} \;. + +Subsequently, + +.. math:: + + V_\text{m}(t) = V_{\text{reset}} \quad\text{for}\quad t^* \leq t < t^* + t_{\text{ref}} \;, + +that is, the membrane potential is clamped to :math:`V_{\text{reset}}` during the refractory period. + +Synaptic input +.............. + +The synaptic input current handles excitatory and an inhibitory inputs: + +.. math:: + + I_{\text{syn}}(t) = \sum_{j} w_j \sum_k i_{\text{syn}}(t-t_j^k-d_j) \;, + +where :math:`j` indexes either excitatory (:math:`w_j > 0`) +or inhibitory (:math:`w_j < 0`) presynaptic neurons, +:math:`k` indexes the spike times of neuron :math:`j`, and :math:`d_j` +is the delay from neuron :math:`j`. + +The individual post-synaptic currents (PSCs) are given by + +.. math:: + + i_{\text{syn}}(t) = \delta(t) + +where :math:`\delta` is the Dirac delta distribution. + +As a consequence, the total charge :math:`q` transferred by a single PSC is + +.. math:: + + q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = 1 \;. + +By default, :math:`V_\text{m}` is not bounded from below. To limit +hyperpolarization to biophysically plausible values, set parameter +:math:`V_{\text{min}}` as lower bound of :math:`V_\text{m}`. + + + + ``iaf_psc_delta`` is an implementation of a leaky integrate-and-fire model where the potential jumps on each spike arrival. @@ -57,45 +125,25 @@ spikes are added to the membrane potential at the end of the refractory period, dampened according to the interval between arrival and end of refractoriness. -The linear subthreshold dynamics is integrated by the Exact -Integration scheme [1]_. The neuron dynamics is solved on the time -grid given by the computation step size. Incoming as well as emitted -spikes are forced to that grid. - -An additional state variable and the corresponding differential -equation represents a piecewise constant external current. - -The general framework for the consistent formulation of systems with -neuron like dynamics interacting by point events is described in -[1]_. A flow chart can be found in [2]_. - -Critical tests for the formulation of the neuron model are the -comparisons of simulation results for different computation step -sizes. sli/testsuite/nest contains a number of such tests. - -The iaf_psc_delta is the standard model used to check the consistency -of the nest simulation kernel because it is at the same time complex -enough to exhibit non-trivial dynamics and simple enough compute -relevant measures analytically. - Parameters ++++++++++ The following parameters can be set in the status dictionary. -================= ======= ====================================================== - V_m mV Membrane potential - E_L mV Resting membrane potential - C_m pF Capacity of the membrane - tau_m ms Membrane time constant - t_ref ms Duration of refractory period - V_th mV Spike threshold - V_reset mV Reset potential of the membrane - I_e pA Constant input current - V_min mV Absolute lower value for the membrane potential - refractory_input boolean If true, do not discard input during - refractory period. Default: false -================= ======= ====================================================== +==================== ================== =============================== ================================================================================== +**Parameter** **Default** **Math equivalent** **Description** +==================== ================== =============================== ================================================================================== +``E_L`` -70 mV :math:`E_\text{L}` Resting membrane potential +``C_m`` 250 pF :math:`C_{\text{m}}` Capacity of the membrane +``tau_m`` 10 ms :math:`\tau_{\text{m}}` Membrane time constant +``t_ref`` 2 ms :math:`t_{\text{ref}}` Duration of refractory period +``V_th`` -55 mV :math:`V_{\text{th}}` Spike threshold +``V_reset`` -70 mV :math:`V_{\text{reset}}` Reset potential of the membrane +``I_e`` 0 pA :math:`I_\text{e}` Constant input current +``V_min`` :math:`-\infty` mV :math:`V_{\text{min}}` Absolute lower value for the membrane potential +``refractory_input`` ``False`` None If set to true, spikes arriving during refractory period are integrated afterwards +==================== ================== =============================== ================================================================================== + References ++++++++++ From 6346f2c9e794a0fa69592a578c82075b0b8051d9 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:59:27 +0100 Subject: [PATCH 02/12] Update models/iaf_psc_delta.h Co-authored-by: Hans Ekkehard Plesser --- models/iaf_psc_delta.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index d99b6dbbb5..44f5aad3fd 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -113,8 +113,6 @@ hyperpolarization to biophysically plausible values, set parameter -``iaf_psc_delta`` is an implementation of a leaky integrate-and-fire model -where the potential jumps on each spike arrival. The threshold crossing is followed by an absolute refractory period during which the membrane potential is clamped to the resting potential. From ff672095b71dc6db6e7f04d190a0ab76088ee138 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:59:41 +0100 Subject: [PATCH 03/12] Update models/iaf_psc_delta.h Co-authored-by: Hans Ekkehard Plesser --- models/iaf_psc_delta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 44f5aad3fd..da1dc40d29 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -139,7 +139,7 @@ The following parameters can be set in the status dictionary. ``V_reset`` -70 mV :math:`V_{\text{reset}}` Reset potential of the membrane ``I_e`` 0 pA :math:`I_\text{e}` Constant input current ``V_min`` :math:`-\infty` mV :math:`V_{\text{min}}` Absolute lower value for the membrane potential -``refractory_input`` ``False`` None If set to true, spikes arriving during refractory period are integrated afterwards +``refractory_input`` ``False`` None If set to True, spikes arriving during refractory period are integrated afterwards ==================== ================== =============================== ================================================================================== From 3d6628111dd6c77b26f0335ab57e705a98d2479d Mon Sep 17 00:00:00 2001 From: ackurth Date: Wed, 14 Feb 2024 10:22:37 +0100 Subject: [PATCH 04/12] Alter doc to take into account that input is not integrated as current --- models/iaf_psc_delta.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index da1dc40d29..e7892ee627 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -59,9 +59,9 @@ The membrane potential evolves according to .. math:: - \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} + \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \Delta V_{\text{syn}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} -where the synaptic input current :math:`I_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is +where is the change in voltage due to synaptic input :math:`\Delta V_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is a constant input current set as a model parameter. A spike is emitted at time step :math:`t^*=t_{k+1}` if @@ -81,30 +81,29 @@ that is, the membrane potential is clamped to :math:`V_{\text{reset}}` during th Synaptic input .............. -The synaptic input current handles excitatory and an inhibitory inputs: +The change in voltage due to synaptic inputs handles excitatory and an inhibitory inputs: .. math:: - I_{\text{syn}}(t) = \sum_{j} w_j \sum_k i_{\text{syn}}(t-t_j^k-d_j) \;, + \Deta V_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;, where :math:`j` indexes either excitatory (:math:`w_j > 0`) or inhibitory (:math:`w_j < 0`) presynaptic neurons, -:math:`k` indexes the spike times of neuron :math:`j`, and :math:`d_j` -is the delay from neuron :math:`j`. +:math:`k` indexes the spike times of neuron :math:`j`, :math:`d_j` +is the delay from neuron :math:`j`, and :math:`\delta` is the Dirac delta distribution. -The individual post-synaptic currents (PSCs) are given by +The change in voltage cause by the synaptic input can be interpreted as being cause +by individual post-synaptic currents (PSCs) given by .. math:: - i_{\text{syn}}(t) = \delta(t) - -where :math:`\delta` is the Dirac delta distribution. + i_{\text{syn}}(t) = C_{\text{m}} \cdot \delta(t). As a consequence, the total charge :math:`q` transferred by a single PSC is .. math:: - q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = 1 \;. + q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = C_{\text{m}} \;. By default, :math:`V_\text{m}` is not bounded from below. To limit hyperpolarization to biophysically plausible values, set parameter From b4cef389937760928bf79c9b7a4cfcd3761b6801 Mon Sep 17 00:00:00 2001 From: ackurth Date: Thu, 15 Feb 2024 10:10:22 +0100 Subject: [PATCH 05/12] Update documentation for --- models/iaf_psc_delta.h | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index e7892ee627..626217e1fc 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -59,9 +59,9 @@ The membrane potential evolves according to .. math:: - \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \Delta V_{\text{syn}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} + \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \Delta \dot{V}_{\text{syn}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} -where is the change in voltage due to synaptic input :math:`\Delta V_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is +where the derivative of change in voltage due to synaptic input :math:`\Delta \dot{V}_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is a constant input current set as a model parameter. A spike is emitted at time step :math:`t^*=t_{k+1}` if @@ -85,14 +85,22 @@ The change in voltage due to synaptic inputs handles excitatory and an inhibitor .. math:: - \Deta V_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;, + \Delta \dot{V}_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;, where :math:`j` indexes either excitatory (:math:`w_j > 0`) or inhibitory (:math:`w_j < 0`) presynaptic neurons, :math:`k` indexes the spike times of neuron :math:`j`, :math:`d_j` is the delay from neuron :math:`j`, and :math:`\delta` is the Dirac delta distribution. +This implies that the jump in voltage upon a single synaptic input spike is -The change in voltage cause by the synaptic input can be interpreted as being cause +.. math:: + + \Delta V_{\text{syn}} = w \;, + +where :math:`w` is the corresponding synaptic weight. + + +The change in voltage caused by the synaptic input can be interpreted as being caused by individual post-synaptic currents (PSCs) given by .. math:: @@ -113,14 +121,12 @@ hyperpolarization to biophysically plausible values, set parameter -The threshold crossing is followed by an absolute refractory period -during which the membrane potential is clamped to the resting potential. - -Spikes arriving while the neuron is refractory, are discarded by -default. If the property ``refractory_input`` is set to true, such -spikes are added to the membrane potential at the end of the -refractory period, dampened according to the interval between -arrival and end of refractoriness. +.. note:: + Spikes arriving while the neuron is refractory, are discarded by + default. If the property ``refractory_input`` is set to true, such + spikes are added to the membrane potential at the end of the + refractory period, dampened according to the interval between + arrival and end of refractoriness. Parameters ++++++++++ From 20cd6a21fd9c8ea8b36ed90ae5292547cf714e71 Mon Sep 17 00:00:00 2001 From: ackurth Date: Fri, 16 Feb 2024 10:09:34 +0100 Subject: [PATCH 06/12] Add units, make units consistent --- models/iaf_psc_delta.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 626217e1fc..801d492b00 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -1,7 +1,5 @@ /* - * iaf_psc_delta.h - * - * This file is part of NEST. + * iaf_psc_delta.h This file is part of NEST. * * Copyright (C) 2004 The NEST Initiative * @@ -59,9 +57,9 @@ The membrane potential evolves according to .. math:: - \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \Delta \dot{V}_{\text{syn}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} + \frac{dV_\text{m}}{dt} = -\frac{V_{\text{m}} - E_\text{L}}{\tau_{\text{m}}} + \dot{\Delta}_{\text{syn}} + \frac{I_{\text{syn}} + I_\text{e}}{C_{\text{m}}} -where the derivative of change in voltage due to synaptic input :math:`\Delta \dot{V}_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is +where the derivative of change in voltage due to synaptic input :math:`\dot{\Delta}_{\text{syn}}(t)` is discussed below and :math:`I_\text{e}` is a constant input current set as a model parameter. A spike is emitted at time step :math:`t^*=t_{k+1}` if @@ -85,7 +83,7 @@ The change in voltage due to synaptic inputs handles excitatory and an inhibitor .. math:: - \Delta \dot{V}_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;, + \dot{\Delta}_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;, where :math:`j` indexes either excitatory (:math:`w_j > 0`) or inhibitory (:math:`w_j < 0`) presynaptic neurons, @@ -95,9 +93,9 @@ This implies that the jump in voltage upon a single synaptic input spike is .. math:: - \Delta V_{\text{syn}} = w \;, + \Delta_{\text{syn}} = w \;, -where :math:`w` is the corresponding synaptic weight. +where :math:`w` is the corresponding synaptic weight in mV. The change in voltage caused by the synaptic input can be interpreted as being caused @@ -105,13 +103,13 @@ by individual post-synaptic currents (PSCs) given by .. math:: - i_{\text{syn}}(t) = C_{\text{m}} \cdot \delta(t). + i_{\text{syn}}(t) = C_{\text{m}} \cdot w \cdot \delta(t). As a consequence, the total charge :math:`q` transferred by a single PSC is .. math:: - q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = C_{\text{m}} \;. + q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = C_{\text{m}} \cdot w \;. By default, :math:`V_\text{m}` is not bounded from below. To limit hyperpolarization to biophysically plausible values, set parameter From 11f99264a148b2157d835dc649bf729f16d5fad4 Mon Sep 17 00:00:00 2001 From: ackurth Date: Fri, 16 Feb 2024 10:37:53 +0100 Subject: [PATCH 07/12] Correct broken copyright header --- models/iaf_psc_delta.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 801d492b00..247d15e73f 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -1,5 +1,7 @@ /* - * iaf_psc_delta.h This file is part of NEST. + * iaf_psc_delta.h + * + * This file is part of NEST. * * Copyright (C) 2004 The NEST Initiative * From efd0507fe50203032cb5f8a66b2433ed07b1a395 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:43:59 +0100 Subject: [PATCH 08/12] Update models/iaf_psc_delta.h Co-authored-by: clinssen --- models/iaf_psc_delta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 247d15e73f..e1b26948ae 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -137,7 +137,7 @@ The following parameters can be set in the status dictionary. **Parameter** **Default** **Math equivalent** **Description** ==================== ================== =============================== ================================================================================== ``E_L`` -70 mV :math:`E_\text{L}` Resting membrane potential -``C_m`` 250 pF :math:`C_{\text{m}}` Capacity of the membrane +``C_m`` 250 pF :math:`C_{\text{m}}` Capacitance of the membrane ``tau_m`` 10 ms :math:`\tau_{\text{m}}` Membrane time constant ``t_ref`` 2 ms :math:`t_{\text{ref}}` Duration of refractory period ``V_th`` -55 mV :math:`V_{\text{th}}` Spike threshold From c16944af817a85a0c2a3fc6cdd1b0f9c6e8a2a39 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:45:13 +0100 Subject: [PATCH 09/12] Update models/iaf_psc_delta.h Co-authored-by: clinssen --- models/iaf_psc_delta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index e1b26948ae..34444bbfdf 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -123,7 +123,7 @@ hyperpolarization to biophysically plausible values, set parameter .. note:: Spikes arriving while the neuron is refractory, are discarded by - default. If the property ``refractory_input`` is set to true, such + default. If the property ``refractory_input`` is set to True, such spikes are added to the membrane potential at the end of the refractory period, dampened according to the interval between arrival and end of refractoriness. From 5c4c18f72d4d9ac3db33fd67b2e7c4054a6dce86 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:51:32 +0100 Subject: [PATCH 10/12] Update models/iaf_psc_delta.h Co-authored-by: clinssen --- models/iaf_psc_delta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 34444bbfdf..dc28f13473 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -81,7 +81,7 @@ that is, the membrane potential is clamped to :math:`V_{\text{reset}}` during th Synaptic input .............. -The change in voltage due to synaptic inputs handles excitatory and an inhibitory inputs: +The change in membrane potential due to synaptic inputs can be formulated as: .. math:: From d145b9a3c26bfd41f33d178562a337e901a72bf3 Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:56:25 +0100 Subject: [PATCH 11/12] Update models/iaf_psc_delta.h Co-authored-by: clinssen --- models/iaf_psc_delta.h | 1 - 1 file changed, 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index dc28f13473..67d924b966 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -49,7 +49,6 @@ Description * a hard threshold, * a fixed refractory period, -* no adaptation mechanisms, * :math:`\delta`-shaped synaptic input currents. Membrane potential evolution, spike emission, and refractoriness From a99f9b94c480d386880adc8ce86f9a60c8c5d96a Mon Sep 17 00:00:00 2001 From: Anno Christopher Kurth <44397333+ackurth@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:57:10 +0100 Subject: [PATCH 12/12] Update models/iaf_psc_delta.h Co-authored-by: clinssen --- models/iaf_psc_delta.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/iaf_psc_delta.h b/models/iaf_psc_delta.h index 67d924b966..2bc4fadf8a 100644 --- a/models/iaf_psc_delta.h +++ b/models/iaf_psc_delta.h @@ -49,7 +49,7 @@ Description * a hard threshold, * a fixed refractory period, -* :math:`\delta`-shaped synaptic input currents. +* Dirac delta (:math:`\delta`)-shaped synaptic input currents. Membrane potential evolution, spike emission, and refractoriness ................................................................