CSIM: viongate.h Source File

viongate.h

00001 #ifndef __VIONGATE_H__
00002 #define __VIONGATE_H__
00003 
00004 #include <math.h>
00005 #include <stdlib.h>
00006 #include "advanceable.h"
00007 #include "membranepatchsimple.h"
00008 #include "iongate.h"
00009 
00011 #define VIONGATE_VM_MIN -0.100     // -100mV
00012 
00014 #define VIONGATE_VM_MAX +0.100     // +100mV
00015 
00017 #define VIONGATE_VM_INC +0.00002   // 0.05mV
00018 
00019 #define VIONGATE_TABLE_SIZE      ((int)((VIONGATE_VM_MAX - VIONGATE_VM_MIN) / VIONGATE_VM_INC + 1))
00020 
00021 
00023 
00102 class VIonGate : public IonGate {
00103 
00104 public:
00106   VIonGate(void) { Vm=0; Vresting=0; VmScale=0; nummethod=0; dttable=0;};
00107 
00108   // NOTE: The destructor comes within the macro IONGATE_TABLES
00109 
00111   virtual void reset(void);
00112 
00114   virtual int updateInternal(void);
00115 
00117   virtual int advance(void);
00118 
00120   virtual double alpha(double V) { return (infty(V))/tau(V); }
00121 
00123   virtual double beta(double V) { return (1.0-infty(V))/tau(V); }
00124 
00126   virtual double tau(double V) { return  1.0/(beta(V)+alpha(V)); }
00127 
00129   virtual double infty(double V) { return alpha(V)/(beta(V)+alpha(V)); }
00130 
00131   virtual double pInfty(MembranePatchSimple *m) { return infty(m->Vm);}
00132 
00134   virtual void ConnectToMembrane(MembranePatchSimple *m) { this->Vm = &(m->Vm); this->Vresting = &(m->Vresting); this->VmScale = &(m->VmScale);}
00135 
00137   int nummethod;
00138 
00139 protected:
00140 
00141   IONGATE_TABLES(VIonGate);
00142 
00144   float  *Vresting;
00145 
00147   double *Vm;
00148 
00150   float *VmScale;
00151 
00153   double dttable;
00154 };
00155 
00156 #endif
00157 
00158 
00159 

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