HHNeuron.cpp

Go to the documentation of this file.
00001 #include "HHNeuron.h"
00002 
00004 // HHNeuron
00006 
00007 void HHNeuron::derivatives(double t, const double y[], double f[]) 
00008 {
00009     // y[0] ... Vm, y[1] ... m, y[2] ... h, y[3] ... n, y[4] ... nM
00010     double V = y[0];
00011 /*
00012     if (nStepsInRefr>0) {
00013        f[0] = 0.0;
00014     }
00015     else
00016 */
00017     f[0] = 1.0/Cm*(- gbar_Na*pow(y[1], 3)*y[2]*(V-E_Na) 
00018                    - gbar_K*pow(y[3], 4)*(V-E_K) 
00019                    - gbar_M*y[4]*(V-E_M) 
00020                    + I0 
00021                    - G0*V);
00022 
00023     double v1 = V*1000.0;
00024     double v2 = v1 + 63.0;
00025 
00026     f[1] = alpha_m(v2) * (1.0 - y[1]) - beta_m(v2) * y[1];
00027     f[2] = alpha_h(v2) * (1.0 - y[2]) - beta_h(v2) * y[2];
00028     f[3] = alpha_n(v2) * (1.0 - y[3]) - beta_n(v2) * y[3];
00029     f[4] = alpha_nM(v1) * (1.0 - y[4]) - beta_nM(v1) * y[4];
00030 }
00031 
00032 
00033 int HHNeuron::reset(double dt) 
00034 {
00035     double y0[5];
00036     double v1 = Vinit * 1000.0;
00037     double v2 = v1 + 63.0;
00038 
00039     y0[0] = Vinit;
00040     y0[1] = infty_m(v2); 
00041     y0[2] = infty_h(v2); 
00042     y0[3] = infty_n(v2);
00043     y0[4] = infty_nM(v1);
00044 
00045     double gNa = gbar_Na * pow(infty_m(v2), 3) * infty_h(v2);
00046     double gK  = gbar_K  * pow(infty_n(v2), 4);
00047     double gM  = gbar_M  * infty_nM(v1);
00048 
00049     double Gtot_init = 1.0/Rm + gNa + gK + gM;
00050     double Ich_init = gNa*E_Na + gK*E_K + gM*E_M;
00051 
00052     Em = Rm * (Vresting * Gtot_init - Ich_init);
00053 
00054     ODESystemBasedSpikingNeuron::reset(dt, y0);
00055 
00056     return 0;
00057 }
00058 
00059 
00061 // HHINeuron
00063 
00064 void HHINeuron::derivatives(double t, const double y[], double f[]) 
00065 {
00066     // y[0] ... Vm, y[1] ... m, y[2] ... h, y[3] ... n
00067     double V = y[0];
00068 
00069 /*
00070     if (nStepsInRefr>0) {
00071        f[0] = 0.0;
00072     }
00073     else
00074 */
00075     f[0] = 1.0/Cm*(- gbar_Na*pow(y[1], 3)*y[2]*(V-E_Na) 
00076                    - gbar_K*pow(y[3], 4)*(V-E_K) 
00077                    + I0 
00078                    - G0*V);
00079 
00080     double v2 = V*1000.0 + 63.0;
00081 
00082     f[1] = alpha_m(v2) * (1 - y[1]) - beta_m(v2) * y[1];
00083     f[2] = alpha_h(v2) * (1 - y[2]) - beta_h(v2) * y[2];
00084     f[3] = alpha_n(v2) * (1 - y[3]) - beta_n(v2) * y[3];
00085 }
00086 
00087 
00088 int HHINeuron::reset(double dt) 
00089 {
00090     double y0[4];
00091     double v2 = Vinit * 1000.0 + 63.0;
00092 
00093     y0[0] = Vinit;
00094     y0[1] = infty_m(v2);
00095     y0[2] = infty_h(v2);
00096     y0[3] = infty_n(v2);
00097 
00098     double gNa = gbar_Na * pow(infty_m(v2), 3) * infty_h(v2);
00099     double gK  = gbar_K  * pow(infty_n(v2), 4);
00100 
00101     double Gtot_init = 1.0/Rm + gNa + gK;
00102     double Ich_init = gNa*E_Na + gK*E_K;
00103 
00104     Em = Rm * (Vresting * Gtot_init - Ich_init);
00105 
00106     ODESystemBasedSpikingNeuron::reset(dt, y0);
00107 
00108     return 0;
00109 }

Generated on Wed Jul 9 16:34:39 2008 for PCSIM by  doxygen 1.5.5