NEST main@caf0ae8
 
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
101Parameters
102++++++++++
103
104The following parameters can be set in the status dictionary.
105
106=========== ====== ========================================================
107 E_L mV Resting membrane potenial
108 C_m pF Capacity of the membrane
109 tau_m ms Membrane time constant
110 tau_syn_ex ms Time constant of postsynaptic excitatory currents
111 tau_syn_in ms Time constant of postsynaptic inhibitory currents
112 t_ref_abs ms Duration of absolute refractory period (V_m = V_reset)
113 t_ref_tot ms Duration of total refractory period (no spiking)
114 V_m mV Membrane potential
115 V_th mV Spike threshold
116 V_reset mV Reset membrane potential after a spike
117 I_e pA Constant input current
118 t_spike ms Point in time of last spike
119=========== ====== ========================================================
120
121References
122++++++++++
123
124.. footbibliography::
125
126Sends
127+++++
128
129SpikeEvent
130
131Receives
132++++++++
133
134SpikeEvent, CurrentEvent, DataLoggingRequest
135
136Examples using this model
137+++++++++++++++++++++++++
138
139.. listexamples:: iaf_psc_exp_htum
140
141EndUserDocs */
142
143void register_iaf_psc_exp_htum( const std::string& name );
144
146{
147
148public:
151
157 using Node::handle;
159
160 size_t send_test_event( Node&, size_t, synindex, bool ) override;
161
162 void handle( SpikeEvent& ) override;
163 void handle( CurrentEvent& ) override;
164 void handle( DataLoggingRequest& ) override;
165
166 size_t handles_test_event( SpikeEvent&, size_t ) override;
167 size_t handles_test_event( CurrentEvent&, size_t ) override;
168 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
169
170 void get_status( Dictionary& ) const override;
171 void set_status( const Dictionary& ) override;
172
173private:
174 void init_buffers_() override;
175 void pre_run_hook() override;
176
177 void update( Time const&, const long, const long ) override;
178
179 // The next two classes need to be friends to access the State_ class/member
180 friend class RecordablesMap< iaf_psc_exp_htum >;
181 friend class UniversalDataLogger< iaf_psc_exp_htum >;
182
183 // ----------------------------------------------------------------
184
189 {
191 double Tau_;
192
194 double C_;
195
199
201 double E_L_;
202
204 double I_e_;
205
208 double Theta_;
209
211 double V_reset_;
212
214 double tau_ex_;
215
217 double tau_in_;
218
219 Parameters_();
220
221 void get( Dictionary& ) const;
222
226 double set( const Dictionary&, Node* node );
227 };
228
229 // ----------------------------------------------------------------
230
234 struct State_
235 {
236 // state variables
237 double i_0_;
238 double i_syn_ex_;
239 double i_syn_in_;
240 double V_m_;
241
244 int r_tot_;
245
246 State_();
247
248 void get( Dictionary&, const Parameters_& ) const;
249
255 void set( const Dictionary&, const Parameters_&, double delta_EL, Node* );
256 };
257
258 // ----------------------------------------------------------------
259
276
277 // ----------------------------------------------------------------
278
283 {
289 // double PSCInitialValue_;
290
291 // time evolution operator
292 double P20_;
293 double P11ex_;
294 double P11in_;
295 double P21ex_;
296 double P21in_;
297 double P22_;
298
301 };
302
303 // Access functions for UniversalDataLogger -------------------------------
304
306 double
307 get_V_m_() const
308 {
309 return S_.V_m_;
310 }
311 double
313 {
314 return S_.i_syn_ex_;
315 }
316 double
318 {
319 return S_.i_syn_in_;
320 }
321
322 // ----------------------------------------------------------------
323
338};
339
340
341inline size_t
342iaf_psc_exp_htum::send_test_event( Node& target, size_t receptor_type, synindex, bool )
343{
344 SpikeEvent e;
345 e.set_sender( *this );
346 return target.handles_test_event( e, receptor_type );
347}
348
349inline size_t
351{
352 if ( receptor_type != 0 )
353 {
354 throw UnknownReceptorType( receptor_type, get_name() );
355 }
356 return 0;
357}
358
359inline size_t
361{
362 if ( receptor_type != 0 )
363 {
364 throw UnknownReceptorType( receptor_type, get_name() );
365 }
366 return 0;
367}
368
369inline size_t
371{
372 if ( receptor_type != 0 )
373 {
374 throw UnknownReceptorType( receptor_type, get_name() );
375 }
376 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
377}
378
379
380inline void
382{
383 P_.get( d );
384 S_.get( d, P_ );
386 d[ names::recordables ] = recordablesMap_.get_list();
387}
388
389inline void
391{
392 Parameters_ ptmp = P_; // temporary copy in case of errors
393 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
394 State_ stmp = S_; // temporary copy in case of errors
395 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
396
397 // We now know that (ptmp, stmp) are consistent. We do not
398 // write them back to (P_, S_) before we are also sure that
399 // the properties to be set in the parent class are internally
400 // consistent.
402
403 // if we get here, temporaries contain consistent set of properties
404 P_ = ptmp;
405 S_ = stmp;
406}
407
408} // namespace
409
410#endif // iaf_psc_exp_htum_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_exp_htum.h:146
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_psc_exp_htum.h:381
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:312
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_psc_exp_htum.h:330
friend class UniversalDataLogger< iaf_psc_exp_htum >
Definition iaf_psc_exp_htum.h:181
Buffers_ B_
Definition iaf_psc_exp_htum.h:333
double get_I_syn_in_() const
Definition iaf_psc_exp_htum.h:317
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_psc_exp_htum.h:307
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:342
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:337
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_psc_exp_htum.h:390
Variables_ V_
Definition iaf_psc_exp_htum.h:332
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:350
State_ S_
Definition iaf_psc_exp_htum.h:331
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_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:115
Buffers of the model.
Definition iaf_psc_exp_htum.h:264
UniversalDataLogger< iaf_psc_exp_htum > logger_
Logger for all analog data.
Definition iaf_psc_exp_htum.h:274
RingBuffer currents_
Definition iaf_psc_exp_htum.h:271
RingBuffer spikes_in_
Definition iaf_psc_exp_htum.h:270
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition iaf_psc_exp_htum.h:269
Independent parameters of the model.
Definition iaf_psc_exp_htum.h:189
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:214
double V_reset_
reset value of the membrane potential
Definition iaf_psc_exp_htum.h:211
double Theta_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_exp_htum.h:208
double E_L_
Resting potential in mV.
Definition iaf_psc_exp_htum.h:201
double C_
Membrane capacitance in pF.
Definition iaf_psc_exp_htum.h:194
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:191
double tau_in_
Time constant of inhibitory synaptic current in ms.
Definition iaf_psc_exp_htum.h:217
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:197
double I_e_
External current in pA.
Definition iaf_psc_exp_htum.h:204
double tau_ref_abs_
Definition iaf_psc_exp_htum.h:198
State variables of the model.
Definition iaf_psc_exp_htum.h:235
int r_abs_
absolute refractory counter (no membrane potential propagation)
Definition iaf_psc_exp_htum.h:243
double V_m_
membrane potential, variable 2
Definition iaf_psc_exp_htum.h:240
double i_0_
synaptic dc input current, variable 0
Definition iaf_psc_exp_htum.h:237
double i_syn_ex_
postsynaptic current for exc. inputs, variable 1
Definition iaf_psc_exp_htum.h:238
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:244
double i_syn_in_
postsynaptic current for inh. inputs, variable 1
Definition iaf_psc_exp_htum.h:239
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:283
double P20_
Amplitude of the synaptic current.
Definition iaf_psc_exp_htum.h:292
double P21in_
Definition iaf_psc_exp_htum.h:296
int RefractoryCountsTot_
Definition iaf_psc_exp_htum.h:300
double P21ex_
Definition iaf_psc_exp_htum.h:295
double P22_
Definition iaf_psc_exp_htum.h:297
int RefractoryCountsAbs_
Definition iaf_psc_exp_htum.h:299
double P11ex_
Definition iaf_psc_exp_htum.h:293
double P11in_
Definition iaf_psc_exp_htum.h:294