NEST main@f146f75
Loading...
Searching...
No Matches
aeif_cond_alpha_astro.h
Go to the documentation of this file.
1/*
2 * aeif_cond_alpha_astro.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 AEIF_COND_ALPHA_ASTRO_H
24#define AEIF_COND_ALPHA_ASTRO_H
25
26// Generated includes:
27#include "config.h"
28
29#ifdef HAVE_GSL
30
31// External includes:
32#include <gsl/gsl_errno.h>
33#include <gsl/gsl_matrix.h>
34#include <gsl/gsl_odeiv.h>
35
36// Includes from nestkernel:
37#include "archiving_node.h"
38#include "connection.h"
39#include "event.h"
40#include "nest_types.h"
41#include "recordables_map.h"
42#include "ring_buffer.h"
44
45namespace nest
46{
57extern "C" int aeif_cond_alpha_astro_dynamics( double, const double*, double*, void* );
58
69extern "C" int aeif_cond_alpha_astro_dynamics_DT0( double, const double*, double*, void* );
70
71/* BeginUserDocs: neuron, integrate-and-fire, adaptation, conductance-based, astrocyte, soft threshold
72
73Short description
74+++++++++++++++++
75
76Conductance based exponential integrate-and-fire neuron model with support for
77neuron-astrocyte interactions
78
79Description
80+++++++++++
81
82``aeif_cond_alpha_astro`` is an adaptive exponential integrate-and-fire neuron
83(AdEx) that can receive inputs from astrocytes, in addition to receiving
84synaptic inputs from other neurons. It is adapted from the standard NEST
85implementation of AdEx neurons (``aeif_cond_alpha``). The connection with
86astrocytes is established through ``sic_connection``, which sends slow inward
87current (SIC) from an astrocyte to ``aeif_cond_alpha_astro``.
88
89The membrane potential is given by the following differential equation
90(adapted from ``aeif_cond_alpha``):
91
92.. math::
93
94 C_m \frac{dV}{dt} =
95 -g_L(V-E_L)+g_L\Delta_T\exp\left(\frac{V-V_{th}}{\Delta_T}\right) -
96 g_e(t)(V-E_e) \\
97 -g_i(t)(V-E_i)-w +I_e + I_{\text{SIC}}
98
99and
100
101.. math::
102
103 \tau_w \frac{dw}{dt} = a(V-E_L) - w
104
105Here, :math:`I_{\text{SIC}}` is the sum of slow inward currents received from all
106astrocytes connected to the neuron. The other parameters and
107variables are the same as in ``aeif_cond_alpha``.
108
109For implementation details of the adaptive exponential integrate-and-fire neuron
110model, see the
111`aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook.
112
113
114.. note::
115
116 The default refractory period for ``aeif`` models is zero, consistent with the model definition in
117 Brette & Gerstner :footcite:p:`Brette2005`. Thus, an ``aeif`` neuron with default parameters can fire multiple
118 spikes in a single time step, which can lead to exploding spike numbers and extreme slow-down of simulations.
119
120 To avoid such unphysiological behavior, you should set a refractory time ``t_ref > 0``.
121
122.. note::
123
124 Incoming spikes are routed to the excitatory or inhibitory synapse type by the **sign of the
125 connection weight**. A positive weight targets the excitatory synapse type, a negative weight
126 the inhibitory one. Only the absolute value of the weight sets the conductance
127 amplitude. Spike connections must use the default ``receptor_type`` of 0.
128
129 See :ref:`synapse_selection` for the conventions used by other models.
130
131Parameters
132++++++++++
133
134The following parameters can be set in the status Dictionary.
135
136======== ======= =======================================
137**Dynamic state variables**
138--------------------------------------------------------
139 V_m mV Membrane potential
140 g_ex nS Excitatory synaptic conductance
141 dg_ex nS/ms First derivative of g_ex
142 g_in nS Inhibitory synaptic conductance
143 dg_in nS/ms First derivative of g_in
144 w pA Spike-adaptation current
145======== ======= =======================================
146
147======== ======= =======================================
148**Membrane Parameters**
149--------------------------------------------------------
150 C_m pF Capacity of the membrane
151 t_ref ms Duration of refractory period
152 V_reset mV Reset value for V_m after a spike
153 E_L mV Leak reversal potential
154 g_L nS Leak conductance
155 I_e pA Constant external input current
156======== ======= =======================================
157
158======== ======= ==================================
159**Spike adaptation parameters**
160---------------------------------------------------
161 a ns Subthreshold adaptation
162 b pA Spike-triggered adaptation
163 Delta_T mV Slope factor
164 tau_w ms Adaptation time constant
165 V_th mV Spike initiation threshold
166 V_peak mV Spike detection threshold
167======== ======= ==================================
168
169=========== ======= ===========================================================
170**Synaptic parameters**
171-------------------------------------------------------------------------------
172 E_ex mV Excitatory reversal potential
173 tau_syn_ex ms Rise time of the excitatory synaptic conductance (alpha
174 function)
175 E_in mV Inhibitory reversal potential
176 tau_syn_in ms Rise time of the inhibitory synaptic conductance
177 (alpha function)
178=========== ======= ===========================================================
179
180============= ======= =========================================================
181**Integration parameters**
182-------------------------------------------------------------------------------
183gsl_error_tol real This parameter controls the admissible error of the
184 GSL integrator. Reduce it if NEST complains about
185 numerical instabilities.
186============= ======= =========================================================
187
188Sends
189+++++
190
191SpikeEvent
192
193Receives
194++++++++
195
196SpikeEvent, CurrentEvent, DataLoggingRequest, SICEvent
197
198References
199++++++++++
200
201.. footbibliography::
202
203See also
204++++++++
205
206iaf_cond_alpha, aeif_cond_exp, astrocyte_lr_1994, sic_connection
207
208Examples using this model
209+++++++++++++++++++++++++
210
211.. listexamples:: aeif_cond_alpha_astro
212
213EndUserDocs */
214
215void register_aeif_cond_alpha_astro( const std::string& name );
216
217class aeif_cond_alpha_astro : public ArchivingNode
218{
219
220public:
221 aeif_cond_alpha_astro();
222 aeif_cond_alpha_astro( const aeif_cond_alpha_astro& );
223 ~aeif_cond_alpha_astro() override;
224
230 using Node::handle;
231 using Node::handles_test_event;
232
233 size_t send_test_event( Node&, size_t, synindex, bool ) override;
234
235 void handle( SpikeEvent& ) override;
236 void handle( CurrentEvent& ) override;
237 void handle( SICEvent& ) override;
238 void handle( DataLoggingRequest& ) override;
239
240 size_t handles_test_event( SpikeEvent&, size_t ) override;
241 size_t handles_test_event( CurrentEvent&, size_t ) override;
242 size_t handles_test_event( SICEvent&, size_t ) override;
243 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
244
245 void get_status( Dictionary& ) const override;
246 void set_status( const Dictionary& ) override;
247
248private:
249 void init_buffers_() override;
250 void pre_run_hook() override;
251 void update( Time const&, const long, const long ) override;
252
253 // END Boilerplate function declarations ----------------------------
254
255 // Friends --------------------------------------------------------
256
257 // make dynamics function quasi-member
258 friend int aeif_cond_alpha_astro_dynamics( double, const double*, double*, void* );
259
260 // The next two classes need to be friends to access the State_ class/member
261 friend class RecordablesMap< aeif_cond_alpha_astro >;
262 friend class UniversalDataLogger< aeif_cond_alpha_astro >;
263
264private:
265 // ----------------------------------------------------------------
266
268 struct Parameters_
269 {
270 double V_peak_;
271 double V_reset_;
272 double t_ref_;
273
274 double g_L;
275 double C_m;
276 double E_ex;
277 double E_in;
278 double E_L;
279 double Delta_T;
280 double tau_w;
281 double a;
282 double b;
283 double V_th;
284 double tau_syn_ex;
285 double tau_syn_in;
286 double I_e;
287
288 double gsl_error_tol;
289
290 Parameters_();
291
292 void get( Dictionary& ) const;
293 void set( const Dictionary&, Node* node );
294 };
295
296public:
297 // ----------------------------------------------------------------
298
303 struct State_
304 {
311 enum StateVecElems
312 {
313 V_M = 0,
314 DG_EXC, // 1
315 G_EXC, // 2
316 DG_INH, // 3
317 G_INH, // 4
318 W, // 5
319 STATE_VEC_SIZE
320 };
321
322 double y_[ STATE_VEC_SIZE ];
324 unsigned int r_;
325
326 State_( const Parameters_& );
327 State_( const State_& );
328 State_& operator=( const State_& );
329
330 void get( Dictionary& ) const;
331 void set( const Dictionary&, const Parameters_&, Node* );
332 };
333
334 // ----------------------------------------------------------------
335
339 struct Buffers_
340 {
341 Buffers_( aeif_cond_alpha_astro& );
342 Buffers_( const Buffers_&, aeif_cond_alpha_astro& );
343
345 UniversalDataLogger< aeif_cond_alpha_astro > logger_;
346
348 RingBuffer spike_exc_;
349 RingBuffer spike_inh_;
350 RingBuffer currents_;
351
353 gsl_odeiv_step* s_;
354 gsl_odeiv_control* c_;
355 gsl_odeiv_evolve* e_;
356 gsl_odeiv_system sys_;
357
358 // Since IntergrationStep_ is initialized with step_, and the resolution
359 // cannot change after nodes have been created, it is safe to place both
360 // here.
361 double step_;
362 double IntegrationStep_;
363
364 RingBuffer sic_currents_;
365
373 double I_stim_;
374 double I_sic_;
375 };
376
377 // ----------------------------------------------------------------
378
382 struct Variables_
383 {
385 double g0_ex_;
386
388 double g0_in_;
389
394 double V_peak;
395
396 unsigned int refractory_counts_;
397 };
398
399 // Access functions for UniversalDataLogger -------------------------------
400
402 template < State_::StateVecElems elem >
403 double
404 get_y_elem_() const
405 {
406 return S_.y_[ elem ];
407 }
408
409 // Read out SIC current
410 double
411 get_I_sic_() const
412 {
413 return B_.I_sic_;
414 }
415
416 // ----------------------------------------------------------------
417
418 Parameters_ P_;
419 State_ S_;
420 Variables_ V_;
421 Buffers_ B_;
422
424 static RecordablesMap< aeif_cond_alpha_astro > recordablesMap_;
425};
426
427inline size_t
428aeif_cond_alpha_astro::send_test_event( Node& target, size_t receptor_type, synindex, bool )
429{
431 e.set_sender( *this );
432
433 return target.handles_test_event( e, receptor_type );
434}
435
436inline size_t
437aeif_cond_alpha_astro::handles_test_event( SpikeEvent&, size_t receptor_type )
438{
439 if ( receptor_type != 0 )
440 {
441 throw UnknownReceptorType( receptor_type, get_name() );
442 }
443 return 0;
444}
445
446inline size_t
447aeif_cond_alpha_astro::handles_test_event( CurrentEvent&, size_t receptor_type )
448{
449 if ( receptor_type != 0 )
450 {
451 throw UnknownReceptorType( receptor_type, get_name() );
452 }
453 return 0;
454}
455
456inline size_t
457aeif_cond_alpha_astro::handles_test_event( SICEvent&, size_t receptor_type )
458{
459 if ( receptor_type != 0 )
460 {
461 throw UnknownReceptorType( receptor_type, get_name() );
462 }
463 return 0;
464}
465
466inline size_t
467aeif_cond_alpha_astro::handles_test_event( DataLoggingRequest& dlr, size_t receptor_type )
468{
469 if ( receptor_type != 0 )
470 {
471 throw UnknownReceptorType( receptor_type, get_name() );
472 }
473 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
474}
475
476inline void
477aeif_cond_alpha_astro::get_status( Dictionary& d ) const
478{
479 P_.get( d );
480 S_.get( d );
482
483 d[ names::recordables ] = recordablesMap_.get_list();
484}
485
486inline void
487aeif_cond_alpha_astro::set_status( const Dictionary& d )
488{
489 Parameters_ ptmp = P_; // temporary copy in case of errors
490 ptmp.set( d, this ); // throws if BadProperty
491 State_ stmp = S_; // temporary copy in case of errors
492 stmp.set( d, ptmp, this ); // throws if BadProperty
493
494 // We now know that (ptmp, stmp) are consistent. We do not
495 // write them back to (P_, S_) before we are also sure that
496 // the properties to be set in the parent class are internally
497 // consistent.
499
500 // if we get here, temporaries contain consistent set of properties
501 P_ = ptmp;
502 S_ = stmp;
503}
504
505} // namespace
506
507#endif // HAVE_GSL
508#endif // AEIF_COND_ALPHA_ASTRO_H
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:249
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:265
Event for electrical currents.
Definition event.h:608
Request data to be logged/logged data to be sent.
Definition event.h:675
Base class for all NEST network objects.
Definition node.h:99
Event for slow inward current (SIC) connections between astrocytes and neurons.
Definition secondary_event.h:458
Event for spike information.
Definition event.h:420
Exception to be thrown if the specified receptor type does not exist in the node.
Definition exceptions.h:417
const std::string tau_syn_in("tau_syn_in")
const std::string E_L("E_L")
const std::string I_e("I_e")
const std::string recordables("recordables")
const std::string C_m("C_m")
const std::string d("d")
const std::string gsl_error_tol("gsl_error_tol")
const std::string V_th("V_th")
const std::string a("a")
const std::string V_peak("V_peak")
const std::string E_in("E_in")
const std::string target("target")
const std::string tau_syn_ex("tau_syn_ex")
const std::string b("b")
const std::string tau_w("tau_w")
const std::string Delta_T("Delta_T")
const std::string E_ex("E_ex")
const std::string g_L("g_L")
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
RecordablesMap< binary_neuron< TGainfunction > > binary_neuron< TGainfunction >::recordablesMap_
Definition binary_neuron.h:319
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:121
const double e
Definition numerics.cpp:32