NEST main@f146f75
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
195
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 bool
218 {
219 return true;
220 }
221
222 void handle( WeightCorrectionEvent& ) override;
223 void handle( CurrentEvent& ) override;
224 void handle( DataLoggingRequest& ) override;
225
226 size_t handles_test_event( SpikeEvent&, size_t ) override;
227 size_t handles_test_event( WeightCorrectionEvent&, size_t ) override;
228 size_t handles_test_event( CurrentEvent&, size_t ) override;
229 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
230
231 void get_status( Dictionary& ) const override;
232 void set_status( const Dictionary& ) override;
233
234private:
235 void init_buffers_() override;
236 void pre_run_hook() override;
237
238 void update( Time const&, const long, const long ) override;
239
240 // The next two classes need to be friends to access the State_ class/member
241 friend class RecordablesMap< iaf_psc_delta >;
242 friend class UniversalDataLogger< iaf_psc_delta >;
243
244 // ----------------------------------------------------------------
245
250 {
252 double tau_m_;
253
255 double c_m_;
256
258 double t_ref_;
259
261 double E_L_;
262
264 double I_e_;
265
268 double V_th_;
269
272 double V_min_;
273
275 double V_reset_;
276
279
280 Parameters_();
281
282 void get( Dictionary& ) const;
283
287 double set( const Dictionary&, Node* node );
288 };
289
290 // ----------------------------------------------------------------
291
295 struct State_
296 {
297 double y0_;
299 double y3_;
300
301 int r_;
302
307
308 State_();
309
310 void get( Dictionary&, const Parameters_& ) const;
311
317 void set( const Dictionary&, const Parameters_&, double, Node* );
318 };
319
320 // ----------------------------------------------------------------
321
337
338 // ----------------------------------------------------------------
339
344 {
345
346 double P30_;
347 double P33_;
348
350 };
351
352 // Access functions for UniversalDataLogger -------------------------------
353
355 double
356 get_V_m_() const
357 {
358 return S_.y3_ + P_.E_L_;
359 }
360
361 // ----------------------------------------------------------------
362
374
377};
378
379
380inline size_t
381iaf_psc_delta::send_test_event( Node& target, size_t receptor_type, synindex, bool )
382{
383 SpikeEvent e;
384 e.set_sender( *this );
385 return target.handles_test_event( e, receptor_type );
386}
387
388inline size_t
390{
391 if ( receptor_type != 0 )
392 {
393 throw UnknownReceptorType( receptor_type, get_name() );
394 }
395 return 0;
396}
397
398inline size_t
400{
401 if ( receptor_type != 0 )
402 {
403 throw UnknownReceptorType( receptor_type, get_name() );
404 }
405 return 0;
406}
407
408inline size_t
410{
411 if ( receptor_type != 0 )
412 {
413 throw UnknownReceptorType( receptor_type, get_name() );
414 }
415 return 0;
416}
417
418inline size_t
420{
421 if ( receptor_type != 0 )
422 {
423 throw UnknownReceptorType( receptor_type, get_name() );
424 }
425 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
426}
427
428inline void
430{
431 P_.get( d );
432 S_.get( d, P_ );
434 d[ names::recordables ] = recordablesMap_.get_list();
435}
436
437inline void
439{
440 Parameters_ ptmp = P_; // temporary copy in case of errors
441 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
442 State_ stmp = S_; // temporary copy in case of errors
443 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
444
445 // We now know that (ptmp, stmp) are consistent. We do not
446 // write them back to (P_, S_) before we are also sure that
447 // the properties to be set in the parent class are internally
448 // consistent.
450
451 // if we get here, temporaries contain consistent set of properties
452 P_ = ptmp;
453 S_ = stmp;
454}
455
456} // namespace
457
458#endif /* #ifndef IAF_PSC_DELTA_H */
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
ArchivingNode()
Definition archiving_node.cpp:37
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:249
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:265
Event for electrical currents.
Definition event.h:608
Request data to be logged/logged data to be sent.
Definition event.h:675
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:420
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 event.h:457
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_psc_delta.h:429
bool supports_axonal_delay_corrections() const override
Whether this model can be the target of a synapse with predominantly axonal delay.
Definition iaf_psc_delta.h:217
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:389
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:381
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_psc_delta.h:356
State_ S_
Definition iaf_psc_delta.h:370
Buffers_ B_
Definition iaf_psc_delta.h:372
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:275
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_psc_delta.h:369
Variables_ V_
Definition iaf_psc_delta.h:371
static RecordablesMap< iaf_psc_delta > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_psc_delta.h:376
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:438
friend class RecordablesMap< iaf_psc_delta >
Definition iaf_psc_delta.h:241
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_psc_delta.cpp:337
friend class UniversalDataLogger< iaf_psc_delta >
Definition iaf_psc_delta.h:242
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:282
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition node.cpp:271
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:121
Buffers of the model.
Definition iaf_psc_delta.h:326
UniversalDataLogger< iaf_psc_delta > logger_
Logger for all analog data.
Definition iaf_psc_delta.h:335
Buffers_(iaf_psc_delta &)
Definition iaf_psc_delta.cpp:190
RingBuffer currents_
Definition iaf_psc_delta.h:332
RingBuffer spikes_
buffers and summs up incoming spikes/currents
Definition iaf_psc_delta.h:331
Independent parameters of the model.
Definition iaf_psc_delta.h:250
double E_L_
Resting potential in mV.
Definition iaf_psc_delta.h:261
double V_th_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_delta.h:268
double c_m_
Membrane capacitance in pF.
Definition iaf_psc_delta.h:255
double tau_m_
Membrane time constant in ms.
Definition iaf_psc_delta.h:252
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_
Definition iaf_psc_delta.h:277
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:272
double I_e_
External DC current.
Definition iaf_psc_delta.h:264
double V_reset_
reset value of the membrane potential
Definition iaf_psc_delta.h:275
double t_ref_
Refractory period in ms.
Definition iaf_psc_delta.h:258
State variables of the model.
Definition iaf_psc_delta.h:296
double refr_spikes_buffer_
Accumulate spikes arriving during refractory period, discounted for decay until end of refractory per...
Definition iaf_psc_delta.h:306
int r_
Number of refractory steps remaining.
Definition iaf_psc_delta.h:301
double y3_
This is the membrane potential RELATIVE TO RESTING POTENTIAL.
Definition iaf_psc_delta.h:299
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:297
void get(Dictionary &, const Parameters_ &) const
Definition iaf_psc_delta.cpp:172
Internal variables of the model.
Definition iaf_psc_delta.h:344
int RefractoryCounts_
Definition iaf_psc_delta.h:349
double P30_
Definition iaf_psc_delta.h:346
double P33_
Definition iaf_psc_delta.h:347