NEST main@f146f75
Loading...
Searching...
No Matches
amat2_psc_exp.h
Go to the documentation of this file.
1/*
2 * amat2_psc_exp.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
24#ifndef AMAT2_PSC_EXP_H
25#define AMAT2_PSC_EXP_H
26
27// Includes from nestkernel:
28#include "archiving_node.h"
29#include "connection.h"
30#include "event.h"
31#include "nest_types.h"
32#include "recordables_map.h"
33#include "ring_buffer.h"
35
36namespace nest
37{
38
39/* BeginUserDocs: neuron, integrate-and-fire, current-based, adaptation, hard threshold
40
41Short description
42+++++++++++++++++
43
44Non-resetting leaky integrate-and-fire neuron model with exponential
45PSCs and adaptive threshold
46
47Description
48+++++++++++
49
50``amat2_psc_exp`` is an implementation of a leaky integrate-and-fire model
51with exponential shaped postsynaptic currents (PSCs). Thus, postsynaptic
52currents have an infinitely short rise time.
53
54The threshold is lifted when the neuron is fired and then decreases in a
55fixed time scale toward a fixed level :footcite:p:`Kobayashi2009`.
56
57The threshold crossing is followed by a total refractory period
58during which the neuron is not allowed to fire, even if the membrane
59potential exceeds the threshold. The membrane potential is NOT reset,
60but continuously integrated.
61
62The linear subthreshold dynamics is integrated by the Exact
63Integration scheme :footcite:p:`Rotter1999`. The neuron dynamics is solved on the time
64grid given by the computation step size. Incoming as well as emitted
65spikes are forced to that grid.
66
67An additional state variable and the corresponding differential
68equation represents a piecewise constant external current.
69
70The general framework for the consistent formulation of systems with
71neuron like dynamics interacting by point events is described in
72:footcite:p:`Rotter1999`. A flow chart can be found in :footcite:p:`Diesmann2001`.
73
74The default parameter values for this model are different from the
75corresponding parameter values for ``mat2_psc_exp``. If identical
76parameters are used, and beta is 0, then this model shall behave
77exactly as mat2_psc_exp.
78
79The following state variables can be read out using a multimeter:
80
81=========== ==== ==================================
82 V_m mV Non-resetting membrane potential
83 V_th mV Two-timescale adaptive threshold
84=========== ==== ==================================
85
86See also :footcite:p:`Yamauchi2011`.
87
88.. note::
89
90 Incoming spikes are routed to the excitatory or inhibitory synapse type by the **sign of the
91 connection weight**. A positive weight targets the excitatory synapse type, a negative weight
92 the inhibitory one, and also sets the direction of the post-synaptic current.
93 Spike connections must use the default ``receptor_type`` of 0.
94
95 See :ref:`synapse_selection` for the conventions used by other models.
96
97Parameters
98++++++++++
99
100The following parameters can be set in the status dictionary:
101
102=========== ======= ===========================================================
103 C_m pF Capacity of the membrane
104 E_L mV Resting potential
105 tau_m ms Membrane time constant
106 tau_syn_ex ms Time constant of postsynaptic excitatory currents
107 tau_syn_in ms Time constant of postsynaptic inhibitory currents
108 t_ref ms Duration of absolute refractory period (no spiking)
109 V_m mV Membrane potential
110 I_e pA Constant input current
111 t_spike ms Point in time of last spike
112 tau_1 ms Short time constant of adaptive threshold [3, eqs 2-3]
113 tau_2 ms Long time constant of adaptive threshold [3, eqs 2-3]
114 alpha_1 mV Amplitude of short time threshold adaption [3, eqs 2-3]
115 alpha_2 mV Amplitude of long time threshold adaption [3, eqs 2-3]
116 tau_v ms Time constant of kernel for voltage-dependent threshold
117 component [3, eqs 16-17]
118 beta 1/ms Scaling coefficient for voltage-dependent threshold
119 component [3, eqs 16-17]
120 omega mV Resting spike threshold (absolute value, not
121 relative to E_L as in :footcite:p:`Kobayashi2009`)
122=========== ======= ===========================================================
123
124.. note::
125
126 - The time constants in the model must fulfill the following conditions:
127 - :math:`\tau_m != {\tau_{syn_{ex}}, \tau_{syn_{in}}}`
128 - :math:`\tau_v != {\tau_{syn_{ex}}, \tau_{syn_{in}}}`
129 - :math:`\tau_m != \tau_v`
130 This is required to avoid singularities in the numerics. This is a
131 problem of implementation only, not a principal problem of the model.
132
133 - Expect unstable numerics if time constants that are required to be
134 different are very close.
135
136 - :math:`\tau_m != \tau_{syn_{ex,in}}` is required by the current
137 implementation to avoid a degenerate case of the ODE describing the
138 model :footcite:p:`Rotter1999`. For very similar values, numerics will be unstable.
139
140 - Some parameter values given in Table 1 of :footcite:p:`Yamauchi2011` are incorrect. For
141 correct values, see Table 4 of :footcite:p:`Heiberg2018`.
142
143References
144++++++++++
145
146.. footbibliography::
147
148Sends
149+++++
150
151SpikeEvent
152
153Receives
154++++++++
155
156SpikeEvent, CurrentEvent, DataLoggingRequest
157
158Examples using this model
159+++++++++++++++++++++++++
160
161.. listexamples:: amat2_psc_exp
162
163EndUserDocs */
164
165void register_amat2_psc_exp( const std::string& name );
166
168{
169
170public:
173
179 using Node::handle;
181
182 size_t send_test_event( Node&, size_t, synindex, bool ) override;
183
184 size_t handles_test_event( SpikeEvent&, size_t ) override;
185 size_t handles_test_event( CurrentEvent&, size_t ) override;
186 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
187
188 void handle( SpikeEvent& ) override;
189 void handle( CurrentEvent& ) override;
190 void handle( DataLoggingRequest& ) override;
191
192 void get_status( Dictionary& ) const override;
193 void set_status( const Dictionary& ) override;
194
195private:
196 void init_buffers_() override;
197 void pre_run_hook() override;
198 void update( Time const&, const long, const long ) override;
199
200 // The next two classes need to be friends to access private members
201 friend class RecordablesMap< amat2_psc_exp >;
202 friend class UniversalDataLogger< amat2_psc_exp >;
203
204 // ----------------------------------------------------------------
205
210 {
212 double Tau_;
213
215 double C_;
216
218 double tau_ref_;
219
221 double E_L_;
222
224 double I_e_;
225
227 double tau_ex_;
228
230 double tau_in_;
231
233 double tau_1_;
234 double tau_2_;
235
237 double alpha_1_;
238 double alpha_2_;
239
241 double beta_;
242
244 double tau_v_;
245
250 double omega_;
251
252 Parameters_();
253
254 void get( Dictionary& ) const;
255
259 double set( const Dictionary&, Node* node );
260 };
261
262 // ----------------------------------------------------------------
263
267 struct State_
268 {
269 // state variables
270 double i_0_;
271 double I_syn_ex_;
272 double I_syn_in_;
273 double V_m_;
274 double V_th_1_;
276 double V_th_2_;
278 double V_th_dv_;
280 double V_th_v_;
281
282 int r_;
283
284 State_();
285
286 void get( Dictionary&, const Parameters_& ) const;
287
293 void set( const Dictionary&, const Parameters_&, double, Node* );
294 };
295
296 // ----------------------------------------------------------------
297
314
315 // ----------------------------------------------------------------
316
321 {
322
328 // double PSCInitialValue_;
329
330 double P00_; // constant currents
331 double P11_;
332 double P22_;
333 double P30_;
334 double P31_;
335 double P32_;
336 double P33_;
337 double P44_;
338 double P55_;
339 double P60_;
340 double P61_;
341 double P62_;
342 double P63_;
343 double P66_;
344 double P70_;
345 double P71_;
346 double P72_;
347 double P73_;
348 double P76_;
349 double P77_;
350
352 };
353 // ----------------------------------------------------------------
354
356 inline double
357 get_V_m_() const
358 {
359 return S_.V_m_ + P_.E_L_;
360 }
361
362 inline double
363 get_V_th_() const
364 {
365 return P_.E_L_ + P_.omega_ + S_.V_th_1_ + S_.V_th_2_ + S_.V_th_v_;
366 }
367
368 inline double
370 {
371 return S_.V_th_v_;
372 }
373
374 inline double
376 {
377 return S_.I_syn_ex_;
378 }
379
380 inline double
382 {
383 return S_.I_syn_in_;
384 }
385
386 // ----------------------------------------------------------------
387
399
402};
403
404
405inline size_t
406amat2_psc_exp::send_test_event( Node& target, size_t receptor_type, synindex, bool )
407{
408 SpikeEvent e;
409 e.set_sender( *this );
410
411 return target.handles_test_event( e, receptor_type );
412}
413
414inline size_t
416{
417 if ( receptor_type != 0 )
418 {
419 throw UnknownReceptorType( receptor_type, get_name() );
420 }
421 return 0;
422}
423
424inline size_t
426{
427 if ( receptor_type != 0 )
428 {
429 throw UnknownReceptorType( receptor_type, get_name() );
430 }
431 return 0;
432}
433
434inline size_t
436{
437 if ( receptor_type != 0 )
438 {
439 throw UnknownReceptorType( receptor_type, get_name() );
440 }
441 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
442}
443
444inline void
446{
447 P_.get( d );
448 S_.get( d, P_ );
450
451 d[ names::recordables ] = recordablesMap_.get_list();
452}
453
454inline void
456{
457 Parameters_ ptmp = P_; // temporary copy in case of errors
458 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
459 State_ stmp = S_; // temporary copy in case of errors
460 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
461
462 // We now know that (ptmp, stmp) are consistent. We do not
463 // write them back to (P_, S_) before we are also sure that
464 // the properties to be set in the parent class are internally
465 // consistent.
467
468 // if we get here, temporaries contain consistent set of properties
469 P_ = ptmp;
470 S_ = stmp;
471}
472
473} // namespace
474
475#endif // AMAT2_PSC_EXP_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
double get_V_th_() const
Definition amat2_psc_exp.h:363
State_ S_
Definition amat2_psc_exp.h:395
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition amat2_psc_exp.cpp:427
double get_I_syn_ex_() const
Definition amat2_psc_exp.h:375
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition amat2_psc_exp.h:415
size_t send_test_event(Node &, size_t, synindex, bool) override
Send an event to the receiving_node passed as an argument.
Definition amat2_psc_exp.h:406
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition amat2_psc_exp.h:394
static RecordablesMap< amat2_psc_exp > recordablesMap_
Mapping of recordables names to access functions.
Definition amat2_psc_exp.h:401
double get_V_m_() const
Read out state variables, used by UniversalDataLogger.
Definition amat2_psc_exp.h:357
Buffers_ B_
Definition amat2_psc_exp.h:397
amat2_psc_exp()
Definition amat2_psc_exp.cpp:228
double get_I_syn_in_() const
Definition amat2_psc_exp.h:381
double get_V_th_v_() const
Definition amat2_psc_exp.h:369
friend class RecordablesMap< amat2_psc_exp >
Definition amat2_psc_exp.h:201
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition amat2_psc_exp.h:445
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition amat2_psc_exp.h:455
Variables_ V_
Definition amat2_psc_exp.h:396
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition amat2_psc_exp.cpp:262
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition amat2_psc_exp.cpp:366
friend class UniversalDataLogger< amat2_psc_exp >
Definition amat2_psc_exp.h:202
void init_buffers_() override
Configure persistent internal data structures.
Definition amat2_psc_exp.cpp:250
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
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121
void register_amat2_psc_exp(const std::string &name)
Definition amat2_psc_exp.cpp:46
Buffers of the model.
Definition amat2_psc_exp.h:302
Buffers_(amat2_psc_exp &)
Sets buffer pointers to 0.
Definition amat2_psc_exp.cpp:210
RingBuffer currents_
Definition amat2_psc_exp.h:309
RingBuffer spikes_in_
Definition amat2_psc_exp.h:308
UniversalDataLogger< amat2_psc_exp > logger_
Logger for all analog data.
Definition amat2_psc_exp.h:312
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition amat2_psc_exp.h:307
Independent parameters of the model.
Definition amat2_psc_exp.h:210
double tau_ex_
Time constant of excitatory synaptic current in ms.
Definition amat2_psc_exp.h:227
double C_
Membrane capacitance in pF.
Definition amat2_psc_exp.h:215
double E_L_
Resting potential in mV.
Definition amat2_psc_exp.h:221
double tau_1_
Short and long time constant of adaptive threshold in ms.
Definition amat2_psc_exp.h:233
double tau_in_
Time constant of inhibitory synaptic current in ms.
Definition amat2_psc_exp.h:230
double omega_
Resting threshold in mV (relative to resting potential).
Definition amat2_psc_exp.h:250
void get(Dictionary &) const
Store current values in dictionary.
Definition amat2_psc_exp.cpp:109
double set(const Dictionary &, Node *node)
Set values from dictionary.
Definition amat2_psc_exp.cpp:128
double I_e_
External current in pA.
Definition amat2_psc_exp.h:224
double alpha_2_
Definition amat2_psc_exp.h:238
double alpha_1_
Amplitudes of threshold adaption in mV.
Definition amat2_psc_exp.h:237
Parameters_()
Sets default parameter values.
Definition amat2_psc_exp.cpp:71
double Tau_
Membrane time constant in ms.
Definition amat2_psc_exp.h:212
double tau_v_
Time-constant for voltage-dependent threshold component in ms.
Definition amat2_psc_exp.h:244
double tau_ref_
Refractory period in ms.
Definition amat2_psc_exp.h:218
double tau_2_
Definition amat2_psc_exp.h:234
double beta_
Scaling coefficient for voltage-dependent threshold component in 1/ms.
Definition amat2_psc_exp.h:241
State variables of the model.
Definition amat2_psc_exp.h:268
double V_th_2_
Definition amat2_psc_exp.h:276
void get(Dictionary &, const Parameters_ &) const
Definition amat2_psc_exp.cpp:183
double V_th_1_
Definition amat2_psc_exp.h:274
double V_th_v_
voltage dependent threshold, variable 7
Definition amat2_psc_exp.h:280
void set(const Dictionary &, const Parameters_ &, double, Node *)
Set values from dictionary.
Definition amat2_psc_exp.cpp:194
double V_th_dv_
Definition amat2_psc_exp.h:278
double I_syn_ex_
postsynaptic current for exc. inputs, variable 1
Definition amat2_psc_exp.h:271
double I_syn_in_
postsynaptic current for inh. inputs, variable 2
Definition amat2_psc_exp.h:272
double V_m_
membrane potential, variable 3
Definition amat2_psc_exp.h:273
double i_0_
synaptic dc input current, variable 0
Definition amat2_psc_exp.h:270
State_()
Default initialization.
Definition amat2_psc_exp.cpp:91
int r_
total refractory counter (no spikes can be generated)
Definition amat2_psc_exp.h:282
Internal variables of the model.
Definition amat2_psc_exp.h:321
double P73_
Definition amat2_psc_exp.h:347
double P55_
Definition amat2_psc_exp.h:338
double P33_
Definition amat2_psc_exp.h:336
double P66_
Definition amat2_psc_exp.h:343
double P22_
Definition amat2_psc_exp.h:332
double P72_
Definition amat2_psc_exp.h:346
double P76_
Definition amat2_psc_exp.h:348
double P71_
Definition amat2_psc_exp.h:345
double P00_
Amplitude of the synaptic current.
Definition amat2_psc_exp.h:330
double P32_
Definition amat2_psc_exp.h:335
double P44_
Definition amat2_psc_exp.h:337
double P60_
Definition amat2_psc_exp.h:339
double P62_
Definition amat2_psc_exp.h:341
double P30_
Definition amat2_psc_exp.h:333
double P31_
Definition amat2_psc_exp.h:334
double P11_
Definition amat2_psc_exp.h:331
double P63_
Definition amat2_psc_exp.h:342
int RefractoryCountsTot_
Definition amat2_psc_exp.h:351
double P70_
Definition amat2_psc_exp.h:344
double P61_
Definition amat2_psc_exp.h:340
double P77_
Definition amat2_psc_exp.h:349