CSIM: TraubsHHNeuron.h Source File

TraubsHHNeuron.h

00001 #ifndef TraubsHHNeuron_H_
00002 #define TraubsHHNeuron_H_
00003 
00004 #include "cbneuron.h"
00005 #include "viongate.h"
00006 #include "activechannel.h"
00007 
00008 class Traubs_HH_n_Gate;
00009 class Traubs_HH_K_Channel;
00010 
00011 class Traubs_HH_h_Gate;
00012 class Traubs_HH_m_Gate;
00013 class Traubs_HH_Na_Channel;
00014 
00016 
00058 class TraubsHHNeuron : public CbNeuron {
00059 
00060  // This tells CSIM that you want to be able to access this object from Matlab
00061  DO_REGISTERING
00062 
00063 public:
00065   TraubsHHNeuron(void);
00067   virtual ~TraubsHHNeuron();
00069   virtual int init(Advancable *a);
00071   virtual int updateInternal(void);
00072 
00073 private:
00075   Traubs_HH_K_Channel  *k;
00077   Traubs_HH_Na_Channel *na;
00079   float Vtr;
00080 
00081 };
00082 
00084 
00089 #define VSCALE 1000
00090 
00092 #define TSCALE 1000
00093 
00095 //                       Traubs_HH_K_Channel  
00097 
00099 
00106 class Traubs_HH_n_Gate : public VIonGate {
00107 
00108 public:
00109 
00110   Traubs_HH_n_Gate(float Vtr) { 
00111     k=4; this->Vtr=Vtr;
00112   }
00113 
00114   double alpha(double V) { 
00115     return TSCALE*( fabs(15-(V-Vtr)*VSCALE) < 1e-15 ?
00116                      0.032 * 5 : 0.032*(15-(V-Vtr)*VSCALE)/(exp((15-(V-Vtr)*VSCALE)/5.0)-1.0) ); 
00117   }
00118 
00119   double beta(double V)  { 
00120     return TSCALE*(0.5*exp((10-(V-Vtr)*VSCALE)/40.0)); 
00121   }
00122 
00123   // This macro must be called for each new type of gate
00124   IONGATE_TABLES(Traubs_HH_n_Gate);
00125 
00126 private:
00127   float Vtr;
00128 
00129 };
00130 
00132 
00139 class Traubs_HH_K_Channel : public ActiveChannel {
00140 
00141   DO_REGISTERING
00142 
00143 public:
00144 
00145   Traubs_HH_K_Channel(double Gbar=0.06*1e-4, double Erev=-0.09, float Vtr = -0.063) {
00146     addGate(new Traubs_HH_n_Gate(Vtr));
00147     this->Gbar = Gbar;
00148     this->Erev = Erev;
00149   }
00150 
00151   virtual ~Traubs_HH_K_Channel(void) {
00152     for(int i=0;i<nGates;i++)
00153       delete gates[i];
00154   }
00155 
00156 };
00157 
00158 
00160 //                       Traubs_HH_Na_Channel  
00162 
00163 
00165 
00174 class Traubs_HH_m_Gate : public VIonGate {
00175 
00176 public:
00177 
00178   Traubs_HH_m_Gate(float Vtr) { k=3; this->Vtr = Vtr; }
00179 
00180   double alpha(double V) { return TSCALE*( fabs(13-(V-Vtr)*VSCALE)<1e-15 ?
00181                                          4*0.32 : (0.32*(13-(V-Vtr)*VSCALE))/(exp((13-(V-Vtr)*VSCALE)/4.0)-1.0)) ; }
00182 
00183   double beta(double V)  { return TSCALE*( fabs(40-(V-Vtr)*VSCALE)<1e-15 ?
00184                                          0.28 * 5 : (0.28*((V-Vtr)*VSCALE-40))/(exp(((V-Vtr)*VSCALE-40)/5.0)-1.0)); }
00185 
00186   IONGATE_TABLES(Traubs_HH_m_Gate);
00187 
00188 private:  
00189 
00190   float Vtr;
00191 
00192 };
00193 
00195 
00203 class Traubs_HH_h_Gate : public VIonGate {
00204 
00205 public:
00206   Traubs_HH_h_Gate(float Vtr) { k=1; this->Vtr = Vtr; }
00207 
00208   double alpha(double V) { return TSCALE*(0.128*exp((17-(V-Vtr)*VSCALE)/18.0)); }
00209 
00210   double beta(double V)  { return TSCALE*(4.0/(exp((40-(V-Vtr)*VSCALE)/5.0)+1)); }
00211 
00212   IONGATE_TABLES(Traubs_HH_h_Gate);
00213 
00214 private: 
00215   float Vtr;
00216 
00217 };
00218 
00220 
00228 class Traubs_HH_Na_Channel : public ActiveChannel {
00229 
00230   DO_REGISTERING
00231 
00232 public:
00233 
00234   Traubs_HH_Na_Channel(double Gbar=0.2*1e-4,double Erev=0.050, float Vtr = -0.063) {
00235     addGate(new Traubs_HH_m_Gate(Vtr));
00236     addGate(new Traubs_HH_h_Gate(Vtr));
00237     this->Gbar = Gbar;
00238     this->Erev = Erev;
00239   }
00240 
00241   virtual ~Traubs_HH_Na_Channel(void) {
00242     for(int i=0;i<nGates;i++)
00243       delete gates[i];
00244   }
00245 
00246 };
00247 
00248 #endif /*TraubsHHNeuron_H_*/

 
(C) 2003, Thomas Natschläger last modified 07/10/2006