NEST main@f146f75
Loading...
Searching...
No Matches
iaf_psc_exp_htum.h
Go to the documentation of this file.
1/*
2 * iaf_psc_exp_htum.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 iaf_psc_exp_htum_H
25#define iaf_psc_exp_htum_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 "ring_buffer.h"
34
35namespace nest
36{
37
38/* BeginUserDocs: neuron, integrate-and-fire, hard threshold
39
40Short description
41+++++++++++++++++
42
43Leaky integrate-and-fire model with separate relative and absolute refractory period
44
45Description
46+++++++++++
47
48``iaf_psc_exp_htum`` is an implementation of a leaky integrate-and-fire model
49with exponential shaped postsynaptic currents (PSCs) according to :footcite:p:`Tsodyks2000`.
50The postsynaptic currents have an infinitely short rise time.
51In particular, this model allows setting an absolute and relative
52refractory time separately, as required by :footcite:p:`Tsodyks2000`.
53
54The threshold crossing is followed by an absolute refractory period
55(``t_ref_abs``) during which the membrane potential is clamped to the resting
56potential. During the total refractory period (``t_ref_tot``), the membrane
57potential evolves, but the neuron will not emit a spike, even if the
58membrane potential reaches threshold. The total refractory time must be
59larger or equal to the absolute refractory time. If equal, the
60refractoriness of the model if equivalent to the other models of NEST.
61
62The linear subthreshold dynamics is integrated by the Exact
63Integration scheme :footcite:p:`Hill1936`. 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:`Hill1936`. A flow chart can be found in :footcite:p:`Rotter1999`.
73
74.. note::
75
76 The present implementation uses individual variables for the
77 components of the state vector and the non-zero matrix elements of
78 the propagator. Because the propagator is a lower triangular matrix,
79 no full matrix multiplication needs to be carried out and the
80 computation can be done "in place", i.e. no temporary state vector
81 object is required.
82
83 The template support of recent C++ compilers enables a more succinct
84 formulation without loss of runtime performance already at minimal
85 optimization levels. A future version of iaf_psc_exp_htum will probably
86 address the problem of efficient usage of appropriate vector and
87 matrix objects.
88
89.. note::
90
91 If ``tau_m`` is very close to ``tau_syn_ex`` or ``tau_syn_in``, the model
92 will numerically behave as if ``tau_m`` is equal to ``tau_syn_ex`` or
93 ``tau_syn_in``, respectively, to avoid numerical instabilities.
94
95 For implementation details see the
96 `IAF Integration Singularity notebook <../model_details/IAF_Integration_Singularity.ipynb>`_.
97
98
99See also :footcite:p:`Diesmann2001`.
100
101.. note::
102
103 Incoming spikes are routed to the excitatory or inhibitory synapse type by the **sign of the
104 connection weight**. A positive weight targets the excitatory synapse type, a negative weight
105 the inhibitory one, and also sets the direction of the post-synaptic current.
106 Spike connections must use the default ``receptor_type`` of 0.
107
108 See :ref:`synapse_selection` for the conventions used by other models.
109
110Parameters
111++++++++++
112
113The following parameters can be set in the status dictionary.
114
115=========== ====== ========================================================
116 E_L mV Resting membrane potenial
117 C_m pF Capacity of the membrane
118 tau_m ms Membrane time constant
119 tau_syn_ex ms Time constant of postsynaptic excitatory currents
120 tau_syn_in ms Time constant of postsynaptic inhibitory currents
121 t_ref_abs ms Duration of absolute refractory period (V_m = V_reset)
122 t_ref_tot ms Duration of total refractory period (no spiking)
123 V_m mV Membrane potential
124 V_th mV Spike threshold
125 V_reset mV Reset membrane potential after a spike
126 I_e pA Constant input current
127 t_spike ms Point in time of last spike
128=========== ====== ========================================================
129
130References
131++++++++++
132
133.. footbibliography::
134
135Sends
136+++++
137
138SpikeEvent
139
140Receives
141++++++++
142
143SpikeEvent, CurrentEvent, DataLoggingRequest
144
145Examples using this model
146+++++++++++++++++++++++++
147
148.. listexamples:: iaf_psc_exp_htum
149
150EndUserDocs */
151
152void register_iaf_psc_exp_htum( const std::string& name );
153
155{
156
157public:
160
166 using Node::handle;
168
169 size_t send_test_event( Node&, size_t, synindex, bool ) override;
170
171 void handle( SpikeEvent& ) override;
172 void handle( CurrentEvent& ) override;
173 void handle( DataLoggingRequest& ) override;
174
175 size_t handles_test_event( SpikeEvent&, size_t ) override;
176 size_t handles_test_event( CurrentEvent&, size_t ) override;
177 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
178
179 void get_status( Dictionary& ) const override;
180 void set_status( const Dictionary& ) override;
181
182private:
183 void init_buffers_() override;
184 void pre_run_hook() override;
185
186 void update( Time const&, const long, const long ) override;
187
188 // The next two classes need to be friends to access the State_ class/member
189 friend class RecordablesMap< iaf_psc_exp_htum >;
190 friend class UniversalDataLogger< iaf_psc_exp_htum >;
191
192 // ----------------------------------------------------------------
193
198 {
200 double Tau_;
201
203 double C_;
204
208
210 double E_L_;
211
213 double I_e_;
214
217 double Theta_;
218
220 double V_reset_;
221
223 double tau_ex_;
224
226 double tau_in_;
227
228 Parameters_();
229
230 void get( Dictionary& ) const;
231
235 double set( const Dictionary&, Node* node );
236 };
237
238 // ----------------------------------------------------------------
239
243 struct State_
244 {
245 // state variables
246 double i_0_;
247 double i_syn_ex_;
248 double i_syn_in_;
249 double V_m_;
250
253 int r_tot_;
254
255 State_();
256
257 void get( Dictionary&, const Parameters_& ) const;
258
264 void set( const Dictionary&, const Parameters_&, double delta_EL, Node* );
265 };
266
267 // ----------------------------------------------------------------
268
285
286 // ----------------------------------------------------------------
287
292 {
298 // double PSCInitialValue_;
299
300 // time evolution operator
301 double P20_;
302 double P11ex_;
303 double P11in_;
304 double P21ex_;
305 double P21in_;
306 double P22_;
307
310 };
311
312 // Access functions for UniversalDataLogger -------------------------------
313
315 double
316 get_V_m_() const
317 {
318 return S_.V_m_;
319 }
320 double
322 {
323 return S_.i_syn_ex_;
324 }
325 double
327 {
328 return S_.i_syn_in_;
329 }
330
331 // ----------------------------------------------------------------
332
344
347};
348
349
350inline size_t
351iaf_psc_exp_htum::send_test_event( Node& target, size_t receptor_type, synindex, bool )
352{
353 SpikeEvent e;
354 e.set_sender( *this );
355 return target.handles_test_event( e, receptor_type );
356}
357
358inline size_t
360{
361 if ( receptor_type != 0 )
362 {
363 throw UnknownReceptorType( receptor_type, get_name() );
364 }
365 return 0;
366}
367
368inline size_t
370{
371 if ( receptor_type != 0 )
372 {
373 throw UnknownReceptorType( receptor_type, get_name() );
374 }
375 return 0;
376}
377
378inline size_t
380{
381 if ( receptor_type != 0 )
382 {
383 throw UnknownReceptorType( receptor_type, get_name() );
384 }
385 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
386}
387
388
389inline void
391{
392 P_.get( d );
393 S_.get( d, P_ );
395 d[ names::recordables ] = recordablesMap_.get_list();
396}
397
398inline void
400{
401 Parameters_ ptmp = P_; // temporary copy in case of errors
402 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
403 State_ stmp = S_; // temporary copy in case of errors
404 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
405
406 // We now know that (ptmp, stmp) are consistent. We do not
407 // write them back to (P_, S_) before we are also sure that
408 // the properties to be set in the parent class are internally
409 // consistent.
411
412 // if we get here, temporaries contain consistent set of properties
413 P_ = ptmp;
414 S_ = stmp;
415}
416
417} // namespace
418
419#endif // iaf_psc_exp_htum_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
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_psc_exp_htum.h:390
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition iaf_psc_exp_htum.cpp:230
void init_buffers_() override
Configure persistent internal data structures.
Definition iaf_psc_exp_htum.cpp:220
iaf_psc_exp_htum()
Definition iaf_psc_exp_htum.cpp:198
double get_I_syn_ex_() const
Definition iaf_psc_exp_htum.h:321
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_psc_exp_htum.h:339
friend class UniversalDataLogger< iaf_psc_exp_htum >
Definition iaf_psc_exp_htum.h:190
Buffers_ B_
Definition iaf_psc_exp_htum.h:342
double get_I_syn_in_() const
Definition iaf_psc_exp_htum.h:326
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_psc_exp_htum.h:316
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_exp_htum.h:351
void update(Time const &, const long, const long) override
Advance the state of the node in time through the given interval.
Definition iaf_psc_exp_htum.cpp:296
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_psc_exp_htum.cpp:351
static RecordablesMap< iaf_psc_exp_htum > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_psc_exp_htum.h:346
friend class RecordablesMap< iaf_psc_exp_htum >
Definition iaf_psc_exp_htum.h:189
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_psc_exp_htum.h:399
Variables_ V_
Definition iaf_psc_exp_htum.h:341
size_t handles_test_event(SpikeEvent &, size_t) override
Check if the node can handle a particular event and receptor type.
Definition iaf_psc_exp_htum.h:359
State_ S_
Definition iaf_psc_exp_htum.h:340
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_exp_htum(const std::string &name)
Definition iaf_psc_exp_htum.cpp:45
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121
Buffers of the model.
Definition iaf_psc_exp_htum.h:273
Buffers_(iaf_psc_exp_htum &)
Definition iaf_psc_exp_htum.cpp:184
UniversalDataLogger< iaf_psc_exp_htum > logger_
Logger for all analog data.
Definition iaf_psc_exp_htum.h:283
RingBuffer currents_
Definition iaf_psc_exp_htum.h:280
RingBuffer spikes_in_
Definition iaf_psc_exp_htum.h:279
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition iaf_psc_exp_htum.h:278
Independent parameters of the model.
Definition iaf_psc_exp_htum.h:198
Parameters_()
Sets default parameter values.
Definition iaf_psc_exp_htum.cpp:66
double tau_ex_
Time constant of excitatory synaptic current in ms.
Definition iaf_psc_exp_htum.h:223
double V_reset_
reset value of the membrane potential
Definition iaf_psc_exp_htum.h:220
double Theta_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_exp_htum.h:217
double E_L_
Resting potential in mV.
Definition iaf_psc_exp_htum.h:210
double C_
Membrane capacitance in pF.
Definition iaf_psc_exp_htum.h:203
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_psc_exp_htum.cpp:95
double Tau_
Membrane time constant in ms.
Definition iaf_psc_exp_htum.h:200
double tau_in_
Time constant of inhibitory synaptic current in ms.
Definition iaf_psc_exp_htum.h:226
double set(const Dictionary &, Node *node)
Set values from dictionary.
Definition iaf_psc_exp_htum.cpp:110
double tau_ref_tot_
Refractory period in ms.
Definition iaf_psc_exp_htum.h:206
double I_e_
External current in pA.
Definition iaf_psc_exp_htum.h:213
double tau_ref_abs_
Definition iaf_psc_exp_htum.h:207
State variables of the model.
Definition iaf_psc_exp_htum.h:244
int r_abs_
absolute refractory counter (no membrane potential propagation)
Definition iaf_psc_exp_htum.h:252
double V_m_
membrane potential, variable 2
Definition iaf_psc_exp_htum.h:249
double i_0_
synaptic dc input current, variable 0
Definition iaf_psc_exp_htum.h:246
double i_syn_ex_
postsynaptic current for exc. inputs, variable 1
Definition iaf_psc_exp_htum.h:247
State_()
Default initialization.
Definition iaf_psc_exp_htum.cpp:80
void get(Dictionary &, const Parameters_ &) const
Definition iaf_psc_exp_htum.cpp:166
int r_tot_
total refractory counter (no spikes can be generated)
Definition iaf_psc_exp_htum.h:253
double i_syn_in_
postsynaptic current for inh. inputs, variable 1
Definition iaf_psc_exp_htum.h:248
void set(const Dictionary &, const Parameters_ &, double delta_EL, Node *)
Set values from dictionary.
Definition iaf_psc_exp_htum.cpp:172
Internal variables of the model.
Definition iaf_psc_exp_htum.h:292
double P20_
Amplitude of the synaptic current.
Definition iaf_psc_exp_htum.h:301
double P21in_
Definition iaf_psc_exp_htum.h:305
int RefractoryCountsTot_
Definition iaf_psc_exp_htum.h:309
double P21ex_
Definition iaf_psc_exp_htum.h:304
double P22_
Definition iaf_psc_exp_htum.h:306
int RefractoryCountsAbs_
Definition iaf_psc_exp_htum.h:308
double P11ex_
Definition iaf_psc_exp_htum.h:302
double P11in_
Definition iaf_psc_exp_htum.h:303