NEST main@caf0ae8
 
Loading...
Searching...
No Matches
ht_neuron.h
Go to the documentation of this file.
1/*
2 * ht_neuron.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 HT_NEURON_H
24#define HT_NEURON_H
25
26// Generated includes:
27#include "config.h"
28
29#ifdef HAVE_GSL
30
31// C++ includes:
32#include <string>
33#include <vector>
34
35// C includes:
36#include <gsl/gsl_errno.h>
37#include <gsl/gsl_matrix.h>
38#include <gsl/gsl_odeiv.h>
39
40// Includes from nestkernel:
41#include "archiving_node.h"
42#include "connection.h"
43#include "recordables_map.h"
44#include "ring_buffer.h"
46
47
48namespace nest
49{
60extern "C" int ht_neuron_dynamics( double, const double*, double*, void* );
61
62/* BeginUserDocs: neuron, adaptation, integrate-and-fire, soft threshold, Hill-Tononi
63
64Short description
65+++++++++++++++++
66
67Neuron model after Hill & Tononi (2005)
68
69Description
70+++++++++++
71
72This model neuron implements a slightly modified version of the
73neuron model described in :footcite:p:`Hill2005`. The most important properties are:
74
75- Integrate-and-fire with adaptive threshold.
76- Repolarizing potassium current instead of hard reset.
77- AMPA, NMDA, GABA_A, and GABA_B conductance-based synapses with
78 beta-function (difference of exponentials) time course.
79- Voltage-dependent NMDA with instantaneous or two-stage unblocking :footcite:p:`Hill2005`, :footcite:p:`Vargas2003`.
80- Intrinsic currents I_h, I_T, I_Na(p), and I_KNa.
81- Synaptic "minis" are not implemented.
82
83For implementation details see:
84
85- `HillTononi_model <../model_details/HillTononiModels.ipynb>`_
86
87For examples, see:
88
89- :doc:`../auto_examples/intrinsic_currents_spiking`
90- :doc:`../auto_examples/intrinsic_currents_subthreshold`
91
92For an example network model using ``ht_neuron`` (based on :footcite:p:`Hill2005`), see:
93
94- `Multiarea Hill-Tononi thalamocortical network model
95 <https://github.com/ricardomurphy/Multiarea-Hill-Tononi-thalamocortical-network-model>`_
96
97Parameters
98++++++++++
99
100=============== ======= =========================================================
101 V_m mV Membrane potential
102 tau_m ms Membrane time constant applying to all currents except
103 repolarizing K-current (see :footcite:p:`Hill2005`, p 1677)
104 t_ref ms Refractory time and duration of post-spike repolarizing
105 potassium current (t_spike in :footcite:p:`Hill2005`)
106 tau_spike ms Membrane time constant for post-spike repolarizing
107 potassium current
108 voltage_clamp boolean If true, clamp voltage to value at beginning of
109 simulation
110 (default: false, mainly for testing)
111 theta mV Threshold
112 theta_eq mV Equilibrium value
113 tau_theta ms Time constant
114 g_KL nS Conductance for potassium leak current
115 E_K mV Reversal potential for potassium leak currents
116 g_NaL nS Conductance for sodium leak currents
117 E_Na mV Reversal potential for Na leak currents
118 tau_D_KNa ms Relaxation time constant for I_KNa
119 receptor_types Dictionary mapping synapse names to ports on neuron model
120 recordables List of recordable quantities
121=============== ======= =========================================================
122
123+------------------------------------------------------------+
124|{E_rev,g_peak,tau_rise,tau_decay}_{AMPA,NMDA,GABA_A,GABA_B} |
125+------------------------------------------------------------+
126| Reversal potentials, peak conductances and time constants |
127| for synapses (tau_rise/tau_decay correspond to tau_1/tau_2 |
128| in the paper) |
129+------------------------------------------------------------+
130
131+------------------------+------------------------------------------------+
132|V_act_NMDA, S_act_NMDA, | Parameters for voltage dependence of NMDA- |
133|tau_Mg_{fast, slow}_NMDA| conductance, see above |
134+------------------------+------------------------------------------------+
135
136============================ =================================================
137instant_unblock_NMDA Instantaneous NMDA unblocking (default: false)
138{E_rev,g_peak}_{h,T,NaP,KNa} Reversal potential and peak conductance for
139 intrinsic currents
140{N}_{T,NaP} Exponent activation term m_inf, corresponding to
141 number of activation particles
142equilibrate If given and true, time-dependent activation
143 and inactivation state variables (h, m) of
144 intrinsic currents and NMDA channels are set
145 to their equilibrium values during this
146 SetStatus call; otherwise they retain their
147 present values.
148============================ =================================================
149
150.. note::
151 Conductances are unitless in this model and currents are in mV.
152
153Sends
154+++++
155
156SpikeEvent
157
158Receives
159++++++++
160
161SpikeEvent, CurrentEvent, DataLoggingRequest
162
163References
164++++++++++
165
166.. footbibliography::
167
168See also
169++++++++
170
171ht_synapse
172
173Examples using this model
174+++++++++++++++++++++++++
175
176.. listexamples:: ht_neuron
177
178EndUserDocs */
179
180void register_ht_neuron( const std::string& name );
181
182class ht_neuron : public ArchivingNode
183{
184public:
185 ht_neuron();
186 ht_neuron( const ht_neuron& );
187 ~ht_neuron() override;
188
194 using Node::handle;
195 using Node::handles_test_event;
196
197 size_t send_test_event( Node&, size_t, synindex, bool ) override;
198
199 void handle( SpikeEvent& e ) override;
200 void handle( CurrentEvent& e ) override;
201 void handle( DataLoggingRequest& ) override;
202
203 size_t handles_test_event( SpikeEvent&, size_t ) override;
204 size_t handles_test_event( CurrentEvent&, size_t ) override;
205 size_t handles_test_event( DataLoggingRequest&, size_t ) override;
206
207 void get_status( Dictionary& ) const override;
208 void set_status( const Dictionary& ) override;
209
210private:
216 enum SynapseTypes
217 {
218 INF_SPIKE_RECEPTOR = 0,
219 AMPA,
220 NMDA,
221 GABA_A,
222 GABA_B,
223 SUP_SPIKE_RECEPTOR
224 };
225
226 void init_buffers_() override;
227 void pre_run_hook() override;
228
229 void update( Time const&, const long, const long ) override;
230
231 double get_synapse_constant( double, double, double );
232
233 // END Boilerplate function declarations ----------------------------
234
235 // Friends --------------------------------------------------------
236
237 // make dynamics function quasi-member
238 friend int ht_neuron_dynamics( double, const double*, double*, void* );
239
240 // ----------------------------------------------------------------
241
245 struct Parameters_
246 {
247 Parameters_();
248
249 void get( Dictionary& ) const;
250 void set( const Dictionary&, Node* node );
251
252 // Note: Conductances are unitless
253 // Leaks
254 double E_Na; // mV
255 double E_K; // mV
256 double g_NaL;
257 double g_KL;
258 double tau_m; // ms
259
260 // Dynamic threshold
261 double theta_eq; // mV
262 double tau_theta; // ms
263
264 // Post-spike potassium current
265 double tau_spike; // ms, membrane time constant for this current
266 double t_ref; // ms, refractory time
267
268 // Parameters for synapse of type AMPA, GABA_A, GABA_B and NMDA
269 double g_peak_AMPA;
270 double tau_rise_AMPA; // ms
271 double tau_decay_AMPA; // ms
272 double E_rev_AMPA; // mV
273
274 double g_peak_NMDA;
275 double tau_rise_NMDA; // ms
276 double tau_decay_NMDA; // ms
277 double E_rev_NMDA; // mV
278 double V_act_NMDA; // mV, inactive for V << Vact, inflection of sigmoid
279 double S_act_NMDA; // mV, scale of inactivation
280 double tau_Mg_slow_NMDA; // ms
281 double tau_Mg_fast_NMDA; // ms
283
284 double g_peak_GABA_A;
285 double tau_rise_GABA_A; // ms
286 double tau_decay_GABA_A; // ms
287 double E_rev_GABA_A; // mV
288
289 double g_peak_GABA_B;
290 double tau_rise_GABA_B; // ms
291 double tau_decay_GABA_B; // ms
292 double E_rev_GABA_B; // mV
293
294 // parameters for intrinsic currents
295 double g_peak_NaP;
296 double E_rev_NaP; // mV
297 double N_NaP;
298
299 double g_peak_KNa;
300 double E_rev_KNa; // mV
301 double tau_D_KNa; // ms
302
303 double g_peak_T;
304 double E_rev_T; // mV
305 double N_T;
306
307 double g_peak_h;
308 double E_rev_h; // mV
309
310 bool voltage_clamp;
311 };
312
313 // ----------------------------------------------------------------
314
318public:
319 struct State_
320 {
321 // y_ = [V, theta, Synapses]
322 enum StateVecElems_
323 {
324 V_M = 0,
325 THETA,
326 DG_AMPA,
327 G_AMPA,
328 DG_NMDA_TIMECOURSE,
329 G_NMDA_TIMECOURSE,
330 DG_GABA_A,
331 G_GABA_A,
332 DG_GABA_B,
333 G_GABA_B, // DO NOT INSERT ANYTHING UP TO HERE, WILL MIX UP
334 // SPIKE DELIVERY
335 m_fast_NMDA,
336 m_slow_NMDA,
337 m_Ih,
338 D_IKNa,
339 m_IT,
340 h_IT,
341 STATE_VEC_SIZE
342 };
343
345 double y_[ STATE_VEC_SIZE ];
346
350 long ref_steps_;
351
352 double I_NaP_;
353 double I_KNa_;
354 double I_T_;
355 double I_h_;
356
357 State_( const ht_neuron&, const Parameters_& p );
358 State_( const State_& s );
359
360 State_& operator=( const State_& s );
361
362 ~State_();
363
364 void get( Dictionary& ) const;
365 void set( const Dictionary&, const ht_neuron&, Node* node );
366 };
367
368private:
369 // These friend declarations must be precisely here.
370 friend class RecordablesMap< ht_neuron >;
371 friend class UniversalDataLogger< ht_neuron >;
372
373
374 // ----------------------------------------------------------------
375
379 struct Buffers_
380 {
381 Buffers_( ht_neuron& );
382 Buffers_( const Buffers_&, ht_neuron& );
383
384 UniversalDataLogger< ht_neuron > logger_;
385
387 std::vector< RingBuffer > spike_inputs_;
388 RingBuffer currents_;
389
391 gsl_odeiv_step* s_;
392 gsl_odeiv_control* c_;
393 gsl_odeiv_evolve* e_;
394 gsl_odeiv_system sys_;
395
396 // Since IntegrationStep_ is initialized with step_, and the resolution
397 // cannot change after nodes have been created, it is safe to place both
398 // here.
399 double step_;
400 double integration_step_;
401
409 double I_stim_;
410 };
411
412 // ----------------------------------------------------------------
413
417 struct Variables_
418 {
420 std::vector< double > cond_steps_;
421
423 int PotassiumRefractoryCounts_;
424
426 double V_clamp_;
427 };
428
429
430 // readout functions, can use template for vector elements
431 template < State_::StateVecElems_ elem >
432 double
433 get_y_elem_() const
434 {
435 return S_.y_[ elem ];
436 }
437 double
438 get_I_NaP_() const
439 {
440 return S_.I_NaP_;
441 }
442 double
443 get_I_KNa_() const
444 {
445 return S_.I_KNa_;
446 }
447 double
448 get_I_T_() const
449 {
450 return S_.I_T_;
451 }
452 double
453 get_I_h_() const
454 {
455 return S_.I_h_;
456 }
457
458 double get_g_NMDA_() const;
459
465 double m_NMDA_( double V, double m_eq, double m_fast, double m_slow ) const;
466
473 double m_eq_h_( double V ) const;
474
481 double m_eq_T_( double V ) const;
482
489 double h_eq_T_( double V ) const;
490
497 double m_eq_NMDA_( double V ) const;
498
502 double D_eq_KNa_( double V ) const;
503
504 static RecordablesMap< ht_neuron > recordablesMap_;
505
506 Parameters_ P_;
507 State_ S_;
508 Variables_ V_;
509 Buffers_ B_;
510};
511
512
513inline size_t
514ht_neuron::send_test_event( Node& target, size_t receptor_type, synindex, bool )
515{
516 SpikeEvent e;
517 e.set_sender( *this );
518
519 return target.handles_test_event( e, receptor_type );
520}
521
522
523inline size_t
524ht_neuron::handles_test_event( SpikeEvent&, size_t receptor_type )
525{
526 assert( B_.spike_inputs_.size() == 4 );
527
528 if ( not( INF_SPIKE_RECEPTOR < receptor_type and receptor_type < SUP_SPIKE_RECEPTOR ) )
529 {
530 throw UnknownReceptorType( receptor_type, get_name() );
531 return 0;
532 }
533 else
534 {
535 return receptor_type - 1;
536 }
537}
538
539inline size_t
540ht_neuron::handles_test_event( CurrentEvent&, size_t receptor_type )
541{
542 if ( receptor_type != 0 )
543 {
544 throw UnknownReceptorType( receptor_type, get_name() );
545 }
546 return 0;
547}
548
549inline size_t
550ht_neuron::handles_test_event( DataLoggingRequest& dlr, size_t receptor_type )
551{
552 if ( receptor_type != 0 )
553 {
554 throw UnknownReceptorType( receptor_type, get_name() );
555 }
556 return B_.logger_.connect_logging_device( dlr, recordablesMap_ );
557}
558}
559
560#endif // HAVE_GSL
561#endif // HT_NEURON_H
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
const std::string E_rev_GABA_B("E_rev_GABA_B")
const std::string AMPA("AMPA")
const std::string t_ref("t_ref")
const std::string tau_m("tau_m")
const std::string g_peak_NMDA("g_peak_NMDA")
const std::string E_rev_AMPA("E_rev_AMPA")
const std::string E_rev_GABA_A("E_rev_GABA_A")
const std::string E_rev_T("E_rev_T")
const std::string E_K("E_K")
const std::string g_NaL("g_NaL")
const std::string NMDA("NMDA")
const std::string tau_rise_GABA_A("tau_rise_GABA_A")
const std::string g_peak_KNa("g_peak_KNa")
const std::string g_peak_AMPA("g_peak_AMPA")
const std::string tau_rise_NMDA("tau_rise_NMDA")
const std::string E_rev_h("E_rev_h")
const std::string E_Na("E_Na")
const std::string tau_decay_GABA_B("tau_decay_GABA_B")
const std::string tau_theta("tau_theta")
const std::string tau_Mg_fast_NMDA("tau_Mg_fast_NMDA")
const std::string S_act_NMDA("S_act_NMDA")
const std::string E_rev_KNa("E_rev_KNa")
const std::string receptor_type("receptor_type")
const std::string E_rev_NaP("E_rev_NaP")
const std::string tau_decay_NMDA("tau_decay_NMDA")
const std::string E_rev_NMDA("E_rev_NMDA")
const std::string tau_rise_AMPA("tau_rise_AMPA")
const std::string instant_unblock_NMDA("instant_unblock_NMDA")
const std::string N_NaP("N_NaP")
const std::string target("target")
const std::string g_peak_h("g_peak_h")
const std::string g_peak_GABA_A("g_peak_GABA_A")
const std::string g_peak_GABA_B("g_peak_GABA_B")
const std::string tau_decay_AMPA("tau_decay_AMPA")
const std::string tau_Mg_slow_NMDA("tau_Mg_slow_NMDA")
const std::string tau_decay_GABA_A("tau_decay_GABA_A")
const std::string g_peak_T("g_peak_T")
const std::string GABA_B("GABA_B")
const std::string GABA_A("GABA_A")
const std::string voltage_clamp("voltage_clamp")
const std::string tau_rise_GABA_B("tau_rise_GABA_B")
const std::string g_peak_NaP("g_peak_NaP")
const std::string V_act_NMDA("V_act_NMDA")
const std::string theta_eq("theta_eq")
const std::string g_KL("g_KL")
const std::string N_T("N_T")
const std::string tau_spike("tau_spike")
const std::string tau_D_KNa("tau_D_KNa")
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