NEST  2.6.0,not_revisioned_source_dir@0
amat2_psc_exp.h
Go to the documentation of this file.
1 /*
2  * amat2_psc_exp.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 AMAT2_PSC_EXP_H
25 #define AMAT2_PSC_EXP_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 #include "universal_data_logger.h"
33 #include "recordables_map.h"
34 
35 namespace nest
36 {
37 
38  class Network;
39 
40  /* BeginDocumentation
41  Name: amat2_psc_exp - Non-resetting leaky integrate-and-fire neuron model with
42  exponential PSCs and adaptive threshold.
43 
44  Description:
45  amat2_psc_exp is an implementation of a leaky integrate-and-fire model
46  with exponential shaped postsynaptic currents (PSCs). Thus, postsynaptic currents
47  have an infinitely short rise time.
48 
49  The threshold is lifted when the neuron is fired and then decreases in a fixed
50  time scale toward a fixed level [3].
51 
52  The threshold crossing is followed by a total refractory period
53  during which the neuron is not allowed to fire, even if the membrane
54  potential exceeds the threshold. The membrane potential is NOT reset,
55  but continuously integrated.
56 
57  The linear subthresold dynamics is integrated by the Exact
58  Integration scheme [1]. The neuron dynamics is solved on the time
59  grid given by the computation step size. Incoming as well as emitted
60  spikes are forced to that grid.
61 
62  An additional state variable and the corresponding differential
63  equation represents a piecewise constant external current.
64 
65  The general framework for the consistent formulation of systems with
66  neuron like dynamics interacting by point events is described in
67  [1]. A flow chart can be found in [2].
68 
69  Remarks:
70  - The default parameter values for this model are different from the
71  corresponding parameter values for mat2_psc_exp.
72  - If identical parameters are used, and beta==0, then this model shall
73  behave exactly as mat2_psc_exp.
74  - The time constants in the model must fullfill the following conditions:
75  - tau_m != {tau_syn_ex, tau_syn_in}
76  - tau_v != {tau_syn_ex, tau_syn_in}
77  - tau_m != tau_v
78  This is required to avoid singularities in the numerics. This is a problem
79  of implementation only, not a principal problem of the model.
80  - Expect unstable numerics if time constants that are required to be different
81  are very close.
82 
83  Parameters:
84  The following parameters can be set in the status dictionary:
85 
86  C_m double - Capacity of the membrane in pF
87  E_L double - Resting potential in mV
88  tau_m double - Membrane time constant in ms
89  tau_syn_ex double - Time constant of postsynaptic excitatory currents in ms
90  tau_syn_in double - Time constant of postsynaptic inhibitory currents in ms
91  t_ref double - Duration of absolute refractory period (no spiking) in ms
92  V_m double - Membrane potential in mV
93  I_e double - Constant input current in pA
94  t_spike double - Point in time of last spike in ms
95  tau_1 double - Short time constant of adaptive threshold in ms [3, eqs 2-3]
96  tau_2 double - Long time constant of adaptive threshold in ms [3, eqs 2-3]
97  alpha_1 double - Amplitude of short time threshold adaption in mV [3, eqs 2-3]
98  alpha_2 double - Amplitude of long time threshold adaption in mV [3, eqs 2-3]
99  tau_v double - Time constant of kernel for voltage-dependent threshold component in ms [3, eqs 16-17]
100  beta double - Scaling coefficient for voltage-dependent threshold component in 1/ms [3, eqs 16-17]
101  omega double - Resting spike threshold in mV (absolute value, not relative to E_L as in [3])
102 
103  The following state variables can be read out with the multimeter device:
104 
105  V_m Non-resetting membrane potential
106  V_th Two-timescale adaptive threshold
107 
108  Note:
109  tau_m != tau_syn_{ex,in} is required by the current implementation to avoid a
110  degenerate case of the ODE describing the model [1]. For very similar values,
111  numerics will be unstable.
112 
113  References:
114  [1] Rotter S & Diesmann M (1999) Exact simulation of
115  time-invariant linear systems with applications to neuronal
116  modeling. Biologial Cybernetics 81:381-402.
117  [2] Diesmann M, Gewaltig M-O, Rotter S, & Aertsen A (2001) State
118  space analysis of synchronous spiking in cortical neural
119  networks. Neurocomputing 38-40:565-571.
120  [3] Kobayashi R, Tsubo Y and Shinomoto S (2009) Made-to-order
121  spiking neuron model equipped with a multi-timescale adaptive
122  threshold. Front. Comput. Neurosci. 3:9. doi:10.3389/neuro.10.009.2009
123  [4] Yamauchi S, Kim H and Shinomoto S (2011) Elemental spiking neuron model
124  for reproducing diverse firing patterns and predicting precise firing
125  times. Front. Comput. Neurosci. 5:42. doi: 10.3389/fncom.2011.00042
126 
127  Sends: SpikeEvent
128 
129  Receives: SpikeEvent, CurrentEvent, DataLoggingRequest
130 
131  FirstVersion: April 2013
132  Author: Thomas Heiberg & Hans E. Plesser (modified mat2_psc_exp model of Thomas Pfeil)
133  */
134 
140  {
141 
142  public:
143 
144  amat2_psc_exp();
146 
151  using Node::handle;
153 
155 
159 
160  void handle(SpikeEvent &);
161  void handle(CurrentEvent &);
162  void handle(DataLoggingRequest &);
163 
164  void get_status(DictionaryDatum &) const;
165  void set_status(const DictionaryDatum &);
166 
167  private:
168 
169  void init_state_(const Node& proto);
170  void init_buffers_();
171  void calibrate();
172  void update(Time const &, const long_t, const long_t);
173 
174  // The next two classes need to be friends to access private members
176  friend class UniversalDataLogger<amat2_psc_exp>;
177 
178  // ----------------------------------------------------------------
179 
183  struct Parameters_ {
184 
187 
190 
193 
196 
199 
202 
205 
209 
213 
216 
219 
225 
226  Parameters_();
227 
228  void get(DictionaryDatum&) const;
229 
233  double set(const DictionaryDatum&);
234  };
235 
236  // ----------------------------------------------------------------
237 
241  struct State_ {
242  // state variables
243  double_t i_0_; // synaptic dc input current, variable 0
244  double_t i_syn_ex_; // postsynaptic current for exc. inputs, variable 1
245  double_t i_syn_in_; // postsynaptic current for inh. inputs, variable 2
246  double_t V_m_; // membrane potential, variable 3
247  double_t V_th_1_; // short time adaptive threshold (related to tau_1_), variable 4
248  double_t V_th_2_; // long time adaptive threshold (related to tau_2_), variable 5
249  double_t V_th_dv_; // derivative of voltage dependent threshold variable 6
250  double_t V_th_v_; // voltage dependent threshold, variable 7
251 
252  int_t r_; // total refractory counter (no spikes can be generated)
253 
254  State_();
255 
256  void get(DictionaryDatum&, const Parameters_&) const;
257 
263  void set(const DictionaryDatum&, const Parameters_&, double);
264  };
265 
266  // ----------------------------------------------------------------
267 
271  struct Buffers_ {
273  Buffers_(const Buffers_&, amat2_psc_exp&);
274 
279 
282  };
283 
284  // ----------------------------------------------------------------
285 
289  struct Variables_ {
290 
296  // double_t PSCInitialValue_;
297 
298  double_t P00_; // constant currents
318 
320  };
321  // ----------------------------------------------------------------
322 
324  double_t get_V_m_() const { return S_.V_m_ + P_.U0_; }
325  double_t get_V_th_() const { return P_.U0_ + P_.omega_ + S_.V_th_1_ + S_.V_th_2_ + S_.V_th_v_; }
326  double_t get_V_th_v_() const { return S_.V_th_v_; }
327 
328  // ----------------------------------------------------------------
329 
345  };
346 
347 
348  inline
350  {
351  SpikeEvent e;
352  e.set_sender(*this);
353 
354  return target.handles_test_event(e, receptor_type);
355  }
356 
357  inline
359  {
360  if (receptor_type != 0)
361  throw UnknownReceptorType(receptor_type, get_name());
362  return 0;
363  }
364 
365  inline
367  {
368  if (receptor_type != 0)
369  throw UnknownReceptorType(receptor_type, get_name());
370  return 0;
371  }
372 
373  inline
375  {
376  if (receptor_type != 0)
377  throw UnknownReceptorType(receptor_type, get_name());
378  return B_.logger_.connect_logging_device(dlr, recordablesMap_);
379  }
380 
381  inline
383  {
384  P_.get(d);
385  S_.get(d, P_);
387 
388  (*d)[names::recordables] = recordablesMap_.get_list();
389  }
390 
391  inline
393  {
394  Parameters_ ptmp = P_; // temporary copy in case of errors
395  const double delta_EL = ptmp.set(d); // throws if BadProperty
396  State_ stmp = S_; // temporary copy in case of errors
397  stmp.set(d, ptmp, delta_EL); // throws if BadProperty
398 
399  // We now know that (ptmp, stmp) are consistent. We do not
400  // write them back to (P_, S_) before we are also sure that
401  // the properties to be set in the parent class are internally
402  // consistent.
404 
405  // if we get here, temporaries contain consistent set of properties
406  P_ = ptmp;
407  S_ = stmp;
408  }
409 
410 } // namespace
411 
412 #endif //AMAT2_PSC_EXP_H
Variables_ V_
Definition: amat2_psc_exp.h:339
const Name recordables("recordables")
List of recordable state data (Device parameters)
Definition: nest_names.h:244
int_t RefractoryCountsTot_
Definition: amat2_psc_exp.h:319
double_t tau_ex_
Time constant of excitatory synaptic current in ms.
Definition: amat2_psc_exp.h:201
Buffers of the model.
Definition: amat2_psc_exp.h: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.
State_()
Default initialization.
Definition: amat2_psc_exp.cpp:82
double_t P62_
Definition: amat2_psc_exp.h:309
const Name receptor_type("receptor_type")
Connection parameters.
Definition: nest_names.h:240
void set_status(const DictionaryDatum &)
Definition: amat2_psc_exp.h:392
double_t P30_
Definition: amat2_psc_exp.h:301
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
port handles_test_event(SpikeEvent &, rport)
Check if the node can handle a particular event and receptor type.
Definition: amat2_psc_exp.h:358
double_t P61_
Definition: amat2_psc_exp.h:308
UniversalDataLogger< amat2_psc_exp > logger_
Logger for all analog data.
Definition: amat2_psc_exp.h:281
double_t P44_
Definition: amat2_psc_exp.h:305
double_t get_V_m_() const
Read out state variables, used by UniversalDataLogger.
Definition: amat2_psc_exp.h:324
void init_buffers_()
Private function to initialize the buffers of a node.
Definition: amat2_psc_exp.cpp:224
void set_sender(Node &)
Change pointer to sending Node.
Definition: event.h:714
double_t tau_1_
Short and long time constant of adaptive threshold in ms.
Definition: amat2_psc_exp.h:207
double_t omega_
Resting threshold in mV (relative to resting potential).
Definition: amat2_psc_exp.h:224
double_t P76_
Definition: amat2_psc_exp.h:316
double_t P55_
Definition: amat2_psc_exp.h:306
Parameters_()
Sets default parameter values.
Definition: amat2_psc_exp.cpp:62
int_t r_
Definition: amat2_psc_exp.h:252
void handle(SpikeEvent &)
Handle incoming spike events.
Definition: amat2_psc_exp.cpp:389
Independent parameters of the model.
Definition: amat2_psc_exp.h:183
double_t Tau_
Membrane time constant in ms.
Definition: amat2_psc_exp.h:186
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 V_th_1_
Definition: amat2_psc_exp.h:247
double_t V_th_2_
Definition: amat2_psc_exp.h:248
double_t tau_in_
Time constant of inhibitory synaptic current in ms.
Definition: amat2_psc_exp.h:204
double_t V_th_v_
Definition: amat2_psc_exp.h:250
double_t i_syn_ex_
Definition: amat2_psc_exp.h:244
double_t P66_
Definition: amat2_psc_exp.h:311
double_t P11_
Definition: amat2_psc_exp.h:299
Parameters_ P_
Definition: amat2_psc_exp.h:337
Map names of recordables to data access functions.
Definition: recordables_map.h:58
void set(const DictionaryDatum &, const Parameters_ &, double)
Set values from dictionary.
Definition: amat2_psc_exp.cpp:168
double_t P33_
Definition: amat2_psc_exp.h:304
Definition: nest_time.h:130
amat2_psc_exp()
Definition: amat2_psc_exp.cpp:198
void update(Time const &, const long_t, const long_t)
Bring the node from state $t$ to $t+n*dt$.
Definition: amat2_psc_exp.cpp:326
double_t P77_
Definition: amat2_psc_exp.h:317
double_t I_e_
External current in pA.
Definition: amat2_psc_exp.h:198
std::string get_name() const
Return class name.
Definition: node.cpp:83
void get(DictionaryDatum &) const
Store current values in dictionary.
Definition: amat2_psc_exp.cpp:98
double_t U0_
Resting potential in mV.
Definition: amat2_psc_exp.h:195
Non-resetting leaky integrate-and-fire neuron model with exponential PSCs and adaptive threshold...
Definition: amat2_psc_exp.h:139
Buffers_(amat2_psc_exp &)
Sets buffer pointers to 0.
Definition: amat2_psc_exp.cpp:180
static RecordablesMap< amat2_psc_exp > recordablesMap_
Mapping of recordables names to access functions.
Definition: amat2_psc_exp.h:344
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
double_t get_V_th_() const
Definition: amat2_psc_exp.h:325
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
double_t tau_2_
Definition: amat2_psc_exp.h:208
void get(DictionaryDatum &, const Parameters_ &) const
Definition: amat2_psc_exp.cpp:159
RingBuffer spikes_in_
Definition: amat2_psc_exp.h:277
double_t tau_ref_
Refractory period in ms.
Definition: amat2_psc_exp.h:192
State_ S_
Definition: amat2_psc_exp.h:338
double set(const DictionaryDatum &)
Set values from dictionary.
Definition: amat2_psc_exp.cpp:116
double_t get_V_th_v_() const
Definition: amat2_psc_exp.h:326
double_t tau_v_
Time-constant for voltage-dependent threshold component in ms.
Definition: amat2_psc_exp.h:218
RingBuffer currents_
Definition: amat2_psc_exp.h:278
a node which archives spike history for the purposes of timing dependent plasticity ...
Definition: archiving_node.h:50
double_t V_th_dv_
Definition: amat2_psc_exp.h:249
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
friend class UniversalDataLogger< amat2_psc_exp >
Definition: amat2_psc_exp.h:176
double_t i_syn_in_
Definition: amat2_psc_exp.h:245
void init_state_(const Node &proto)
Private function to initialize the state of a node to model defaults.
Definition: amat2_psc_exp.cpp:218
virtual void handle(SpikeEvent &e)
Handle incoming spike events.
Definition: node.cpp:198
double_t P60_
Definition: amat2_psc_exp.h:307
void calibrate()
Re-calculate dependent parameters of the node.
Definition: amat2_psc_exp.cpp:235
double double_t
Double precision floating point numbers.
Definition: nest.h:93
RingBuffer spikes_ex_
buffers and sums up incoming spikes/currents
Definition: amat2_psc_exp.h:276
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
State variables of the model.
Definition: amat2_psc_exp.h:241
void get_status(DictionaryDatum &) const
Definition: amat2_psc_exp.h:382
Request data to be logged/logged data to be sent.
Definition: event.h:486
double_t P32_
Definition: amat2_psc_exp.h:303
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
double_t alpha_1_
Amplitudes of threshold adaption in mV.
Definition: amat2_psc_exp.h:211
double_t P72_
Definition: amat2_psc_exp.h:314
Internal variables of the model.
Definition: amat2_psc_exp.h:289
Default types used by the NEST kernel.
void get_status(DictionaryDatum &d) const
Definition: archiving_node.cpp:175
Buffers_ B_
Definition: amat2_psc_exp.h:340
Event for spike information.
Definition: event.h:320
double_t P70_
Definition: amat2_psc_exp.h:312
Base class for all NEST network objects.
Definition: node.h:96
double_t P22_
Definition: amat2_psc_exp.h:300
double_t P73_
Definition: amat2_psc_exp.h:315
port send_test_event(Node &, rport, synindex, bool)
Send an event to the receiving_node passed as an argument.
Definition: amat2_psc_exp.h:349
double_t V_m_
Definition: amat2_psc_exp.h:246
double_t beta_
Scaling coefficient for voltage-dependent threshold component in 1/ms.
Definition: amat2_psc_exp.h:215
double_t i_0_
Definition: amat2_psc_exp.h:243
double_t P63_
Definition: amat2_psc_exp.h:310
double_t C_
Membrane capacitance in pF.
Definition: amat2_psc_exp.h:189
double_t P71_
Definition: amat2_psc_exp.h:313
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
double_t P31_
Definition: amat2_psc_exp.h:302
const double e
Definition: numerics.cpp:62
double_t P00_
Amplitude of the synaptic current.
Definition: amat2_psc_exp.h:298
Buffer Layout.
Definition: ring_buffer.h:77
double_t alpha_2_
Definition: amat2_psc_exp.h:212