NEST  2.6.0,not_revisioned_source_dir@0
iaf_tum_2000.h
Go to the documentation of this file.
1 /*
2  * iaf_tum_2000.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_TUM_2000_H
25 #define IAF_TUM_2000_H
26 
27 #include "nest.h"
28 #include "event.h"
29 #include "archiving_node.h"
30 #include "ring_buffer.h"
31 #include "connection.h"
32 
33 #include "universal_data_logger.h"
34 
35 namespace nest
36 {
37 
38  class Network;
39 
40  /* BeginDocumentation
41  Name: iaf_tum_2000 - Leaky integrate-and-fire neuron model with exponential PSCs.
42 
43  Description:
44 
45  iaf_tum_2000 is an implementation of a leaky integrate-and-fire model
46  with exponential shaped postsynaptic currents (PSCs) according to [1].
47  The postsynaptic currents have an infinitely short rise time.
48  In particular, this model allows setting an absolute and relative
49  refractory time separately, as requied by [1].
50 
51  The threshold crossing is followed by an absolute refractory period (tau_abs)
52  during which the membrane potential is clamped to the resting potential.
53  During the total refractory period, the membrane potential evolves,
54  but the neuron will not emit a spike, even if the membrane potential
55  reaches threshold. The total refratory time must be larger or equal to
56  the absolute refractory time. If equal, the refractoriness of the model
57  if equivalent to the other models of NEST.
58 
59  The linear subthresold dynamics is integrated by the Exact
60  Integration scheme [2]. The neuron dynamics is solved on the time
61  grid given by the computation step size. Incoming as well as emitted
62  spikes are forced to that grid.
63 
64  An additional state variable and the corresponding differential
65  equation represents a piecewise constant external current.
66 
67  The general framework for the consistent formulation of systems with
68  neuron like dynamics interacting by point events is described in
69  [2]. A flow chart can be found in [3].
70 
71  Remarks:
72 
73  The present implementation uses individual variables for the
74  components of the state vector and the non-zero matrix elements of
75  the propagator. Because the propagator is a lower triangular matrix
76  no full matrix multiplication needs to be carried out and the
77  computation can be done "in place" i.e. no temporary state vector
78  object is required.
79 
80  The template support of recent C++ compilers enables a more succinct
81  formulation without loss of runtime performance already at minimal
82  optimization levels. A future version of iaf_tum_2000 will probably
83  address the problem of efficient usage of appropriate vector and
84  matrix objects.
85 
86 
87  Parameters:
88 
89  The following parameters can be set in the status dictionary.
90 
91  E_L double - Resting membrane potential in mV.
92  C_m double - Capacity of the membrane in pF
93  tau_m double - Membrane time constant in ms.
94  tau_syn_ex double - Time constant of postsynaptic excitatory currents in ms
95  tau_syn_in double - Time constant of postsynaptic inhibitory currents in ms
96  t_ref_abs double - Duration of absolute refractory period (V_m = V_reset) in ms.
97  t_ref_tot double - Duration of total refractory period (no spiking) in ms.
98  V_m double - Membrane potential in mV
99  V_th double - Spike threshold in mV.
100  V_reset double - Reset membrane potential after a spike in mV.
101  I_e double - Constant input current in pA.
102  t_spike double - Point in time of last spike in ms.
103 
104  Note:
105  tau_m != tau_syn_{ex,in} is required by the current implementation to avoid a
106  degenerate case of the ODE describing the model [1]. For very similar values,
107  numerics will be unstable.
108 
109  References:
110  [1] Misha Tsodyks, Asher Uziel, and Henry Markram (2000) Synchrony Generation in Recurrent
111  Networks with Frequency-Dependent Synapses, The Journal of Neuroscience, 2000, Vol. 20 RC50 p. 1-5
112  [2] Rotter S & Diesmann M (1999) Exact simulation of time-invariant linear
113  systems with applications to neuronal modeling. Biologial Cybernetics
114  81:381-402.
115  [3] Diesmann M, Gewaltig M-O, Rotter S, & Aertsen A (2001) State space
116  analysis of synchronous spiking in cortical neural networks.
117  Neurocomputing 38-40:565-571.
118 
119  Sends: SpikeEvent
120 
121  Receives: SpikeEvent, CurrentEvent, DataLoggingRequest
122 
123  FirstVersion: March 2006
124  Author: Moritz Helias
125  */
126 
130  class iaf_tum_2000:
131  public Archiving_Node
132  {
133 
134  public:
135 
136  iaf_tum_2000();
137  iaf_tum_2000(const iaf_tum_2000&);
138 
143  using Node::handle;
145 
147 
148  void handle(SpikeEvent &);
149  void handle(CurrentEvent &);
150  void handle(DataLoggingRequest &);
151 
155 
156  void get_status(DictionaryDatum &) const;
157  void set_status(const DictionaryDatum &);
158 
159  private:
160 
161  void init_state_(const Node& proto);
162  void init_buffers_();
163  void calibrate();
164 
165  void update(Time const &, const long_t, const long_t);
166 
167  // The next two classes need to be friends to access the State_ class/member
169  friend class UniversalDataLogger<iaf_tum_2000>;
170 
171  // ----------------------------------------------------------------
172 
176  struct Parameters_ {
177 
180 
183 
187 
190 
193 
197 
200 
203 
206 
207  Parameters_();
208 
209  void get(DictionaryDatum&) const;
210 
214  double set(const DictionaryDatum&);
215  };
216 
217  // ----------------------------------------------------------------
218 
222  struct State_ {
223  // state variables
224  double_t i_0_; // synaptic dc input current, variable 0
225  double_t i_syn_ex_; // postsynaptic current for exc. inputs, variable 1
226  double_t i_syn_in_; // postsynaptic current for inh. inputs, variable 1
227  double_t V_m_; // membrane potential, variable 2
228 
229  int_t r_abs_; // absolute refractory counter (no membrane potential propagation)
230  int_t r_tot_; // total refractory counter (no spikes can be generated)
231 
232  State_();
233 
234  void get(DictionaryDatum&, const Parameters_&) const;
235 
241  void set(const DictionaryDatum&, const Parameters_&, double delta_EL);
242  };
243 
244  // ----------------------------------------------------------------
245 
249  struct Buffers_ {
251  Buffers_(const Buffers_ &, iaf_tum_2000 &);
252 
257 
260  };
261 
262  // ----------------------------------------------------------------
263 
267  struct Variables_ {
273  // double_t PSCInitialValue_;
274 
275  // time evolution operator
282 
285 
286  };
287 
288  // Access functions for UniversalDataLogger -------------------------------
289 
291  double_t get_V_m_() const { return S_.V_m_; }
292  double_t get_I_syn_ex_() const { return S_.i_syn_ex_; }
293  double_t get_I_syn_in_() const { return S_.i_syn_in_; }
294 
295  // ----------------------------------------------------------------
296 
312  };
313 
314 
315 
316 inline
318 {
319  SpikeEvent e;
320  e.set_sender(*this);
321  return target.handles_test_event(e, receptor_type);
322 }
323 
324 inline
326 {
327  if (receptor_type != 0)
328  throw UnknownReceptorType(receptor_type, get_name());
329  return 0;
330 }
331 
332 inline
334 {
335  if (receptor_type != 0)
336  throw UnknownReceptorType(receptor_type, get_name());
337  return 0;
338 }
339 
340 inline
343 {
344  if (receptor_type != 0)
345  throw UnknownReceptorType(receptor_type, get_name());
346  return B_.logger_.connect_logging_device(dlr, recordablesMap_);
347 }
348 
349 
350  inline
352  {
353  P_.get(d);
354  S_.get(d, P_);
356  (*d)[names::recordables] = recordablesMap_.get_list();
357  }
358 
359  inline
361  {
362  Parameters_ ptmp = P_; // temporary copy in case of errors
363  const double delta_EL = ptmp.set(d); // throws if BadProperty
364  State_ stmp = S_; // temporary copy in case of errors
365  stmp.set(d, ptmp, delta_EL); // throws if BadProperty
366 
367  // We now know that (ptmp, stmp) are consistent. We do not
368  // write them back to (P_, S_) before we are also sure that
369  // the properties to be set in the parent class are internally
370  // consistent.
372 
373  // if we get here, temporaries contain consistent set of properties
374  P_ = ptmp;
375  S_ = stmp;
376  }
377 
378 } // namespace
379 
380 #endif //IAF_TUM_2000_H
const Name recordables("recordables")
List of recordable state data (Device parameters)
Definition: nest_names.h:244
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition: iaf_tum_2000.h:254
double_t get_V_m_() const
Read out the real membrane potential.
Definition: iaf_tum_2000.h:291
int int_t
Integer number with at least 16 bit.
Definition: nest.h:95
Definition of Archiving_Node which is capable of recording and managing a spike history.
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
int_t r_abs_
Definition: iaf_tum_2000.h:229
double_t P20_
Amplitude of the synaptic current.
Definition: iaf_tum_2000.h:276
double_t P21in_
Definition: iaf_tum_2000.h:280
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
UniversalDataLogger< iaf_tum_2000 > logger_
Logger for all analog data.
Definition: iaf_tum_2000.h:259
double_t get_I_syn_in_() const
Definition: iaf_tum_2000.h:293
void get_status(DictionaryDatum &) const
Definition: iaf_tum_2000.h:351
double set(const DictionaryDatum &)
Set values from dictionary.
Definition: iaf_tum_2000.cpp:99
int_t RefractoryCountsTot_
Definition: iaf_tum_2000.h:284
Independent parameters of the model.
Definition: iaf_tum_2000.h:176
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
void set(const DictionaryDatum &, const Parameters_ &, double delta_EL)
Set values from dictionary.
Definition: iaf_tum_2000.cpp:149
double_t P22_
Definition: iaf_tum_2000.h:281
double_t C_
Membrane capacitance in pF.
Definition: iaf_tum_2000.h:182
double_t tau_ref_abs_
Definition: iaf_tum_2000.h:186
Parameters_ P_
Definition: iaf_tum_2000.h:304
double_t P11in_
Definition: iaf_tum_2000.h:278
double_t V_reset_
reset value of the membrane potential
Definition: iaf_tum_2000.h:199
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: iaf_tum_2000.cpp:316
State_()
Default initialization.
Definition: iaf_tum_2000.cpp:72
void init_state_(const Node &proto)
Private function to initialize the state of a node to model defaults.
Definition: iaf_tum_2000.cpp:189
Event for electrical currents.
Definition: event.h:420
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
double_t i_syn_ex_
Definition: iaf_tum_2000.h:225
State variables of the model.
Definition: iaf_tum_2000.h:222
double_t Tau_
Membrane time constant in ms.
Definition: iaf_tum_2000.h:179
State_ S_
Definition: iaf_tum_2000.h:305
Variables_ V_
Definition: iaf_tum_2000.h:306
Parameters_()
Sets default parameter values.
Definition: iaf_tum_2000.cpp:59
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: iaf_tum_2000.h:325
Map names of recordables to data access functions.
Definition: recordables_map.h:58
friend class UniversalDataLogger< iaf_tum_2000 >
Definition: iaf_tum_2000.h:169
RingBuffer currents_
Definition: iaf_tum_2000.h:256
Definition: nest_time.h:130
std::string get_name() const
Return class name.
Definition: node.cpp:83
iaf_tum_2000()
Definition: iaf_tum_2000.cpp:169
double_t V_m_
Definition: iaf_tum_2000.h:227
void set_status(const DictionaryDatum &d)
Definition: archiving_node.cpp:185
Buffers_(iaf_tum_2000 &)
Definition: iaf_tum_2000.cpp:157
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: iaf_tum_2000.cpp:85
Exception to be thrown if the specified receptor type does not exist in the node. ...
Definition: exceptions.h:254
static RecordablesMap< iaf_tum_2000 > recordablesMap_
Mapping of recordables names to access functions.
Definition: iaf_tum_2000.h:311
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
double_t I_e_
External current in pA.
Definition: iaf_tum_2000.h:192
double_t i_syn_in_
Definition: iaf_tum_2000.h:226
RingBuffer spikes_in_
Definition: iaf_tum_2000.h:255
double_t i_0_
Definition: iaf_tum_2000.h:224
double_t P11ex_
Definition: iaf_tum_2000.h:277
a node which archives spike history for the purposes of timing dependent plasticity ...
Definition: archiving_node.h:50
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
double_t tau_ex_
Time constant of excitatory synaptic current in ms.
Definition: iaf_tum_2000.h:202
double double_t
Double precision floating point numbers.
Definition: nest.h:93
virtual port handles_test_event(SpikeEvent &, rport receptor_type)
Check if the node can handle a particular event and receptor type.
Definition: node.cpp:203
void update(Time const &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: iaf_tum_2000.cpp:269
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: iaf_tum_2000.cpp:195
Request data to be logged/logged data to be sent.
Definition: event.h:486
void get(DictionaryDatum &, const Parameters_ &) const
Definition: iaf_tum_2000.cpp:144
double_t tau_in_
Time constant of inhibitory synaptic current in ms.
Definition: iaf_tum_2000.h:205
void set_status(const DictionaryDatum &)
Definition: iaf_tum_2000.h:360
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
Buffers of the model.
Definition: iaf_tum_2000.h:249
double_t tau_ref_tot_
Refractory period in ms.
Definition: iaf_tum_2000.h:185
Default types used by the NEST kernel.
void get_status(DictionaryDatum &d) const
Definition: archiving_node.cpp:175
Event for spike information.
Definition: event.h:320
double_t Theta_
Threshold, RELATIVE TO RESTING POTENTAIL(!).
Definition: iaf_tum_2000.h:196
Base class for all NEST network objects.
Definition: node.h:96
double_t P21ex_
Definition: iaf_tum_2000.h:279
double_t U0_
Resting potential in mV.
Definition: iaf_tum_2000.h:189
int_t RefractoryCountsAbs_
Definition: iaf_tum_2000.h:283
void calibrate()
Re-calculate dependent parameters of the node.
Definition: iaf_tum_2000.cpp:204
Internal variables of the model.
Definition: iaf_tum_2000.h:267
int_t r_tot_
Definition: iaf_tum_2000.h:230
Buffers_ B_
Definition: iaf_tum_2000.h:307
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const double e
Definition: numerics.cpp:62
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: iaf_tum_2000.h:317
Buffer Layout.
Definition: ring_buffer.h:77
double_t get_I_syn_ex_() const
Definition: iaf_tum_2000.h:292
Leaky integrate-and-fire neuron with exponential PSCs.
Definition: iaf_tum_2000.h:130