MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
AdExIF.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2007 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include "header.h"
11 #include "ElementValueFinfo.h"
12 #include "../biophysics/CompartmentBase.h"
13 #include "../biophysics/Compartment.h"
14 #include "IntFireBase.h"
15 #include "ExIF.h"
16 #include "AdExIF.h"
17 
18 using namespace moose;
19 
21 {
22  static string doc[] =
23  {
24  "Name", "AdExIF",
25  "Author", "Aditya Gilra",
26  "Description", "Leaky Integrate-and-Fire neuron with Exponential spike rise"
27  " and adaptation via an adapting current w."
28  "Rm*Cm * dVm/dt = -(Vm-Em) + deltaThresh * exp((Vm-thresh)/deltaThresh) + Rm*I - w "
29  "tau_w * d w /dt = a0*(Vm-Em) - w "
30  "at each spike, w -> w + b0 "
31  };
32 
34  "w",
35  "adaptation current with time constant tauW",
36  &AdExIF::setW,
38  );
39 
41  "tauW",
42  "time constant of adaptation current w",
45  );
46 
48  "a0",
49  "factor for voltage-dependent term in evolution of adaptation current: "
50  "tau_w dw/dt = a0*(Vm-Em) - w",
53  );
54 
56  "b0",
57  "b0 is added to w, the adaptation current on each spike",
60  );
61 
62  static Finfo* AdExIFFinfos[] = {
63  &w, // Value
64  &tauW, // Value
65  &a0, // Value
66  &b0, // Value
67  };
68 
69  static Dinfo< AdExIF > dinfo;
70  static Cinfo AdExIFCinfo(
71  "AdExIF",
73  AdExIFFinfos,
74  sizeof( AdExIFFinfos ) / sizeof (Finfo*),
75  &dinfo,
76  doc,
77  sizeof(doc)/sizeof(string)
78  );
79 
80  return &AdExIFCinfo;
81 }
82 
84 
86 // Here we put the Compartment class functions.
88 
90 {w_ = 0.0;
91 tauW_ = 1.0;
92 a0_ = 0.0;
93 b0_ = 0.0;}
94 
96 {;}
97 
99 // AdExIF::Dest function definitions.
101 
102 void AdExIF::vProcess( const Eref& e, ProcPtr p )
103 {
104  fired_ = false;
105  if ( p->currTime < lastEvent_ + refractT_ ) {
106  Vm_ = vReset_;
107  A_ = 0.0;
108  B_ = 1.0 / Rm_;
109  sumInject_ = 0.0;
110  VmOut()->send( e, Vm_ );
111  } else {
112  // activation can be a continous variable (graded synapse).
113  // So integrate it at every time step, thus *dt.
114  // For a delta-fn synapse, SynHandler-s divide by dt and send activation.
115  // See: http://www.genesis-sim.org/GENESIS/Hyperdoc/Manual-26.html#synchan
116  // for this continuous definition of activation.
117  Vm_ += activation_ * p->dt;
118  activation_ = 0.0;
119  if ( Vm_ >= vPeak_ ) {
120  Vm_ = vReset_;
121  w_ += b0_;
122  lastEvent_ = p->currTime;
123  fired_ = true;
124  spikeOut()->send( e, p->currTime );
125  VmOut()->send( e, Vm_ );
126  } else {
127  Vm_ += ( deltaThresh_ * exp((Vm_-threshold_)/deltaThresh_) - Rm_*w_ )
128  *p->dt/Rm_/Cm_;
129  w_ += (-w_ + a0_*(Vm_-Em_)) * p->dt/tauW_;
130  Compartment::vProcess( e, p ); // this sends out Vm message also,
131  // so do calculations before
132  }
133  }
134 }
135 
136 void AdExIF::vReinit( const Eref& e, ProcPtr p )
137 {
138  activation_ = 0.0;
139  w_ = 0.0;
140  fired_ = false;
141  lastEvent_ = -refractT_; // Allow it to fire right away.
142  Compartment::vReinit( e, p );
143 }
144 
145 void AdExIF::setW( const Eref& e, double val )
146 {
147  w_ = val;
148 }
149 
150 double AdExIF::getW( const Eref& e ) const
151 {
152  return w_;
153 }
154 
155 void AdExIF::setTauW( const Eref& e, double val )
156 {
157  tauW_ = val;
158 }
159 
160 double AdExIF::getTauW( const Eref& e ) const
161 {
162  return tauW_;
163 }
164 
165 void AdExIF::setA0( const Eref& e, double val )
166 {
167  a0_ = val;
168 }
169 
170 double AdExIF::getA0( const Eref& e ) const
171 {
172  return a0_;
173 }
174 
175 void AdExIF::setB0( const Eref& e, double val )
176 {
177  b0_ = val;
178 }
179 
180 double AdExIF::getB0( const Eref& e ) const
181 {
182  return b0_;
183 }
double vPeak_
Definition: ExIF.h:48
double b0_
Definition: AdExIF.h:54
void setW(const Eref &e, double val)
Definition: AdExIF.cpp:145
double getA0(const Eref &e) const
Definition: AdExIF.cpp:170
double getB0(const Eref &e) const
Definition: AdExIF.cpp:180
void vReinit(const Eref &e, ProcPtr p)
double currTime
Definition: ProcInfo.h:19
Definition: Dinfo.h:60
double getW(const Eref &e) const
Definition: AdExIF.cpp:150
void vProcess(const Eref &e, ProcPtr p)
Definition: AdExIF.cpp:102
void vProcess(const Eref &e, ProcPtr p)
static const Cinfo * initCinfo()
Definition: AdExIF.cpp:20
void setB0(const Eref &e, double val)
Definition: AdExIF.cpp:175
static const Cinfo * initCinfo()
Definition: ExIF.cpp:19
double getTauW(const Eref &e) const
Definition: AdExIF.cpp:160
double dt
Definition: ProcInfo.h:18
double w_
Definition: AdExIF.h:51
static SrcFinfo1< double > * spikeOut()
Message src for outgoing spikes.
Definition: IntFireBase.cpp:17
double a0_
Definition: AdExIF.h:53
Definition: Eref.h:26
void setA0(const Eref &e, double val)
Definition: AdExIF.cpp:165
double deltaThresh_
Definition: ExIF.h:47
static const Cinfo * AdExIFCinfo
Definition: AdExIF.cpp:83
static SrcFinfo1< double > * VmOut()
void vReinit(const Eref &e, ProcPtr p)
Definition: AdExIF.cpp:136
double tauW_
Definition: AdExIF.h:52
virtual ~AdExIF()
Definition: AdExIF.cpp:95
void setTauW(const Eref &e, double val)
Definition: AdExIF.cpp:155
Definition: Cinfo.h:18
Definition: Finfo.h:12