NEST main@caf0ae8
 
Loading...
Searching...
No Matches
iaf_psc_delta_ps.h
Go to the documentation of this file.
1/*
2 * iaf_psc_delta_ps.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_PS_H
24#define IAF_PSC_DELTA_PS_H
25
26// Generated includes:
27#include "config.h"
28
29// Includes from nestkernel:
30#include "archiving_node.h"
31#include "connection.h"
32#include "event.h"
33#include "nest_types.h"
34#include "ring_buffer.h"
35#include "slice_ring_buffer.h"
37
38namespace nest
39{
40
41/* BeginUserDocs: neuron, integrate-and-fire, current-based, precise, hard threshold
42
43Short description
44+++++++++++++++++
45
46Current-based leaky integrate-and-fire neuron model with delta-shaped
47postsynaptic currents - precise spike timing version
48
49Description
50+++++++++++
51
52``iaf_psc_delta_ps`` is an implementation of a leaky integrate-and-fire model
53where the potential jumps on each spike arrival.
54
55The threshold crossing is followed by an absolute refractory period
56during which the membrane potential is clamped to the resting
57potential.
58
59Spikes arriving while the neuron is refractory, are discarded by
60default. If the property "refractory_input" is set to true, such
61spikes are added to the membrane potential at the end of the
62refractory period, dampened according to the interval between
63arrival and end of refractoriness.
64
65The linear subthreshold dynamics is integrated by the Exact
66Integration scheme :footcite:p:`Rotter1999`. The neuron dynamics are solved exactly in
67time. Incoming and outgoing spike times are handled precisely :footcite:p:`Morrison2007a`.
68
69An additional state variable and the corresponding differential
70equation represents a piecewise constant external current.
71
72Spikes can occur either on receipt of an excitatory input spike, or
73be caused by a depolarizing input current. Spikes evoked by
74incoming spikes, will occur precisely at the time of spike arrival,
75since incoming spikes are modeled as instantaneous potential
76jumps. Times of spikes caused by current input are determined
77exactly by solving the membrane potential equation. Note that, in
78contrast to the neuron models discussed in :footcite:p:`Morrison2007a` :footcite:p:`Hanuschkin2010`, this model has so
79simple dynamics that no interpolation or iterative spike location
80technique is required at all.
81
82The general framework for the consistent formulation of systems with
83neuron like dynamics interacting by point events is described in
84:footcite:p:`Rotter1999`. A flow chart can be found in :footcite:p:`Diesmann2001`.
85
86Critical tests for the formulation of the neuron model are the
87comparisons of simulation results for different computation step
88sizes and the testsuite contains a number of such tests.
89
90The ``iaf_psc_delta_ps`` is the standard model used to check the consistency
91of the nest simulation kernel because it is at the same time complex
92enough to exhibit non-trivial dynamics and simple enough compute
93relevant measures analytically.
94
95Please note that this node is capable of sending precise spike times
96to target nodes (on-grid spike time plus offset).
97
98The ``af_psc_delta_ps`` neuron accepts connections transmitting
99``CurrentEvents``. These events transmit stepwise-constant currents which
100can only change at on-grid times.
101
102For details about exact subthreshold integration, please see
103:doc:`../neurons/exact-integration`.
104
105Parameters
106++++++++++
107
108The following parameters can be set in the status dictionary.
109
110================= ====== ==============================================================
111 V_m mV Membrane potential
112 E_L mV Resting membrane potential
113 C_m pF Capacitance of the membrane
114 tau_m ms Membrane time constant
115 t_ref ms Duration of refractory period
116 V_th ms Spike threshold
117 V_reset mV Reset potential of the membrane
118 I_e pA Constant input current
119 V_min mV Absolute lower value for the membrane potential
120 refractory_input (bool) If true, keep input during refractory period (default: false)
121================= ====== ==============================================================
122
123References
124++++++++++
125
126.. footbibliography::
127
128Sends
129+++++
130
131SpikeEvent
132
133Receives
134++++++++
135
136SpikeEvent, CurrentEvent, DataLoggingRequest
137
138See also
139++++++++
140
141iaf_psc_delta, iaf_psc_exp_ps
142
143Examples using this model
144+++++++++++++++++++++++++
145
146.. listexamples:: iaf_psc_delta_ps
147
148EndUserDocs */
149
150void register_iaf_psc_delta_ps( const std::string& name );
151
153{
154
155public:
161
170
176 using Node::handle;
178
179 size_t send_test_event( Node&, size_t, synindex, bool ) override;
180
181 size_t handles_test_event( SpikeEvent&, size_t ) override;
182 size_t handles_test_event( CurrentEvent&, size_t ) override;
183 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
184
185 void handle( SpikeEvent& ) override;
186 void handle( CurrentEvent& ) override;
187 void handle( DataLoggingRequest& ) override;
188
189 bool
190 is_off_grid() const override
191 {
192 return true;
193 } // uses off_grid events
194
195 void get_status( Dictionary& ) const override;
196 void set_status( const Dictionary& ) override;
197
198private:
204 void init_buffers_() override;
205
206 void pre_run_hook() override;
207 void update( Time const&, const long, const long ) override;
208
218 void emit_spike_( Time const& origin, const long lag, const double offset_U );
219
228 void emit_instant_spike_( Time const& origin, const long lag, const double spike_offset );
229
235 void propagate_( const double dt );
236
237 // ----------------------------------------------------------------
238
243 {
244
246 double tau_m_;
247
249 double c_m_;
250
252 double t_ref_;
253
255 double E_L_;
256
258 double I_e_;
259
262 double U_th_;
263
266 double U_min_;
267
272 double U_reset_;
273
274 Parameters_();
275
276 void get( Dictionary& ) const;
277
281 double set( const Dictionary&, Node* );
282 };
283
284
285 // The next two classes need to be friends to access the State_ class/member
286 friend class RecordablesMap< iaf_psc_delta_ps >;
287 friend class UniversalDataLogger< iaf_psc_delta_ps >;
288
289 // ----------------------------------------------------------------
290
294 struct State_
295 {
297 double U_;
298 double I_;
299
304
308
309 State_();
310
311 void get( Dictionary&, const Parameters_& ) const;
312
318 void set( const Dictionary&, const Parameters_&, double, Node* );
319 };
320
321 // ----------------------------------------------------------------
322
346
347 // ----------------------------------------------------------------
348
353 {
354 double exp_t_;
355 double expm1_t_;
356 double R_;
357
358 double h_ms_;
359
361
366 };
367
368 // Access functions for UniversalDataLogger -------------------------------
369
371 double
372 get_V_m_() const
373 {
374 return S_.U_ + P_.E_L_;
375 }
376
377 // ----------------------------------------------------------------
378
393};
394
395
396inline size_t
397iaf_psc_delta_ps::send_test_event( Node& target, size_t receptor_type, synindex, bool )
398{
399 SpikeEvent e;
400 e.set_sender( *this );
401 return target.handles_test_event( e, receptor_type );
402}
403
404inline size_t
406{
407 if ( receptor_type != 0 )
408 {
409 throw UnknownReceptorType( receptor_type, get_name() );
410 }
411 return 0;
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 B_.logger_.connect_logging_device( dlr, recordablesMap_ );
432}
433
434inline void
436{
437 P_.get( d );
438 S_.get( d, P_ );
440
441 d[ names::recordables ] = recordablesMap_.get_list();
442}
443
444inline void
446{
447 Parameters_ ptmp = P_; // temporary copy in case of errors
448 const double delta_EL = ptmp.set( d, this ); // throws if BadProperty
449 State_ stmp = S_; // temporary copy in case of errors
450 stmp.set( d, ptmp, delta_EL, this ); // throws if BadProperty
451
452 // We now know that (ptmp, stmp) are consistent. We do not
453 // write them back to (P_, S_) before we are also sure that
454 // the properties to be set in the parent class are internally
455 // consistent.
457
458 // if we get here, temporaries contain consistent set of properties
459 P_ = ptmp;
460 S_ = stmp;
461}
462
463} // namespace
464
465#endif // IAF_PSC_DELTA_PS_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
Queue for all spikes arriving into a neuron.
Definition slice_ring_buffer.h:63
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_delta_ps.h:153
void init_buffers_() override
Configure persistent internal data structures.
Definition iaf_psc_delta_ps.cpp:233
void emit_instant_spike_(Time const &origin, const long lag, const double spike_offset)
Instantaneously emit a spike at the precise time defined by origin, lag and spike_offset and reset th...
Definition iaf_psc_delta_ps.cpp:486
void handle(SpikeEvent &) override
Handle incoming spike events.
Definition iaf_psc_delta_ps.cpp:506
Buffers_ B_
Definition iaf_psc_delta_ps.h:388
friend class UniversalDataLogger< iaf_psc_delta_ps >
Definition iaf_psc_delta_ps.h:287
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_ps.cpp:263
void set_status(const Dictionary &) override
Change properties of the node according to the entries in the dictionary.
Definition iaf_psc_delta_ps.h:445
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_ps.h:405
void pre_run_hook() override
Re-calculate dependent parameters of the node.
Definition iaf_psc_delta_ps.cpp:244
void propagate_(const double dt)
Propagate neuron state.
Definition iaf_psc_delta_ps.cpp:450
Parameters_ P_
Instances of private data structures for the different types of data pertaining to the model.
Definition iaf_psc_delta_ps.h:385
static RecordablesMap< iaf_psc_delta_ps > recordablesMap_
Mapping of recordables names to access functions.
Definition iaf_psc_delta_ps.h:392
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_ps.h:397
bool is_off_grid() const override
Returns true if the node sends/receives off-grid events.
Definition iaf_psc_delta_ps.h:190
void emit_spike_(Time const &origin, const long lag, const double offset_U)
Calculate the precise spike time, emit the spike and reset the neuron.
Definition iaf_psc_delta_ps.cpp:462
Variables_ V_
Definition iaf_psc_delta_ps.h:387
double get_V_m_() const
Read out the real membrane potential.
Definition iaf_psc_delta_ps.h:372
void get_status(Dictionary &) const override
Export properties of the node by setting entries in the status dictionary.
Definition iaf_psc_delta_ps.h:435
State_ S_
Definition iaf_psc_delta_ps.h:386
iaf_psc_delta_ps()
Basic constructor.
Definition iaf_psc_delta_ps.cpp:211
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_delta_ps(const std::string &name)
Definition iaf_psc_delta_ps.cpp:45
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
Buffers of the model.
Definition iaf_psc_delta_ps.h:327
UniversalDataLogger< iaf_psc_delta_ps > logger_
Logger for all analog data.
Definition iaf_psc_delta_ps.h:344
RingBuffer currents_
Queue for incoming current events.
Definition iaf_psc_delta_ps.h:341
SliceRingBuffer events_
Queue for incoming events.
Definition iaf_psc_delta_ps.h:336
Independent parameters of the model.
Definition iaf_psc_delta_ps.h:243
double tau_m_
Membrane time constant in ms.
Definition iaf_psc_delta_ps.h:246
double E_L_
Resting potential in mV.
Definition iaf_psc_delta_ps.h:255
double I_e_
External DC current [pA].
Definition iaf_psc_delta_ps.h:258
Parameters_()
Sets default parameter values.
Definition iaf_psc_delta_ps.cpp:72
double c_m_
Membrane capacitance in pF.
Definition iaf_psc_delta_ps.h:249
void get(Dictionary &) const
Store current values in dictionary.
Definition iaf_psc_delta_ps.cpp:99
double set(const Dictionary &, Node *)
Set values from dictionary.
Definition iaf_psc_delta_ps.cpp:112
double U_reset_
Reset potential.
Definition iaf_psc_delta_ps.h:272
double U_th_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_delta_ps.h:262
double t_ref_
Refractory period in ms.
Definition iaf_psc_delta_ps.h:252
double U_min_
Lower bound, RELATIVE TO RESTING POTENTIAL(!).
Definition iaf_psc_delta_ps.h:266
State variables of the model.
Definition iaf_psc_delta_ps.h:295
void get(Dictionary &, const Parameters_ &) const
Definition iaf_psc_delta_ps.cpp:177
double U_
This is the membrane potential RELATIVE TO RESTING POTENTIAL.
Definition iaf_psc_delta_ps.h:297
long last_spike_step_
step of last spike, for reporting in status dict
Definition iaf_psc_delta_ps.h:301
bool with_refr_input_
spikes arriving during refractory period are counted
Definition iaf_psc_delta_ps.h:306
State_()
Default initialization.
Definition iaf_psc_delta_ps.cpp:84
double I_
This is the current to be applied during this time step.
Definition iaf_psc_delta_ps.h:298
double last_spike_offset_
offset of last spike, for reporting in status dict
Definition iaf_psc_delta_ps.h:302
bool is_refractory_
flag for refractoriness
Definition iaf_psc_delta_ps.h:305
void set(const Dictionary &, const Parameters_ &, double, Node *)
Set values from dictionary.
Definition iaf_psc_delta_ps.cpp:185
Internal variables of the model.
Definition iaf_psc_delta_ps.h:353
double exp_t_
$ e^{-t/\tau_m} $
Definition iaf_psc_delta_ps.h:354
double expm1_t_
$ e^{-t/\tau_m} - 1 $
Definition iaf_psc_delta_ps.h:355
long refractory_steps_
refractory time in steps
Definition iaf_psc_delta_ps.h:360
double R_
$ \frac{\tau_m}{c_m} $
Definition iaf_psc_delta_ps.h:356
double refr_spikes_buffer_
Accumulate spikes arriving during refractory period, discounted for decay until end of refractory per...
Definition iaf_psc_delta_ps.h:365
double h_ms_
duration of time step [ms]
Definition iaf_psc_delta_ps.h:358