NEST main@caf0ae8
 
Loading...
Searching...
No Matches
izhikevich.h
Go to the documentation of this file.
1/*
2 * izhikevich.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 IZHIKEVICH_H
24#define IZHIKEVICH_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, adaptation, soft threshold, Izhikevich
39
40Short description
41+++++++++++++++++
42
43Izhikevich neuron model
44
45Description
46+++++++++++
47
48``izhikevich`` implements the simple spiking neuron model introduced by Izhikevich :footcite:p:`Izhikevich2003a`.
49This model reproduces spiking and bursting behavior of known types of cortical neurons.
50
51Membrane potential evolution, spike emission, and refractoriness
52................................................................
53
54The model is defined by the following differential equations:
55
56.. math::
57
58 \frac{dV_{\text{m}}}{dt} = 0.04 V_{\text{m}}^2 + 5 V_{\text{m}} + 140 - U_{\text{m}} + I_{\text{e}}
59
60.. math::
61
62 \frac{dU_{\text{m}}}{dt} = a (b V_{\text{m}} - U_{\text{m}})
63
64where :math:`V_{\text{m}}` is the membrane potential, :math:`U_{\text{m}}` is the recovery variable, and
65:math:`I_{\text{e}}` is the input current.
66
67A spike is emitted when :math:`V_{\text{m}}` reaches a threshold :math:`V_{\text{th}}`.
68At this point, the membrane potential and recovery variable are updated according to:
69
70.. math::
71
72 &\text{if}\;\ V_m \geq V_{th}:\\
73 &\;\ V_m \text{ is set to } c\\
74 &\;\ U_m \text{ is incremented by } d\\
75
76In addition, each incoming spike increases :math:`V_{\text{m}}` by the synaptic weight associated with the spike.
77
78As published in :footcite:p:`Izhikevich2003a`, the numerics differs from the standard forward Euler technique in two ways:
79
80 * the recovery variable :math:`U_{\text{m}}` is updated based on the new value of :math:`V_{\text{m}}`, rather than the previous one.
81 * the membrane potential :math:`V_{\text{m}}` is updated with a time step half the size of that used for :math:`U_{\text{m}}`.
82
83This model offers both forms of integration, they can be selected using the boolean parameter ``consistent_integration``:
84
85 * ``consistent_integration = false``: use the published form of the dynamics (for replicating published results).
86 * ``consistent_integration = true`` *(default)*: use the standard Euler method (recommended for general use).
87
88.. note::
89
90 For a detailed analysis of the numerical differences between these integration schemes and their impact on simulation results, see :footcite:p:`Pauli2018`.
91
92Parameters
93++++++++++
94
95The following parameters can be set in the status dictionary.
96
97======================= ============ ====================== ===================================================
98**Parameter** **Default** **Math equivalent** **Description**
99======================= ============ ====================== ===================================================
100 V_m -65 mV :math:`V_{\text{m}}` Membrane potential
101 U_m -13 mV :math:`U_{\text{m}}` Membrane potential recovery variable
102 V_th 30 mV :math:`V_{\text{th}}` Spike threshold
103 I_e 0 pA :math:`I_{\text{e}}` Constant input current (R=1)
104 V_min -1.79 mV :math:`V_{\text{min}}` Absolute lower value for the membrane potential
105 a 0.02 real :math:`a` Describes time scale of recovery variable
106 b 0.2 real :math:`b` Sensitivity of recovery variable
107 c -65 mV :math:`c` After-spike reset value of V_m
108 d 8 mV :math:`d` After-spike reset value of U_m
109 consistent_integration ``true`` None Use standard integration technique
110======================= ============ ====================== ===================================================
111
112References
113++++++++++
114
115.. footbibliography::
116
117Sends
118+++++
119
120SpikeEvent
121
122Receives
123++++++++
124
125SpikeEvent, CurrentEvent, DataLoggingRequest
126
127See also
128++++++++
129
130iaf_psc_delta, mat2_psc_exp
131
132Examples using this model
133+++++++++++++++++++++++++
134
135.. listexamples:: izhikevich
136
137EndUserDocs */
138// clang-format on
139
140void register_izhikevich( const std::string& name );
141
143{
144
145public:
146 izhikevich();
147 izhikevich( const izhikevich& );
148
154 using Node::handle;
156
157 void handle( DataLoggingRequest& ) override;
158 void handle( SpikeEvent& ) override;
159 void handle( CurrentEvent& ) override;
160
161 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
162 size_t handles_test_event( SpikeEvent&, size_t ) override;
163 size_t handles_test_event( CurrentEvent&, size_t ) override;
164
165 size_t send_test_event( Node&, size_t, synindex, bool ) override;
166
167 void get_status( Dictionary& ) const override;
168 void set_status( const Dictionary& ) override;
169
170private:
171 friend class RecordablesMap< izhikevich >;
172 friend class UniversalDataLogger< izhikevich >;
173
174 void init_buffers_() override;
175 void pre_run_hook() override;
176
177 void update( Time const&, const long, const long ) override;
178
179 // ----------------------------------------------------------------
180
185 {
186 double a_;
187 double b_;
188 double c_;
189 double d_;
190
192 double I_e_;
193
195 double V_th_;
196
198 double V_min_;
199
202
203 Parameters_();
204
205 void get( Dictionary& ) const;
206 void set( const Dictionary&, Node* node );
207 };
208
209 // ----------------------------------------------------------------
210
214 struct State_
215 {
216 double v_; // membrane potential
217 double u_; // membrane recovery variable
218 double I_; // input current
219
220
225 State_();
226
227 void get( Dictionary&, const Parameters_& ) const;
228 void set( const Dictionary&, const Parameters_&, Node* );
229 };
230
231 // ----------------------------------------------------------------
232
249
250 // ----------------------------------------------------------------
251
256 {
257 };
258
259 // Access functions for UniversalDataLogger -----------------------
260
262 double
263 get_V_m_() const
264 {
265 return S_.v_;
266 }
268 double
269 get_U_m_() const
270 {
271 return S_.u_;
272 }
273
274 // ----------------------------------------------------------------
275
280
284};
285
286inline size_t
287izhikevich::send_test_event( Node& target, size_t receptor_type, synindex, bool )
288{
289 SpikeEvent e;
290 e.set_sender( *this );
291
292 return target.handles_test_event( e, receptor_type );
293}
294
295inline size_t
297{
298 if ( receptor_type != 0 )
299 {
300 throw UnknownReceptorType( receptor_type, get_name() );
301 }
302 return 0;
303}
304
305inline size_t
307{
308 if ( receptor_type != 0 )
309 {
310 throw UnknownReceptorType( receptor_type, get_name() );
311 }
312 return 0;
313}
314
315inline size_t
317{
318 if ( receptor_type != 0 )
319 {
320 throw UnknownReceptorType( receptor_type, get_name() );
321 }
322 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
323}
324
325inline void
327{
328 P_.get( d );
329 S_.get( d, P_ );
331 d[ names::recordables ] = recordablesMap_.get_list();
332}
333
334inline void
336{
337 Parameters_ ptmp = P_; // temporary copy in case of errors
338 ptmp.set( d, this ); // throws if BadProperty
339 State_ stmp = S_; // temporary copy in case of errors
340 stmp.set( d, ptmp, this ); // throws if BadProperty
341
342 // We now know that (ptmp, stmp) are consistent. We do not
343 // write them back to (P_, S_) before we are also sure that
344 // the properties to be set in the parent class are internally
345 // consistent.
347
348 // if we get here, temporaries contain consistent set of properties
349 P_ = ptmp;
350 S_ = stmp;
351}
352
353} // namespace nest
354
355#endif /* #ifndef IZHIKEVICH_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 izhikevich.h:143
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition izhikevich.h:335
Parameters_ P_
Definition izhikevich.h:276
static RecordablesMap< izhikevich > recordablesMap_
Mapping of recordables names to access functions.
Definition izhikevich.h:282
size_t handles_test_event(DataLoggingRequest &, size_t) override
Definition izhikevich.h:316
Variables_ V_
Definition izhikevich.h:278
double get_U_m_() const
Read out the recovery variable.
Definition izhikevich.h:269
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition izhikevich.cpp:194
void handle(DataLoggingRequest &) override
Handler for universal data logging request.
Definition izhikevich.cpp:264
double get_V_m_() const
Read out the membrane potential.
Definition izhikevich.h:263
friend class UniversalDataLogger< izhikevich >
Definition izhikevich.h:172
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition izhikevich.h:287
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition izhikevich.h:326
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition izhikevich.cpp:184
Buffers_ B_
Definition izhikevich.h:279
izhikevich()
Definition izhikevich.cpp:153
State_ S_
Definition izhikevich.h:277
void init_buffers_() override
Configure persistent internal data structures.
Definition izhikevich.cpp:175
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_izhikevich(const std::string &name)
Definition izhikevich.cpp:49
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Buffers of the model.
Definition izhikevich.h:237
UniversalDataLogger< izhikevich > logger_
Definition izhikevich.h:243
RingBuffer spikes_
buffers and sums up incoming spikes/currents
Definition izhikevich.h:246
RingBuffer currents_
Definition izhikevich.h:247
Independent parameters of the model.
Definition izhikevich.h:185
double c_
Definition izhikevich.h:188
double b_
Definition izhikevich.h:187
bool consistent_integration_
Use standard integration numerics.
Definition izhikevich.h:201
double V_th_
Threshold.
Definition izhikevich.h:195
double V_min_
Lower bound.
Definition izhikevich.h:198
void get(Dictionary &) const
Store current values in dictionary.
Definition izhikevich.cpp:93
double d_
Definition izhikevich.h:189
double I_e_
External DC current.
Definition izhikevich.h:192
double a_
Definition izhikevich.h:186
Parameters_()
Sets default parameter values.
Definition izhikevich.cpp:69
void set(const Dictionary &, Node *node)
Set values from dictionary.
Definition izhikevich.cpp:106
State variables of the model.
Definition izhikevich.h:215
void get(Dictionary &, const Parameters_ &) const
Definition izhikevich.cpp:126
double u_
Definition izhikevich.h:217
State_()
Accumulate spikes arriving during refractory period, discounted for decay until end of refractory per...
Definition izhikevich.cpp:81
void set(const Dictionary &, const Parameters_ &, Node *)
Definition izhikevich.cpp:133
double v_
Definition izhikevich.h:216
double I_
Definition izhikevich.h:218
Internal variables of the model.
Definition izhikevich.h:256