NEST  2.6.0,not_revisioned_source_dir@0
iaf_psc_alpha.h
Go to the documentation of this file.
1 /*
2  * iaf_psc_alpha.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_ALPHA_H
24 #define IAF_PSC_ALPHA_H
25 
26 #include "nest.h"
27 #include "event.h"
28 #include "archiving_node.h"
29 #include "ring_buffer.h"
30 #include "connection.h"
31 #include "universal_data_logger.h"
32 #include "recordables_map.h"
33 
34 /* BeginDocumentation
35 Name: iaf_psc_alpha - Leaky integrate-and-fire neuron model.
36 
37 Description:
38 
39  iaf_psc_alpha is an implementation of a leaky integrate-and-fire model
40  with alpha-function shaped synaptic currents. Thus, synaptic currents
41  and the resulting post-synaptic potentials have a finite rise time.
42 
43  The threshold crossing is followed by an absolute refractory period
44  during which the membrane potential is clamped to the resting potential.
45 
46  The linear subthresold dynamics is integrated by the Exact
47  Integration scheme [1]. The neuron dynamics is solved on the time
48  grid given by the computation step size. Incoming as well as emitted
49  spikes are forced to that grid.
50 
51  An additional state variable and the corresponding differential
52  equation represents a piecewise constant external current.
53 
54  The general framework for the consistent formulation of systems with
55  neuron like dynamics interacting by point events is described in
56  [1]. A flow chart can be found in [2].
57 
58  Critical tests for the formulation of the neuron model are the
59  comparisons of simulation results for different computation step
60  sizes. sli/testsuite/nest contains a number of such tests.
61 
62  The iaf_psc_alpha is the standard model used to check the consistency
63  of the nest simulation kernel because it is at the same time complex
64  enough to exhibit non-trivial dynamics and simple enough compute
65  relevant measures analytically.
66 
67 Remarks:
68 
69  The present implementation uses individual variables for the
70  components of the state vector and the non-zero matrix elements of
71  the propagator. Because the propagator is a lower triangular matrix
72  no full matrix multiplication needs to be carried out and the
73  computation can be done "in place" i.e. no temporary state vector
74  object is required.
75 
76  The template support of recent C++ compilers enables a more succinct
77  formulation without loss of runtime performance already at minimal
78  optimization levels. A future version of iaf_psc_alpha will probably
79  address the problem of efficient usage of appropriate vector and
80  matrix objects.
81 
82 
83 Parameters:
84 
85  The following parameters can be set in the status dictionary.
86 
87  V_m double - Membrane potential in mV
88  E_L double - Resting membrane potential in mV.
89  C_m double - Capacity of the membrane in pF
90  tau_m double - Membrane time constant in ms.
91  t_ref double - Duration of refractory period in ms.
92  V_th double - Spike threshold in mV.
93  V_reset double - Reset potential of the membrane in mV.
94  tau_syn_ex double - Rise time of the excitatory synaptic alpha function in ms.
95  tau_syn_in double - Rise time of the inhibitory synaptic alpha function in ms.
96  I_e double - Constant external input current in pA.
97  V_min double - Absolute lower value for the membrane potential.
98 
99 Note:
100  tau_m != tau_syn_{ex,in} is required by the current implementation to avoid a
101  degenerate case of the ODE describing the model [1]. For very similar values,
102  numerics will be unstable.
103 
104 References:
105  [1] Rotter S & Diesmann M (1999) Exact simulation of time-invariant linear
106  systems with applications to neuronal modeling. Biologial Cybernetics
107  81:381-402.
108  [2] Diesmann M, Gewaltig M-O, Rotter S, & Aertsen A (2001) State space
109  analysis of synchronous spiking in cortical neural networks.
110  Neurocomputing 38-40:565-571.
111  [3] Morrison A, Straube S, Plesser H E, & Diesmann M (2006) Exact subthreshold
112  integration with continuous spike times in discrete time neural network
113  simulations. Neural Computation, in press
114 
115 Sends: SpikeEvent
116 
117 Receives: SpikeEvent, CurrentEvent, DataLoggingRequest
118 FirstVersion: September 1999
119 Author: Diesmann, Gewaltig
120 SeeAlso: iaf_psc_delta, iaf_psc_exp, iaf_cond_exp
121 */
122 
123 namespace nest
124 {
125  class Network;
126 
131  {
132 
133  public:
134 
135  iaf_psc_alpha();
137 
142  using Node::handle;
144 
146 
147  void handle(SpikeEvent &);
148  void handle(CurrentEvent &);
149  void handle(DataLoggingRequest &);
150 
154 
155  void get_status(DictionaryDatum &) const;
156  void set_status(const DictionaryDatum &);
157 
158  private:
159 
160  void init_state_(const Node& proto);
161  void init_buffers_();
162  void calibrate();
163 
164  void update(Time const &, const long_t, const long_t);
165 
166  // The next two classes need to be friends to access the State_ class/member
168  friend class UniversalDataLogger<iaf_psc_alpha>;
169 
170  // ----------------------------------------------------------------
171 
172  struct Parameters_ {
173 
176 
179 
182 
185 
188 
191 
195 
199 
202 
205 
206  Parameters_();
207 
208  void get(DictionaryDatum&) const;
209 
213  double set(const DictionaryDatum&);
214 
215  };
216 
217  // ----------------------------------------------------------------
218 
219  struct State_ {
220 
227 
229 
230  State_();
231 
232  void get(DictionaryDatum&, const Parameters_&) const;
233 
239  void set(const DictionaryDatum&, const Parameters_&, double);
240 
241  };
242 
243  // ----------------------------------------------------------------
244 
245  struct Buffers_ {
246 
248  Buffers_(const Buffers_&, iaf_psc_alpha&);
249 
254 
257 
258  };
259 
260  // ----------------------------------------------------------------
261 
262  struct Variables_ {
263 
271 
285 
288 
289 
290  };
291 
292  // Access functions for UniversalDataLogger -------------------------------
293 
295  double_t get_V_m_() const { return S_.y3_ + P_.U0_; }
296 
301 
302  // Data members -----------------------------------------------------------
303 
319  };
320 
321  inline
323  {
324  SpikeEvent e;
325  e.set_sender(*this);
326  return target.handles_test_event(e, receptor_type);
327  }
328 
329  inline
331  {
332  if (receptor_type != 0)
333  throw UnknownReceptorType(receptor_type, get_name());
334  return 0;
335  }
336 
337  inline
339  {
340  if (receptor_type != 0)
341  throw UnknownReceptorType(receptor_type, get_name());
342  return 0;
343  }
344 
345  inline
348  {
349  if (receptor_type != 0)
350  throw UnknownReceptorType(receptor_type, get_name());
351  return B_.logger_.connect_logging_device(dlr, recordablesMap_);
352  }
353 
354  inline
356  {
357  P_.get(d);
358  S_.get(d, P_);
360 
361  (*d)[names::recordables] = recordablesMap_.get_list();
362  }
363 
364  inline
366  {
367  Parameters_ ptmp = P_; // temporary copy in case of errors
368  const double delta_EL = ptmp.set(d); // throws if BadProperty
369  State_ stmp = S_; // temporary copy in case of errors
370  stmp.set(d, ptmp, delta_EL); // throws if BadProperty
371 
372  // We now know that (ptmp, stmp) are consistent. We do not
373  // write them back to (P_, S_) before we are also sure that
374  // the properties to be set in the parent class are internally
375  // consistent.
377 
378  // if we get here, temporaries contain consistent set of properties
379  P_ = ptmp;
380  S_ = stmp;
381  }
382 
383 } // namespace
384 
385 #endif /* #ifndef IAF_PSC_ALPHA_H */
const Name recordables("recordables")
List of recordable state data (Device parameters)
Definition: nest_names.h:244
double_t P21_in_
Definition: iaf_psc_alpha.h:278
Buffers_ B_
Definition: iaf_psc_alpha.h:314
double_t get_weighted_spikes_ex_() const
Definition: iaf_psc_alpha.h:297
void update(Time const &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: iaf_psc_alpha.cpp:271
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
double_t get_weighted_spikes_in_() const
Definition: iaf_psc_alpha.h:298
double_t IPSCInitialValue_
Definition: iaf_psc_alpha.h:269
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: iaf_psc_alpha.h:330
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
double_t P32_in_
Definition: iaf_psc_alpha.h:281
State_ S_
Definition: iaf_psc_alpha.h:312
void calibrate()
Re-calculate dependent parameters of the node.
Definition: iaf_psc_alpha.cpp:213
Definition: iaf_psc_alpha.h:245
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
State_()
Default initialization.
Definition: iaf_psc_alpha.cpp:72
double_t Theta_
Threshold, RELATIVE TO RESTING POTENTIAL(!).
Definition: iaf_psc_alpha.h:194
double_t TauR_
Refractory period in ms.
Definition: iaf_psc_alpha.h:181
double_t LowerBound_
Lower bound, RELATIVE TO RESTING POTENTIAL(!).
Definition: iaf_psc_alpha.h:198
RingBuffer currents_
Definition: iaf_psc_alpha.h:253
double_t P30_
Definition: iaf_psc_alpha.h:282
static RecordablesMap< iaf_psc_alpha > recordablesMap_
Mapping of recordables names to access functions.
Definition: iaf_psc_alpha.h:318
double_t y0_
Constant current.
Definition: iaf_psc_alpha.h:221
Event for electrical currents.
Definition: event.h:420
void set(const DictionaryDatum &, const Parameters_ &, double)
Set values from dictionary.
Definition: iaf_psc_alpha.cpp:155
long_t rport
Connection port number to distinguish incoming connections, also called receiver port.
Definition: nest.h:147
double_t U0_
Resting potential in mV.
Definition: iaf_psc_alpha.h:184
double set(const DictionaryDatum &)
Set values from dictionary.
Definition: iaf_psc_alpha.cpp:100
double_t V_reset_
Reset value of the membrane potential.
Definition: iaf_psc_alpha.h:190
double_t P22_ex_
Definition: iaf_psc_alpha.h:274
double_t I_e_
External current in pA.
Definition: iaf_psc_alpha.h:187
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: iaf_psc_alpha.cpp:86
double_t y2_in_
Definition: iaf_psc_alpha.h:225
double_t P21_ex_
Definition: iaf_psc_alpha.h:273
double_t P32_ex_
Definition: iaf_psc_alpha.h:276
Definition: iaf_psc_alpha.h:262
Map names of recordables to data access functions.
Definition: recordables_map.h:58
Parameters_ P_
Definition: iaf_psc_alpha.h:311
Definition: nest_time.h:130
double_t weighted_spikes_in_
Definition: iaf_psc_alpha.h:287
double_t y1_ex_
Definition: iaf_psc_alpha.h:222
double_t P11_in_
Definition: iaf_psc_alpha.h:277
std::string get_name() const
Return class name.
Definition: node.cpp:83
double_t P22_in_
Definition: iaf_psc_alpha.h:279
double_t y3_
This is the membrane potential RELATIVE TO RESTING POTENTIAL.
Definition: iaf_psc_alpha.h:226
void set_status(const DictionaryDatum &d)
Definition: archiving_node.cpp:185
Leaky integrate-and-fire neuron with alpha-shaped PSCs.
Definition: iaf_psc_alpha.h:130
Exception to be thrown if the specified receptor type does not exist in the node. ...
Definition: exceptions.h:254
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
double_t get_input_currents_ex_() const
Definition: iaf_psc_alpha.h:299
double_t P11_ex_
Definition: iaf_psc_alpha.h:272
int_t RefractoryCounts_
Definition: iaf_psc_alpha.h:270
double_t get_V_m_() const
Read out the real membrane potential.
Definition: iaf_psc_alpha.h:295
RingBuffer in_spikes_
Definition: iaf_psc_alpha.h:252
double_t P33_
Definition: iaf_psc_alpha.h:283
double_t get_input_currents_in_() const
Definition: iaf_psc_alpha.h:300
void init_state_(const Node &proto)
Private function to initialize the state of a node to model defaults.
Definition: iaf_psc_alpha.cpp:196
double_t C_
Membrane capacitance in pF.
Definition: iaf_psc_alpha.h:178
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
friend class UniversalDataLogger< iaf_psc_alpha >
Definition: iaf_psc_alpha.h:168
double_t y2_ex_
Definition: iaf_psc_alpha.h:223
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
double_t EPSCInitialValue_
Amplitude of the synaptic current.
Definition: iaf_psc_alpha.h:268
double_t tau_ex_
Time constant of excitatory synaptic current in ms.
Definition: iaf_psc_alpha.h:201
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
iaf_psc_alpha()
Definition: iaf_psc_alpha.cpp:176
Request data to be logged/logged data to be sent.
Definition: event.h:486
int_t r_
Number of refractory steps remaining.
Definition: iaf_psc_alpha.h:228
double_t Tau_
Membrane time constant in ms.
Definition: iaf_psc_alpha.h:175
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
Buffers_(iaf_psc_alpha &)
Definition: iaf_psc_alpha.cpp:163
Default types used by the NEST kernel.
void get_status(DictionaryDatum &d) const
Definition: archiving_node.cpp:175
Variables_ V_
Definition: iaf_psc_alpha.h:313
Event for spike information.
Definition: event.h:320
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: iaf_psc_alpha.h:322
Base class for all NEST network objects.
Definition: node.h:96
double_t P31_ex_
Definition: iaf_psc_alpha.h:275
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: iaf_psc_alpha.cpp:332
double_t tau_in_
Time constant of inhibitory synaptic current in ms.
Definition: iaf_psc_alpha.h:204
Definition: iaf_psc_alpha.h:172
double_t y1_in_
Definition: iaf_psc_alpha.h:224
double_t P31_in_
Definition: iaf_psc_alpha.h:280
Parameters_()
Sets default parameter values.
Definition: iaf_psc_alpha.cpp:59
RingBuffer ex_spikes_
buffers and summs up incoming spikes/currents
Definition: iaf_psc_alpha.h:251
double_t expm1_tau_m_
Definition: iaf_psc_alpha.h:284
Definition: iaf_psc_alpha.h:219
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
void get_status(DictionaryDatum &) const
Definition: iaf_psc_alpha.h:355
const double e
Definition: numerics.cpp:62
UniversalDataLogger< iaf_psc_alpha > logger_
Logger for all analog data.
Definition: iaf_psc_alpha.h:256
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: iaf_psc_alpha.cpp:202
double_t weighted_spikes_ex_
Definition: iaf_psc_alpha.h:286
Buffer Layout.
Definition: ring_buffer.h:77
void set_status(const DictionaryDatum &)
Definition: iaf_psc_alpha.h:365
void get(DictionaryDatum &, const Parameters_ &) const
Definition: iaf_psc_alpha.cpp:150