FS_neuron::FS_neuron(const vector<double>& param) { // set neuron params from vector V = param[0]; ENa = param[1]; // mv Na reversal potential EK = param[2]; // mv K reversal potential El = param[3]; // mv Leakage reversal potential gbarNa = param[4]; // mS/cm^2 Na conductance gbarK = param[5]; // mS/cm^2 K conductance gl = param[6]; fi = param[7]; Iextmean = param[8]; variance = param[9]; unsigned int seed = chrono::system_clock::now().time_since_epoch().count(); generator = new default_random_engine (seed); normRand = new normal_distribution <double> (Iextmean, variance); Iext = (*normRand)(*generator); // Iext generate from normal distribution m = alpha_m() / (alpha_m() + beta_m()); n = alpha_n() / (alpha_n() + beta_n()); h = alpha_h() / (alpha_h() + beta_h()); gNa = gbarNa*m*m*m*h; gK = gbarK*n*n*n*n; Isyn = 0; countSp = true; th = -20; }
double tau_h(const double V_tilde) { return 1./(alpha_h(V_tilde)+beta_h(V_tilde)); }
double h_inf(const double V_tilde) { return alpha_h(V_tilde)/(alpha_h(V_tilde)+beta_h(V_tilde)); }
static inline double tau_h(double V) { return 1.0 / (alpha_h(V) + beta_h(V)); }
static inline double h_inf(double V) { return alpha_h(V) / (alpha_h(V) + beta_h(V)); }
double FS_neuron::h_integrate(double dt) { double h_0 = alpha_h() / (alpha_h() + beta_h()); double tau_h = 1 / (alpha_h() + beta_h()); return h_0 -(h_0 - h)*exp(-dt/tau_h); }