NEST main@caf0ae8
 
Loading...
Searching...
No Matches
iaf_psc_delta.h
Go to the documentation of this file.
1/*
2 * iaf_psc_delta.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef IAF_PSC_DELTA_H
24#define IAF_PSC_DELTA_H
25
26// Includes from nestkernel:
27#include "archiving_node.h"
28#include "connection.h"
29#include "event.h"
30#include "nest_types.h"
31#include "ring_buffer.h"
33
34namespace nest
35{
36// Disable clang-formatting for documentation due to over-wide table.
37// clang-format off
38/* BeginUserDocs: neuron, integrate-and-fire, current-based, hard threshold
39
40Short description
41+++++++++++++++++
42
43Leaky integrate-and-fire model with delta-shaped input currents
44
45Description
46+++++++++++
47
48``iaf_psc_delta`` is a leaky integrate-and-fire neuron model with
49
50* a hard threshold,
51* a fixed refractory period,
52* Dirac delta (:math:`\delta`)-shaped synaptic input currents.
53
54Membrane potential evolution, spike emission, and refractoriness
55................................................................
56
57The membrane potential evolves according to
58
59.. math::
60
61 \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}}}
62
63where 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
64a constant input current set as a model parameter.
65
66A spike is emitted at time step :math:`t^*=t_{k+1}` if
67
68.. math::
69
70 V_\text{m}(t_k) < V_{th} \quad\text{and}\quad V_\text{m}(t_{k+1})\geq V_\text{th} \;.
71
72Subsequently,
73
74.. math::
75
76 V_\text{m}(t) = V_{\text{reset}} \quad\text{for}\quad t^* \leq t < t^* + t_{\text{ref}} \;,
77
78that is, the membrane potential is clamped to :math:`V_{\text{reset}}` during the refractory period.
79
80Synaptic input
81..............
82
83The change in membrane potential due to synaptic inputs can be formulated as:
84
85.. math::
86
87 \dot{\Delta}_{\text{syn}}(t) = \sum_{j} w_j \sum_k \delta(t-t_j^k-d_j) \;,
88
89where :math:`j` indexes either excitatory (:math:`w_j > 0`)
90or inhibitory (:math:`w_j < 0`) presynaptic neurons,
91:math:`k` indexes the spike times of neuron :math:`j`, :math:`d_j`
92is the delay from neuron :math:`j`, and :math:`\delta` is the Dirac delta distribution.
93This implies that the jump in voltage upon a single synaptic input spike is
94
95.. math::
96
97 \Delta_{\text{syn}} = w \;,
98
99where :math:`w` is the corresponding synaptic weight in mV.
100
101
102The change in voltage caused by the synaptic input can be interpreted as being caused
103by individual post-synaptic currents (PSCs) given by
104
105.. math::
106
107 i_{\text{syn}}(t) = C_{\text{m}} \cdot w \cdot \delta(t).
108
109As a consequence, the total charge :math:`q` transferred by a single PSC is
110
111.. math::
112
113 q = \int_0^{\infty} i_{\text{syn, X}}(t) dt = C_{\text{m}} \cdot w \;.
114
115By default, :math:`V_\text{m}` is not bounded from below. To limit
116hyperpolarization to biophysically plausible values, set parameter
117:math:`V_{\text{min}}` as lower bound of :math:`V_\text{m}`.
118
119
120
121
122
123.. note::
124
125 NEST uses exact integration :footcite:p:`Rotter1999`, :footcite:p:`Diesmann2001` to integrate subthreshold membrane
126 dynamics.
127
128 Spikes arriving while the neuron is refractory, are discarded by
129 default. If the property ``refractory_input`` is set to True, such
130 spikes are added to the membrane potential at the end of the
131 refractory period, dampened according to the interval between
132 arrival and end of refractoriness.
133
134Parameters
135++++++++++
136
137The following parameters can be set in the status dictionary.
138
139==================== ================== =============================== ==================================================================================
140**Parameter** **Default** **Math equivalent** **Description**
141==================== ================== =============================== ==================================================================================
142``E_L`` -70 mV :math:`E_\text{L}` Resting membrane potential
143``C_m`` 250 pF :math:`C_{\text{m}}` Capacitance of the membrane
144``tau_m`` 10 ms :math:`\tau_{\text{m}}` Membrane time constant
145``t_ref`` 2 ms :math:`t_{\text{ref}}` Duration of refractory period
146``V_th`` -55 mV :math:`V_{\text{th}}` Spike threshold
147``V_reset`` -70 mV :math:`V_{\text{reset}}` Reset potential of the membrane
148``I_e`` 0 pA :math:`I_\text{e}` Constant input current
149``V_min`` :math:`-\infty` mV :math:`V_{\text{min}}` Absolute lower value for the membrane potential
150``refractory_input`` ``False`` None If set to True, spikes arriving during refractory period are integrated afterwards
151==================== ================== =============================== ==================================================================================
152
153
154References
155++++++++++
156
157.. footbibliography::
158
159Sends
160+++++
161
162SpikeEvent
163
164Receives
165++++++++
166
167SpikeEvent, CurrentEvent, DataLoggingRequest
168
169See also
170++++++++
171
172iaf_psc_alpha, iaf_psc_exp, iaf_psc_delta_ps
173
174Examples using this model
175+++++++++++++++++++++++++
176
177.. listexamples:: iaf_psc_delta
178
179EndUserDocs */
180
196void register_iaf_psc_delta( const std::string& name );
197
199{
200
201public:
204
210 using Node::handle;
212
213 size_t send_test_event( Node&, size_t, synindex, bool ) override;
214
215 void handle( SpikeEvent& ) override;
216 void handle( CurrentEvent& ) override;
217 void handle( DataLoggingRequest& ) override;
218
219 size_t handles_test_event( SpikeEvent&, size_t ) override;
220 size_t handles_test_event( CurrentEvent&, size_t ) override;
221 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
222
223 void get_status( Dictionary& ) const override;
224 void set_status( const Dictionary& ) override;
225
226private:
227 void init_buffers_() override;
228 void pre_run_hook() override;
229
230 void update( Time const&, const long, const long ) override;
231
232 // The next two classes need to be friends to access the State_ class/member
233 friend class RecordablesMap< iaf_psc_delta >;
234 friend class UniversalDataLogger< iaf_psc_delta >;
235
236 // ----------------------------------------------------------------
237
242 {
244 double tau_m_;
245
247 double c_m_;
248
250 double t_ref_;
251
253 double E_L_;
254
256 double I_e_;
257
260 double V_th_;
261
264 double V_min_;
265
267 double V_reset_;
268
271
272 Parameters_();
273
274 void get( Dictionary& ) const;
275
279 double set( const Dictionary&, Node* node );
280 };
281
282 // ----------------------------------------------------------------
283
287 struct State_
288 {
289 double y0_;
291 double y3_;
292
293 int r_;
294
299
300 State_();
301
302 void get( Dictionary&, const Parameters_& ) const;
303
309 void set( const Dictionary&, const Parameters_&, double, Node* );
310 };
311
312 // ----------------------------------------------------------------
313
329
330 // ----------------------------------------------------------------
331
336 {
337
338 double P30_;
339 double P33_;
340
342 };
343
344 // Access functions for UniversalDataLogger -------------------------------
345
347 double
348 get_V_m_() const
349 {
350 return S_.y3_ + P_.E_L_;
351 }
352
353 // ----------------------------------------------------------------
354
369};
370
371
372inline size_t
373iaf_psc_delta::send_test_event( Node& target, size_t receptor_type, synindex, bool )
374{
375 SpikeEvent e;
376 e.set_sender( *this );
377 return target.handles_test_event( e, receptor_type );
378}
379
380inline size_t
382{
383 if ( receptor_type != 0 )
384 {
385 throw UnknownReceptorType( receptor_type, get_name() );
386 }
387 return 0;
388}
389
390inline size_t
392{
393 if ( receptor_type != 0 )
394 {
395 throw UnknownReceptorType( receptor_type, get_name() );
396 }
397 return 0;
398}
399
400inline size_t
402{
403 if ( receptor_type != 0 )
404 {
405 throw UnknownReceptorType( receptor_type, get_name() );
406 }
407 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
408}
409
410inline void
412{
413 P_.get( d );
414 S_.get( d, P_ );
416 d[ names::recordables ] = recordablesMap_.get_list();
417}
418
419inline void
421{
422 Parameters_ ptmp = P_; // temporary copy in case of errors
423 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
424 State_ stmp = S_; // temporary copy in case of errors
425 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
426
427 // We now know that (ptmp, stmp) are consistent. We do not
428 // write them back to (P_, S_) before we are also sure that
429 // the properties to be set in the parent class are internally
430 // consistent.
432
433 // if we get here, temporaries contain consistent set of properties
434 P_ = ptmp;
435 S_ = stmp;
436}
437
438} // namespace
439
440#endif /* #ifndef IAF_PSC_DELTA_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
A node which archives spike history for the purposes of spike-timing dependent plasticity (STDP)
Definition archiving_node.h:49
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:220
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:236
Event for electrical currents.
Definition event.h:569
Request data to be logged/logged data to be sent.
Definition event.h:636
Base class for all NEST network objects.
Definition node.h:99
std::string get_name() const
Return class name.
Definition node.cpp:105
Map names of recordables to data access functions.
Definition recordables_map.h:61
Buffer Layout.
Definition ring_buffer.h:83
Event for spike information.
Definition event.h:418
Definition nest_time.h:135
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
Definition iaf_psc_delta.h:199
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_psc_delta.h:411
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition iaf_psc_delta.cpp:235
void init_buffers_() override
Configure persistent internal data structures.
Definition iaf_psc_delta.cpp:226
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition iaf_psc_delta.h:381
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition iaf_psc_delta.h:373
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_psc_delta.h:348
State_ S_
Definition iaf_psc_delta.h:362
Buffers_ B_
Definition iaf_psc_delta.h:364
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition iaf_psc_delta.cpp:273
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_psc_delta.h:361
Variables_ V_
Definition iaf_psc_delta.h:363
static RecordablesMap< iaf_psc_delta > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_psc_delta.h:368
iaf_psc_delta()
Definition iaf_psc_delta.cpp:204
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_psc_delta.h:420
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_psc_delta.cpp:333
friend class UniversalDataLogger< iaf_psc_delta >
Definition iaf_psc_delta.h:234
virtual size_t handles_test_event(SpikeEvent &, size_t receptor_type)
Check if the node can handle a particular event and receptor type.
Definition node.cpp:271
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:265
const std::string recordables("recordables")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
void register_iaf_psc_delta(const std::string &name)
The present implementation uses individual variables for the components of the state vector and the n...
Definition iaf_psc_delta.cpp:44
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Buffers of the model.
Definition iaf_psc_delta.h:318
UniversalDataLogger< iaf_psc_delta > logger_
Logger for all analog data.
Definition iaf_psc_delta.h:327
RingBuffer currents_
Definition iaf_psc_delta.h:324
RingBuffer spikes_
buffers and summs up incoming spikes/currents
Definition iaf_psc_delta.h:323
Independent parameters of the model.
Definition iaf_psc_delta.h:242
double E_L_
Resting potential in mV.
Definition iaf_psc_delta.h:253
double V_th_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_delta.h:260
double c_m_
Membrane capacitance in pF.
Definition iaf_psc_delta.h:247
double tau_m_
Membrane time constant in ms.
Definition iaf_psc_delta.h:244
Parameters_()
Sets default parameter values.
Definition iaf_psc_delta.cpp:70
double set(const Dictionary &, Node *node)
Set values from dictionary.
Definition iaf_psc_delta.cpp:110
bool with_refr_input_
spikes arriving during refractory period are counted
Definition iaf_psc_delta.h:269
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_psc_delta.cpp:96
double V_min_
Lower bound, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_delta.h:264
double I_e_
External DC current.
Definition iaf_psc_delta.h:256
double V_reset_
reset value of the membrane potential
Definition iaf_psc_delta.h:267
double t_ref_
Refractory period in ms.
Definition iaf_psc_delta.h:250
State variables of the model.
Definition iaf_psc_delta.h:288
double refr_spikes_buffer_
Accumulate spikes arriving during refractory period, discounted for decay until end of refractory per...
Definition iaf_psc_delta.h:298
int r_
Number of refractory steps remaining.
Definition iaf_psc_delta.h:293
double y3_
This is the membrane potential RELATIVE TO RESTING POTENTIAL.
Definition iaf_psc_delta.h:291
State_()
Default initialization.
Definition iaf_psc_delta.cpp:83
void set(const Dictionary &, const Parameters_ &, double, Node *)
Set values from dictionary.
Definition iaf_psc_delta.cpp:178
double y0_
Definition iaf_psc_delta.h:289
void get(Dictionary &, const Parameters_ &) const
Definition iaf_psc_delta.cpp:172
Internal variables of the model.
Definition iaf_psc_delta.h:336
int RefractoryCounts_
Definition iaf_psc_delta.h:341
double P30_
Definition iaf_psc_delta.h:338
double P33_
Definition iaf_psc_delta.h:339