NEST  2.6.0,not_revisioned_source_dir@0
iaf_psc_delta.h
Go to the documentation of this file.
1 /*
2  * iaf_psc_delta.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_H
24 #define IAF_PSC_DELTA_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 
33 namespace nest{
34 
35  class Network;
36 
37  /* BeginDocumentation
38  Name: iaf_psc_delta - Leaky integrate-and-fire neuron model.
39 
40  Description:
41 
42  iaf_psc_delta is an implementation of a leaky integrate-and-fire model
43  where the potential jumps on each spike arrival.
44 
45  The threshold crossing is followed by an absolute refractory period
46  during which the membrane potential is clamped to the resting potential.
47 
48  Spikes arriving while the neuron is refractory, are discarded by
49  default. If the property "refractory_input" is set to true, such
50  spikes are added to the membrane potential at the end of the
51  refractory period, dampened according to the interval between
52  arrival and end of refractoriness.
53 
54  The linear subthresold dynamics is integrated by the Exact
55  Integration scheme [1]. The neuron dynamics is solved on the time
56  grid given by the computation step size. Incoming as well as emitted
57  spikes are forced to that grid.
58 
59  An additional state variable and the corresponding differential
60  equation represents a piecewise constant external current.
61 
62  The general framework for the consistent formulation of systems with
63  neuron like dynamics interacting by point events is described in
64  [1]. A flow chart can be found in [2].
65 
66  Critical tests for the formulation of the neuron model are the
67  comparisons of simulation results for different computation step
68  sizes. sli/testsuite/nest contains a number of such tests.
69 
70  The iaf_psc_delta is the standard model used to check the consistency
71  of the nest simulation kernel because it is at the same time complex
72  enough to exhibit non-trivial dynamics and simple enough compute
73  relevant measures analytically.
74 
75  Remarks:
76 
77  The present implementation uses individual variables for the
78  components of the state vector and the non-zero matrix elements of
79  the propagator. Because the propagator is a lower triangular matrix
80  no full matrix multiplication needs to be carried out and the
81  computation can be done "in place" i.e. no temporary state vector
82  object is required.
83 
84  The template support of recent C++ compilers enables a more succinct
85  formulation without loss of runtime performance already at minimal
86  optimization levels. A future version of iaf_psc_delta will probably
87  address the problem of efficient usage of appropriate vector and
88  matrix objects.
89 
90 
91  Parameters:
92 
93  The following parameters can be set in the status dictionary.
94 
95  V_m double - Membrane potential in mV
96  E_L double - Resting membrane potential in mV.
97  C_m double - Specific capacitance of the membrane in pF/mum^2
98  tau_m double - Membrane time constant in ms.
99  t_ref double - Duration of refractory period in ms.
100  V_th double - Spike threshold in mV.
101  V_reset double - Reset potential of the membrane in mV.
102  I_e double - Constant input current in pA.
103  V_min double - Absolute lower value for the membrane potential.
104 
105  refractory_input bool - If true, do not discard input during
106  refractory period. Default: false.
107 
108  References:
109  [1] Rotter S & Diesmann M (1999) Exact digital simulation of time-invariant
110  linear systems with applications to neuronal modeling. Biologial Cybernetics
111  81:381-402.
112  [2] Diesmann M, Gewaltig M-O, Rotter S, & Aertsen A (2001) State space
113  analysis of synchronous spiking in cortical neural networks.
114  Neurocomputing 38-40:565-571.
115 
116  Sends: SpikeEvent
117 
118  Receives: SpikeEvent, CurrentEvent, DataLoggingRequest
119 
120  Author: September 1999, Diesmann, Gewaltig
121  SeeAlso: iaf_psc_alpha, iaf_psc_exp, iaf_neuron, iaf_psc_delta_canon
122  */
123 
128  public Archiving_Node
129  {
130 
131  public:
132 
133  iaf_psc_delta();
135 
140  using Node::handle;
142 
144 
145  void handle(SpikeEvent &);
146  void handle(CurrentEvent &);
147  void handle(DataLoggingRequest &);
148 
152 
153  void get_status(DictionaryDatum &) const;
154  void set_status(const DictionaryDatum &);
155 
156  private:
157 
158  void init_state_(const Node& proto);
159  void init_buffers_();
160  void calibrate();
161 
162  void update(Time const &, const long_t, const long_t);
163 
164  // The next two classes need to be friends to access the State_ class/member
166  friend class UniversalDataLogger<iaf_psc_delta>;
167 
168  // ----------------------------------------------------------------
169 
173  struct Parameters_ {
176 
179 
182 
185 
188 
192 
196 
199 
201 
202  Parameters_();
203 
204  void get(DictionaryDatum&) const;
205 
209  double set(const DictionaryDatum&);
210  };
211 
212  // ----------------------------------------------------------------
213 
217  struct State_ {
220 
222 
227 
228  State_();
229 
230  void get(DictionaryDatum&, const Parameters_&) const;
231 
237  void set(const DictionaryDatum&, const Parameters_&, double);
238  };
239 
240  // ----------------------------------------------------------------
241 
245  struct Buffers_ {
247  Buffers_(const Buffers_ &, iaf_psc_delta &);
248 
252 
255  };
256 
257  // ----------------------------------------------------------------
258 
262  struct Variables_ {
263 
266 
268 
269  };
270 
271  // Access functions for UniversalDataLogger -------------------------------
272 
274  double_t get_V_m_() const { return S_.y3_ + P_.E_L_; }
275 
276  // ----------------------------------------------------------------
277 
293  };
294 
295 
296 inline
298 {
299  SpikeEvent e;
300  e.set_sender(*this);
301  return target.handles_test_event(e, receptor_type);
302 }
303 
304 inline
306 {
307  if (receptor_type != 0)
308  throw UnknownReceptorType(receptor_type, get_name());
309  return 0;
310 }
311 
312 inline
314 {
315  if (receptor_type != 0)
316  throw UnknownReceptorType(receptor_type, get_name());
317  return 0;
318 }
319 
320 inline
323 {
324  if (receptor_type != 0)
325  throw UnknownReceptorType(receptor_type, get_name());
326  return B_.logger_.connect_logging_device(dlr, recordablesMap_);
327 }
328 
329 inline
331 {
332  P_.get(d);
333  S_.get(d, P_);
335  (*d)[names::recordables] = recordablesMap_.get_list();
336 }
337 
338 inline
340 {
341  Parameters_ ptmp = P_; // temporary copy in case of errors
342  const double delta_EL = ptmp.set(d); // throws if BadProperty
343  State_ stmp = S_; // temporary copy in case of errors
344  stmp.set(d, ptmp, delta_EL); // throws if BadProperty
345 
346  // We now know that (ptmp, stmp) are consistent. We do not
347  // write them back to (P_, S_) before we are also sure that
348  // the properties to be set in the parent class are internally
349  // consistent.
351 
352  // if we get here, temporaries contain consistent set of properties
353  P_ = ptmp;
354  S_ = stmp;
355 }
356 
357 } // namespace
358 
359 #endif /* #ifndef IAF_PSC_DELTA_H */
const Name recordables("recordables")
List of recordable state data (Device parameters)
Definition: nest_names.h:244
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.
State_ S_
Definition: iaf_psc_delta.h:286
double_t y0_
Definition: iaf_psc_delta.h:218
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: iaf_psc_delta.h:305
UniversalDataLogger< iaf_psc_delta > logger_
Logger for all analog data.
Definition: iaf_psc_delta.h:254
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
static RecordablesMap< iaf_psc_delta > recordablesMap_
Mapping of recordables names to access functions.
Definition: iaf_psc_delta.h:292
double_t E_L_
Resting potential in mV.
Definition: iaf_psc_delta.h:184
bool with_refr_input_
spikes arriving during refractory period are counted
Definition: iaf_psc_delta.h:200
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
RingBuffer spikes_
buffers and summs up incoming spikes/currents
Definition: iaf_psc_delta.h:250
double_t P30_
Definition: iaf_psc_delta.h:264
double_t V_reset_
reset value of the membrane potential
Definition: iaf_psc_delta.h:198
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: iaf_psc_delta.h:297
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: iaf_psc_delta.cpp:82
Buffers_ B_
Definition: iaf_psc_delta.h:288
Buffers_(iaf_psc_delta &)
Definition: iaf_psc_delta.cpp:152
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
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: iaf_psc_delta.cpp:190
double_t t_ref_
Refractory period in ms.
Definition: iaf_psc_delta.h:181
void set_status(const DictionaryDatum &)
Definition: iaf_psc_delta.h:339
double_t get_V_m_() const
Read out the real membrane potential.
Definition: iaf_psc_delta.h:274
double set(const DictionaryDatum &)
Set values from dictionary.
Definition: iaf_psc_delta.cpp:95
RingBuffer currents_
Definition: iaf_psc_delta.h:251
Leaky integrate-and-fire neuron with delta-shaped PSCs.
Definition: iaf_psc_delta.h:127
Variables_ V_
Definition: iaf_psc_delta.h:287
State variables of the model.
Definition: iaf_psc_delta.h:217
Map names of recordables to data access functions.
Definition: recordables_map.h:58
Definition: nest_time.h:130
void get(DictionaryDatum &, const Parameters_ &) const
Definition: iaf_psc_delta.cpp:139
friend class UniversalDataLogger< iaf_psc_delta >
Definition: iaf_psc_delta.h:166
State_()
Default initialization.
Definition: iaf_psc_delta.cpp:71
std::string get_name() const
Return class name.
Definition: node.cpp:83
void set(const DictionaryDatum &, const Parameters_ &, double)
Set values from dictionary.
Definition: iaf_psc_delta.cpp:144
double_t refr_spikes_buffer_
Accumulate spikes arriving during refractory period, discounted for decay until end of refractory per...
Definition: iaf_psc_delta.h:226
void set_status(const DictionaryDatum &d)
Definition: archiving_node.cpp:185
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
Internal variables of the model.
Definition: iaf_psc_delta.h:262
double_t V_th_
Threshold, RELATIVE TO RESTING POTENTAIL(!).
Definition: iaf_psc_delta.h:191
Buffers of the model.
Definition: iaf_psc_delta.h:245
double_t y3_
This is the membrane potential RELATIVE TO RESTING POTENTIAL.
Definition: iaf_psc_delta.h:219
void calibrate()
Re-calculate dependent parameters of the node.
Definition: iaf_psc_delta.cpp:198
Parameters_ P_
Definition: iaf_psc_delta.h:285
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
void get_status(DictionaryDatum &) const
Definition: iaf_psc_delta.h:330
double_t P33_
Definition: iaf_psc_delta.h:265
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
double double_t
Double precision floating point numbers.
Definition: nest.h:93
double_t c_m_
Membrane capacitance in pF.
Definition: iaf_psc_delta.h:178
double_t tau_m_
Membrane time constant in ms.
Definition: iaf_psc_delta.h:175
iaf_psc_delta()
Definition: iaf_psc_delta.cpp:164
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_psc_delta.cpp:238
Request data to be logged/logged data to be sent.
Definition: event.h:486
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: iaf_psc_delta.cpp:297
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
int_t r_
Number of refractory steps remaining.
Definition: iaf_psc_delta.h:221
int_t RefractoryCounts_
Definition: iaf_psc_delta.h:267
double_t I_e_
External DC current.
Definition: iaf_psc_delta.h:187
void init_state_(const Node &proto)
Private function to initialize the state of a node to model defaults.
Definition: iaf_psc_delta.cpp:184
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
Base class for all NEST network objects.
Definition: node.h:96
Parameters_()
Sets default parameter values.
Definition: iaf_psc_delta.cpp:58
double_t V_min_
Lower bound, RELATIVE TO RESTING POTENTAIL(!).
Definition: iaf_psc_delta.h:195
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
const double e
Definition: numerics.cpp:62
Buffer Layout.
Definition: ring_buffer.h:77
Independent parameters of the model.
Definition: iaf_psc_delta.h:173