NEST main@caf0ae8
 
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
122Parameters
123++++++++++
124
125The following parameters can be set in the status Dictionary.
126
127======== ======= =======================================
128**Dynamic state variables**
129--------------------------------------------------------
130 V_m mV Membrane potential
131 g_ex nS Excitatory synaptic conductance
132 dg_ex nS/ms First derivative of g_ex
133 g_in nS Inhibitory synaptic conductance
134 dg_in nS/ms First derivative of g_in
135 w pA Spike-adaptation current
136======== ======= =======================================
137
138======== ======= =======================================
139**Membrane Parameters**
140--------------------------------------------------------
141 C_m pF Capacity of the membrane
142 t_ref ms Duration of refractory period
143 V_reset mV Reset value for V_m after a spike
144 E_L mV Leak reversal potential
145 g_L nS Leak conductance
146 I_e pA Constant external input current
147======== ======= =======================================
148
149======== ======= ==================================
150**Spike adaptation parameters**
151---------------------------------------------------
152 a ns Subthreshold adaptation
153 b pA Spike-triggered adaptation
154 Delta_T mV Slope factor
155 tau_w ms Adaptation time constant
156 V_th mV Spike initiation threshold
157 V_peak mV Spike detection threshold
158======== ======= ==================================
159
160=========== ======= ===========================================================
161**Synaptic parameters**
162-------------------------------------------------------------------------------
163 E_ex mV Excitatory reversal potential
164 tau_syn_ex ms Rise time of the excitatory synaptic conductance (alpha
165 function)
166 E_in mV Inhibitory reversal potential
167 tau_syn_in ms Rise time of the inhibitory synaptic conductance
168 (alpha function)
169=========== ======= ===========================================================
170
171============= ======= =========================================================
172**Integration parameters**
173-------------------------------------------------------------------------------
174gsl_error_tol real This parameter controls the admissible error of the
175 GSL integrator. Reduce it if NEST complains about
176 numerical instabilities.
177============= ======= =========================================================
178
179Sends
180+++++
181
182SpikeEvent
183
184Receives
185++++++++
186
187SpikeEvent, CurrentEvent, DataLoggingRequest, SICEvent
188
189References
190++++++++++
191
192.. footbibliography::
193
194See also
195++++++++
196
197iaf_cond_alpha, aeif_cond_exp, astrocyte_lr_1994, sic_connection
198
199Examples using this model
200+++++++++++++++++++++++++
201
202.. listexamples:: aeif_cond_alpha_astro
203
204EndUserDocs */
205
206void register_aeif_cond_alpha_astro( const std::string& name );
207
208class aeif_cond_alpha_astro : public ArchivingNode
209{
210
211public:
212 aeif_cond_alpha_astro();
213 aeif_cond_alpha_astro( const aeif_cond_alpha_astro& );
214 ~aeif_cond_alpha_astro() override;
215
221 using Node::handle;
222 using Node::handles_test_event;
223
224 size_t send_test_event( Node&, size_t, synindex, bool ) override;
225
226 void handle( SpikeEvent& ) override;
227 void handle( CurrentEvent& ) override;
228 void handle( SICEvent& ) override;
229 void handle( DataLoggingRequest& ) override;
230
231 size_t handles_test_event( SpikeEvent&, size_t ) override;
232 size_t handles_test_event( CurrentEvent&, size_t ) override;
233 size_t handles_test_event( SICEvent&, size_t ) override;
234 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
235
236 void get_status( Dictionary& ) const override;
237 void set_status( const Dictionary& ) override;
238
239private:
240 void init_buffers_() override;
241 void pre_run_hook() override;
242 void update( Time const&, const long, const long ) override;
243
244 // END Boilerplate function declarations ----------------------------
245
246 // Friends --------------------------------------------------------
247
248 // make dynamics function quasi-member
249 friend int aeif_cond_alpha_astro_dynamics( double, const double*, double*, void* );
250
251 // The next two classes need to be friends to access the State_ class/member
252 friend class RecordablesMap< aeif_cond_alpha_astro >;
253 friend class UniversalDataLogger< aeif_cond_alpha_astro >;
254
255private:
256 // ----------------------------------------------------------------
257
259 struct Parameters_
260 {
261 double V_peak_;
262 double V_reset_;
263 double t_ref_;
264
265 double g_L;
266 double C_m;
267 double E_ex;
268 double E_in;
269 double E_L;
270 double Delta_T;
271 double tau_w;
272 double a;
273 double b;
274 double V_th;
275 double tau_syn_ex;
276 double tau_syn_in;
277 double I_e;
278
279 double gsl_error_tol;
280
281 Parameters_();
282
283 void get( Dictionary& ) const;
284 void set( const Dictionary&, Node* node );
285 };
286
287public:
288 // ----------------------------------------------------------------
289
294 struct State_
295 {
302 enum StateVecElems
303 {
304 V_M = 0,
305 DG_EXC, // 1
306 G_EXC, // 2
307 DG_INH, // 3
308 G_INH, // 4
309 W, // 5
310 STATE_VEC_SIZE
311 };
312
313 double y_[ STATE_VEC_SIZE ];
315 unsigned int r_;
316
317 State_( const Parameters_& );
318 State_( const State_& );
319 State_& operator=( const State_& );
320
321 void get( Dictionary& ) const;
322 void set( const Dictionary&, const Parameters_&, Node* );
323 };
324
325 // ----------------------------------------------------------------
326
330 struct Buffers_
331 {
332 Buffers_( aeif_cond_alpha_astro& );
333 Buffers_( const Buffers_&, aeif_cond_alpha_astro& );
334
336 UniversalDataLogger< aeif_cond_alpha_astro > logger_;
337
339 RingBuffer spike_exc_;
340 RingBuffer spike_inh_;
341 RingBuffer currents_;
342
344 gsl_odeiv_step* s_;
345 gsl_odeiv_control* c_;
346 gsl_odeiv_evolve* e_;
347 gsl_odeiv_system sys_;
348
349 // Since IntergrationStep_ is initialized with step_, and the resolution
350 // cannot change after nodes have been created, it is safe to place both
351 // here.
352 double step_;
353 double IntegrationStep_;
354
355 RingBuffer sic_currents_;
356
364 double I_stim_;
365 double I_sic_;
366 };
367
368 // ----------------------------------------------------------------
369
373 struct Variables_
374 {
376 double g0_ex_;
377
379 double g0_in_;
380
385 double V_peak;
386
387 unsigned int refractory_counts_;
388 };
389
390 // Access functions for UniversalDataLogger -------------------------------
391
393 template < State_::StateVecElems elem >
394 double
395 get_y_elem_() const
396 {
397 return S_.y_[ elem ];
398 }
399
400 // Read out SIC current
401 double
402 get_I_sic_() const
403 {
404 return B_.I_sic_;
405 }
406
407 // ----------------------------------------------------------------
408
409 Parameters_ P_;
410 State_ S_;
411 Variables_ V_;
412 Buffers_ B_;
413
415 static RecordablesMap< aeif_cond_alpha_astro > recordablesMap_;
416};
417
418inline size_t
419aeif_cond_alpha_astro::send_test_event( Node& target, size_t receptor_type, synindex, bool )
420{
421 SpikeEvent e;
422 e.set_sender( *this );
423
424 return target.handles_test_event( e, receptor_type );
425}
426
427inline size_t
428aeif_cond_alpha_astro::handles_test_event( SpikeEvent&, size_t receptor_type )
429{
430 if ( receptor_type != 0 )
431 {
432 throw UnknownReceptorType( receptor_type, get_name() );
433 }
434 return 0;
435}
436
437inline size_t
438aeif_cond_alpha_astro::handles_test_event( CurrentEvent&, size_t receptor_type )
439{
440 if ( receptor_type != 0 )
441 {
442 throw UnknownReceptorType( receptor_type, get_name() );
443 }
444 return 0;
445}
446
447inline size_t
448aeif_cond_alpha_astro::handles_test_event( SICEvent&, size_t receptor_type )
449{
450 if ( receptor_type != 0 )
451 {
452 throw UnknownReceptorType( receptor_type, get_name() );
453 }
454 return 0;
455}
456
457inline size_t
458aeif_cond_alpha_astro::handles_test_event( DataLoggingRequest& dlr, size_t receptor_type )
459{
460 if ( receptor_type != 0 )
461 {
462 throw UnknownReceptorType( receptor_type, get_name() );
463 }
464 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
465}
466
467inline void
468aeif_cond_alpha_astro::get_status( Dictionary& d ) const
469{
470 P_.get( d );
471 S_.get( d );
473
474 d[ names::recordables ] = recordablesMap_.get_list();
475}
476
477inline void
478aeif_cond_alpha_astro::set_status( const Dictionary& d )
479{
480 Parameters_ ptmp = P_; // temporary copy in case of errors
481 ptmp.set( d, this ); // throws if BadProperty
482 State_ stmp = S_; // temporary copy in case of errors
483 stmp.set( d, ptmp, this ); // throws if BadProperty
484
485 // We now know that (ptmp, stmp) are consistent. We do not
486 // write them back to (P_, S_) before we are also sure that
487 // the properties to be set in the parent class are internally
488 // consistent.
490
491 // if we get here, temporaries contain consistent set of properties
492 P_ = ptmp;
493 S_ = stmp;
494}
495
496} // namespace
497
498#endif // HAVE_GSL
499#endif // AEIF_COND_ALPHA_ASTRO_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
void get_status(Dictionary &d) const override
Export properties of the node by setting entries in the status dictionary.
Definition archiving_node.cpp:220
void set_status(const Dictionary &d) override
Change properties of the node according to the entries in the dictionary.
Definition archiving_node.cpp:236
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
size_t synindex
For enumerations of synapse types.
Definition nest_types.h:115
const double e
Definition numerics.cpp:32