CSIM: generic_ion_gates.h Source File

generic_ion_gates.h

00001 #ifndef __GENERIC_ION_GATES_H_
00002 #define __GENERIC_ION_GATES_H_
00003 
00004 #include "viongate.h"
00005 
00007 class GVD_Gate : public VIonGate {
00008 
00009   DO_REGISTERING
00010 
00011 public:
00012   GVD_Gate(void) { Vh=0; Vc=1e-3; Ts=1; Te=1e-3;  C1=0; C2=0;}
00013 
00014   virtual ~GVD_Gate(void) {  if (getC1()) { free(getC1()); setC1(0); }
00015                              if (getC2()) { free(getC2()); setC2(0); } }
00016 
00017   virtual double tau(double V) { return Ts*exp( -Te*(V - *Vresting) )/(1 + exp(-((V - *Vresting) - Vh)/Vc)); }
00018 
00019   virtual double infty(double V)  { return 1/(1 + exp(-((V - *Vresting) - Vh)/Vc)); }
00020 
00022   virtual int updateInternal(void);
00023 
00025   double Vh; // this is analog output
00026 
00028   double Vc; // this is analog output
00029 
00031   double Ts; // this is analog output
00032 
00034   double Te; // this is analog output
00035 
00036 protected:
00037   virtual double *getC1(void) { return C1; }
00038   virtual double *getC2(void) { return C2; }
00039   virtual void setC1(double *p) { C1=p; }
00040   virtual void setC2(double *p) { C2=p; }
00041 
00043   double *C1;
00044 
00046   double *C2;
00047 };
00048 
00050 class GVD_cT_Gate : public VIonGate {
00051 
00052   DO_REGISTERING
00053 
00054 public:
00055   GVD_cT_Gate(void) { Vh=0; Vc=1e-3; Ts=1;  C1=0; C2=0; }
00056 
00057   virtual ~GVD_cT_Gate(void) {  if (getC1()) { free(getC1()); setC1(0); }
00058                                 if (getC2()) { free(getC2()); setC2(0); } }
00059 
00060   virtual double infty(double V)  { return 1/(1 + exp(-((V - *Vresting) - Vh)/Vc)); }
00061 
00062   virtual double tau(double ) { return Ts; }
00063 
00065   virtual int updateInternal(void);
00066 
00068   double Vh; // this is analog output
00069 
00071   double Vc; // this is analog output
00072 
00074   double Ts; // this is analog output
00075 
00076 protected:
00077   virtual double *getC1(void) { return C1; }
00078   virtual double *getC2(void) { return C2; }
00079   virtual void setC1(double *p) { C1=p; }
00080   virtual void setC2(double *p) { C2=p; }
00081 
00083   double *C1;
00084 
00086   double *C2;
00087 };
00088 
00089 
00090 #endif
00091 

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