From 52e999232274874c7e3d4027a5b53493457f7a59 Mon Sep 17 00:00:00 2001 From: Schellenberger Date: Wed, 2 Apr 2014 14:48:05 +0200 Subject: [PATCH] Updated the TC model to latest code changes. Parameters are now locally defined as const double within class definition. Therefore no Parameters.h file anymore Updated the Stimulation protocol to reflect periodic and phase-dependent stimulation Signed-off-by: Schellenberger --- Cortical_Column.cpp | 6 +- Cortical_Column.h | 132 ++++++++++++++++++++--------- Plots.m | 56 ++++++++----- Stimulation.h | 233 +++++++++++++++++++++++++++++++++++++++++----------- TC.cpp | 36 ++++---- Thalamic_Column.cpp | 38 ++++----- Thalamic_Column.h | 155 ++++++++++++++++++++++++---------- parameters.h | 181 ---------------------------------------- 8 files changed, 462 insertions(+), 375 deletions(-) delete mode 100644 parameters.h diff --git a/Cortical_Column.cpp b/Cortical_Column.cpp index b610c81..1c6e8c1 100644 --- a/Cortical_Column.cpp +++ b/Cortical_Column.cpp @@ -13,7 +13,7 @@ void Cortical_Column::set_RNG(void) { // get the RNG for (int i=0; i #include #include "macros.h" -#include "parameters.h" #include "Thalamic_Column.h" using std::vector; + class Thalamic_Column; /****************************************************************************************************/ @@ -31,26 +31,19 @@ class Cortical_Column { public: // Constructors Cortical_Column(void) - : Ve (_INIT(E_L_e)), Vi (_INIT(E_L_i)), Na (_INIT(Na_eq)), - Phi_ee (_INIT(0.0)), Phi_ei (_INIT(0.0)), Phi_ie (_INIT(0.0)), Phi_ii (_INIT(0.0)), phi_e (_INIT(0.0)), - x_ee (_INIT(0.0)), x_ei (_INIT(0.0)), x_ie (_INIT(0.0)), x_ii (_INIT(0.0)), y_e (_INIT(0.0)), - alpha_Na (0), tau_Na (0), g_KNa (0), theta_e (0), - sigma_e (0), dphi_c (0) {set_RNG();} - Cortical_Column(double* Par) - : Ve (_INIT(E_L_e)), Vi (_INIT(E_L_i)), Na (_INIT(Na_eq)), - Phi_ee (_INIT(0.0)), Phi_ei (_INIT(0.0)), Phi_ie (_INIT(0.0)), Phi_ii (_INIT(0.0)), phi_e (_INIT(0.0)), - x_ee (_INIT(0.0)), x_ei (_INIT(0.0)), x_ie (_INIT(0.0)), x_ii (_INIT(0.0)), y_e (_INIT(0.0)), - alpha_Na (Par[0]), tau_Na (Par[1]), g_KNa (Par[2]), theta_e (Par[3]), - sigma_e (Par[4]), dphi_c (Par[5]) + Cortical_Column(double* Par, double* Con) + :tau_e (Par[0]), theta_e (Par[1]), sigma_e (Par[2]), alpha_Na (Par[3]), + tau_Na (Par[4]), g_KNa (Par[5]), N_te (Con[2]), N_ti (Con[3]), + dphi (Par[6]) {set_RNG();} // get the pointer to the cortical module void get_Thalamus(Thalamic_Column& T) {Thalamus = &T;} // get axonal flux - double get_phi (int N) const {_SWITCH((phi_e)); return var_phi_e;} + double get_phi (int N) const {_SWITCH((phi_e)); return var_phi_e;} // Initialize the RNGs void set_RNG (void); @@ -83,40 +76,97 @@ class Cortical_Column { private: // Population variables - vector Ve, // excitatory membrane voltage - Vi, // inhibitory membrane voltage - Na, // Na concentration - Phi_ee, // PostSP from excitatory to excitatory population - Phi_ei, // PostSP from excitatory to inhibitory population - Phi_ie, // PostSP from inhibitory to excitatory population - Phi_ii, // PostSP from inhibitory to inhibitory population - phi_e, // axonal flux - x_ee, // derivative of Phi_ee - x_ei, // derivative of Phi_ei - x_ie, // derivative of Phi_ie - x_ii, // derivative of Phi_ii - y_e; // derivative of phi_e - - // Adaption parameters - double alpha_Na, // Sodium influx per spike - tau_Na, // Sodium time constant - g_KNa; // KNa conductance - - // Firing rate parameters - double theta_e, // pyramidal firing threshold - sigma_e; // pyramidal gain - - // Noise parameters - double dphi_c; - - // pointer to the thalamic module - Thalamic_Column* Thalamus; + vector Ve = _INIT(E_L_e), // excitatory membrane voltage + Vi = _INIT(E_L_i), // inhibitory membrane voltage + Na = _INIT(Na_eq), // Na concentration + Phi_ee = _INIT(0.0), // PostSP from excitatory to excitatory population + Phi_ei = _INIT(0.0), // PostSP from excitatory to inhibitory population + Phi_ie = _INIT(0.0), // PostSP from inhibitory to excitatory population + Phi_ii = _INIT(0.0), // PostSP from inhibitory to inhibitory population + phi_e = _INIT(0.0), // axonal flux + x_ee = _INIT(0.0), // derivative of Phi_ee + x_ei = _INIT(0.0), // derivative of Phi_ei + x_ie = _INIT(0.0), // derivative of Phi_ie + x_ii = _INIT(0.0), // derivative of Phi_ii + y_e = _INIT(0.0); // derivative of phi_t // Random number generators vector MTRands; // Container for noise vector Rand_vars; + + // Declaration and Initialization of parameters + // Membrane time in ms + const double tau_e = 30; + const double tau_i = 30; + + // Maximum firing rate in ms^-1 + const double Qe_max = 30.E-3; + const double Qi_max = 60.E-3; + + // Sigmoid threshold in mV + const double theta_e = -58.5; + const double theta_i = -58.5; + + // Sigmoid gain in mV + const double sigma_e = 4; + const double sigma_i = 6; + + // Scaling parameter for sigmoidal mapping (dimensionless) + const double C1 = (3.14159265/sqrt(3)); + + // parameters of the firing adaption + const double alpha_Na = 2; // Sodium influx per spike in mM ms + const double tau_Na = 1; // Sodium time constant in ms + + const double R_pump = 0.09; // Na-K pump constant in mM/ms + const double Na_eq = 9.5; // Na-eq concentration in mM + + // PSP rise time in ms^-1 + const double gamma_e = 70E-3; + const double gamma_i = 58.6E-3; + + /* axonal flux time constant */ + const double nu = 60E-3; + + + // Conductivities in mS/cm^-2 + // Leak current + const double g_L = 1; + + // KNa current + const double g_KNa = 1.33; + + // Connectivities (dimensionless) + const double N_ee = 120; + const double N_ei = 72; + const double N_ie = 90; + const double N_ii = 90; + const double N_te = 10; + const double N_ti = 10; + + // Reversal potentials in mV + // synaptic + const double E_AMPA = 0; + const double E_GABA = -70; + + // Leak + const double E_L_e = -66; + const double E_L_i = -64; + + // Potassium + const double E_K = -100; + + // Noise parameters in ms^-1 + const double mphi = 0E-3; + const double dphi = 30E-3;; + double input = 0.0; + + /* Pointer to thalamic column */ + Thalamic_Column* Thalamus; + + friend class Stim; }; /****************************************************************************************************/ /* end */ diff --git a/Plots.m b/Plots.m index cba5b71..b807d4b 100644 --- a/Plots.m +++ b/Plots.m @@ -1,37 +1,49 @@ % mex command is given by: % mex CXXFLAGS="\$CXXFLAGS -std=gnu++0x -fpermissive" TC.cpp Cortical_Column.cpp Thalamic_Column.cpp -function Plots(T, onset) +function Plots(T) if nargin == 0 - Input_N3 = [ 2.6; % alpha_Na - 3; % tau_Na - 1.33 % g_KNa - -63; % theta_e - 8; % sigma_e - 30E-3]; % dphi + % fittet input + Input_N3 = [ 24; % tau_e + -64; % theta_e + 8.3; % sigma_e + 3.6; % alpha_Na + 2.7; % tau_Na + 0.63; % g_KNa + 50E-3]; % dphi - Input_N2 = [ 2; % alpha_Na - 1; % tau_Na - 1.33; % g_KNa + Input_N2 = [ 30; % tau_e -58.5; % theta_e - 4.25; % sigma_e + 4.5; % sigma_e + 2; % alpha_Na + 1; % tau_Na + 1.33; % g_KNa 30E-3]; % dphi - Con = [10; % N_tr - 20; % N_rt - 40]; % N_rr - - var_stim = [ 0; % strength of the stimulus in Hz (spikes per second) - 0; % time between stimuli in s - 0; % time until first stimuli in s - 0]; % duration of the stimulus in ms - - T = 30; % duration of the simulation + Con = [0; % N_et + 0; % N_er + 0; % N_te + 0]; % N_ti + + % stimulation parameters + % first number is the mode of stimulation + % 0 == none + % 1 == periodic + % 2 == phase dependend up state + % 3 == phase dependend down state + + var_stim = [ 0 % mode of stimulation + 100.0; % strength of the stimulus in Hz (spikes per second) + 100; % duration of the stimulus in ms + 8; % time between stimuli in s + 550]; % time until stimuli after min in ms + + T = 60; % duration of the simulation end -[Ve, Vt] = TC(T, Input_N2, Con, var_stim); +[Ve, Vt] = TC(T, Input_N3, Con, var_stim); L = max(size(Vt)); timeaxis = linspace(0,T,L); diff --git a/Stimulation.h b/Stimulation.h index 071c89c..184f68f 100644 --- a/Stimulation.h +++ b/Stimulation.h @@ -2,6 +2,7 @@ /* Implementation of the stimulation protocol */ /****************************************************************************************************/ #pragma once +#include "Cortical_Column.h" #include "Thalamic_Column.h" /****************************************************************************************************/ @@ -9,86 +10,224 @@ /****************************************************************************************************/ class Stim { public: - // empty constructor for compiling + /* empty constructor for compiling */ Stim(void); - Stim(Thalamic_Column& T, double* var) - {Thalamus = &T; - setup(var);} + Stim(Cortical_Column& C, Thalamic_Column& T, double* var) + { Cortex = &C; + Thalamus = &T; + setup(var);} - // scaling from SI to simulation variables s -> ms + /* setup with respect to stimulation mode */ void setup (double* var_stim) { extern const int onset; extern const int res; extern const int dt; - // scale the stimulation strength with respect to ms^-1 - strength = var_stim[0] / 1000; + /* mode of stimulation */ + mode = (int) var_stim[0]; - // scale the stimulation variables with respect to simulation resolution - ISI = (int) var_stim[1] * res; + /* scale the stimulation strength from s^-1 to ms^-1 */ + strength = var_stim[1] / 1000; - // stimulation starts after the onset - start = (int)(var_stim[2] + onset) *res; + /* scale duration from ms to dt */ + duration = (int) var_stim[2] * res / 1000; + + /* scale the ISI from s to ms^-1 */ + ISI = (int) var_stim[3] * res; + + /* scale time to stimulus from ms to dt */ + time_to_stim= (int) var_stim[4] * res / 1000; + + if(mode==1) { + time_to_stim = (onset+1) * res; + } + + correction = onset * res; - // rescale duration with respect to dt (res timesteps per sec) - duration = (int) var_stim[3]*res/1E3; } void check_stim (int time) { - // check whether a stimulation should start - // the duration of the stimulation is ignored - if(time==(start + count_stim*ISI)){ - // turn the stimulation on - mode = 1; - Thalamus->set_input(strength); + /* check if stimulation should start */ + switch (mode) { + + /* no stimulation */ + default: + break; + + /* periodic stimulation */ + case 1: + /* check if time is reached */ + if(time == time_to_stim) { + /* switch stimulation on */ + stimulation_started = true; + Thalamus->set_input(strength); + + /* update the timer */ + time_to_stim += ISI; + + + marker_threshold.push_back(0); + marker_minimum.push_back(0); + marker_stimulation.push_back(time - correction); + } + break; + + /* phase dependent up state stimulation */ + case 2: + /* search for threshold */ + if(!stimulation_started && !minimum_found && !threshold_crossed && time>correction) { + if(Cortex->Ve[0]<=threshold) { + threshold_crossed = true; + marker_threshold.push_back(time - correction); + } + } + + /* search for minimum */ + if(threshold_crossed) { + if(Cortex->Ve[0]>Ve_old) { + threshold_crossed = false; + minimum_found = true; + marker_minimum.push_back(time - correction); + Ve_old = 0; + } else { + Ve_old = Cortex->Ve[0]; + } + } + + /* wait until the stimulation should start */ + if(minimum_found) { + count_to_start++; + + + /* start stimulation after time_to_stim has passed */ + if(count_to_start==time_to_stim) { + minimum_found = false; + stimulation_started = true; + count_to_start = 0; + marker_stimulation.push_back(time - correction); + Thalamus->set_input(strength); + } + } + break; + + /* phase dependent down state stimulation */ + case 3: + /* search for threshold */ + if(!stimulation_started && !minimum_found && !threshold_crossed && time>correction) { + if(Cortex->Ve[0]<=threshold) { + threshold_crossed = true; + marker_threshold.push_back(time - correction); + } + } + + /* search for minimum */ + if(threshold_crossed) { + if(Cortex->Ve[0]>Ve_old) { + threshold_crossed = false; + minimum_found = true; + marker_minimum.push_back(time - correction); + Ve_old = 0; + } else { + Ve_old = Cortex->Ve[0]; + } + } + + /* start the stimulation */ + if(minimum_found) { + minimum_found = false; + stimulation_started = true; + marker_stimulation.push_back(time - correction); + Thalamus->set_input(strength); + } + break; } - // check whether a stimulation should end - if(mode ==1 && count_dur ==duration) { - // turn off the stimulation - mode = 0; - Thalamus->set_input(0.0); - - // add counter for stimulation occurrence - count_stim++ ; + /* wait to switch the stimulation off */ + if(stimulation_started) { + count_duration++; - // reset the stimulation counter - count_dur = 0; + /* switch stimulation off */ + if(count_duration==duration) { + stimulation_started = false; + count_duration = 0; + Thalamus->set_input(0.0); + } } + } - // if stimulation is on track count its duration - if(mode==1){ - count_dur++; + mxArray* get_marker(void) { + mxArray* Marker = mxCreateDoubleMatrix(0, 0, mxREAL); + mxSetM(Marker, 3); + mxSetN(Marker, marker_stimulation.size()); + mxSetData(Marker, mxMalloc(sizeof(double)*3*marker_stimulation.size())); + double* Pr_Marker = mxGetPr(Marker); + for(unsigned i=0; i marker_threshold; + std::vector marker_minimum; + std::vector marker_stimulation; }; /****************************************************************************************************/ /* end */ diff --git a/TC.cpp b/TC.cpp index c9cdab7..aa61068 100644 --- a/TC.cpp +++ b/TC.cpp @@ -13,18 +13,17 @@ #include "Stimulation.h" #include "saves.h" #include "ODE.h" -using std::vector; /****************************************************************************************************/ -/* fixed simulation parameters */ +/* Fixed simulation settings */ /****************************************************************************************************/ -extern const int onset = 5; -extern const int res = 1E4; -extern const int red = res/100; -extern const double dt = 1E3/res; -extern const double h = sqrt(dt); +extern const int onset = 5; // time until data is stored in s +extern const int res = 1E4; // number of iteration steps per s +extern const int red = res/100; // number of iterations that is saved +extern const double dt = 1E3/res; // duration of a timestep in ms +extern const double h = sqrt(dt); // squareroot of dt for SRK iteration /****************************************************************************************************/ -/* end */ +/* end */ /****************************************************************************************************/ @@ -33,25 +32,25 @@ extern const double h = sqrt(dt); /****************************************************************************************************/ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // Initializing the seeder. - srand(time(0)); + srand(time(NULL)); - // inputs - const int T = (int)(mxGetScalar(prhs[0])); - double* Param_Cortex = mxGetPr (prhs[1]); - double* Param_Thalamus = mxGetPr (prhs[2]); - double* var_stim = mxGetPr (prhs[3]); - const int Time = (T+onset)*res; + // Fetch inputs + const int T = (int) (mxGetScalar(prhs[0])); // duration of simulation in s + const int Time = (T+onset)*res; // total number of iteration steps + double* Param_Cortex = mxGetPr (prhs[1]); // parameters of cortical module + double* Connections = mxGetPr (prhs[2]); // parameters of thalamic module + double* var_stim = mxGetPr (prhs[3]); // parameters of stimulation protocol // Initializing the populations; - Cortical_Column Cortex(Param_Cortex); - Thalamic_Column Thalamus(Param_Thalamus); + Cortical_Column Cortex(Param_Cortex, Connections); + Thalamic_Column Thalamus(Connections); // Linking both modules Cortex.get_Thalamus(Thalamus); Thalamus.get_Cortex(Cortex); // Initialize the stimulation protocol - Stim Stimulation(Thalamus, var_stim); + Stim Stimulation(Cortex, Thalamus, var_stim); // setting up the data containers mxArray* Ve = SetMexArray(1, T*res/red); @@ -74,6 +73,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // output of the simulation plhs[0] = Ve; plhs[1] = Vt; + plhs[2] = Stimulation.get_marker(); return; } /****************************************************************************************************/ diff --git a/Thalamic_Column.cpp b/Thalamic_Column.cpp index e4f8e3a..dc43a29 100644 --- a/Thalamic_Column.cpp +++ b/Thalamic_Column.cpp @@ -13,7 +13,7 @@ void Thalamic_Column::set_RNG(void) { // get the RNG for (int i=0; iget_phi(N) - var_Phi_tt) - 2 * gamma_e * var_x_tt); + x_tt [N] = dt*(pow(gamma_e, 2) * (noise_xRK(N) + N_et * Cortex->get_phi(N) - var_Phi_tt) - 2 * gamma_e * var_x_tt); x_tr [N] = dt*(pow(gamma_e, 2) * (N_tr * get_Qt(N) + N_er * Cortex->get_phi(N) - var_Phi_tr) - 2 * gamma_e * var_x_tr); - x_rt [N] = dt*(pow(gamma_i, 2) * (N_rt * get_Qr(N) - var_Phi_rt) - 2 * gamma_i * var_x_rt); - x_rr [N] = dt*(pow(gamma_i, 2) * (N_rr * get_Qr(N) - var_Phi_rr) - 2 * gamma_i * var_x_rr); - y_t [N] = dt*(pow(nu, 2) * ( get_Qt(N) - var_phi_t) - 2 * nu * var_y_t); + x_rt [N] = dt*(pow(gamma_i, 2) * (N_rt * get_Qr(N) - var_Phi_rt) - 2 * gamma_i * var_x_rt); + x_rr [N] = dt*(pow(gamma_i, 2) * (N_rr * get_Qr(N) - var_Phi_rr) - 2 * gamma_i * var_x_rr); + y_t [N] = dt*(pow(nu, 2) * ( get_Qt(N) - var_phi_t) - 2 * nu * var_y_t); } /****************************************************************************************************/ /* end */ diff --git a/Thalamic_Column.h b/Thalamic_Column.h index 3fa3b75..6a01355 100644 --- a/Thalamic_Column.h +++ b/Thalamic_Column.h @@ -8,9 +8,9 @@ #include #include #include "macros.h" -#include "parameters.h" #include "Cortical_Column.h" using std::vector; + class Cortical_Column; /****************************************************************************************************/ @@ -31,22 +31,11 @@ class Thalamic_Column { public: // Constructors Thalamic_Column(void) - : Vt (_INIT(E_L_t)), Vr (_INIT(E_L_r)), Ca (_INIT(Ca_0)), - Phi_tt(_INIT(0.0)), Phi_tr (_INIT(0.0)), Phi_rt (_INIT(0.0)), Phi_rr (_INIT(0.0)), phi_t (_INIT(0.0)), - x_tt (_INIT(0.0)), x_tr (_INIT(0.0)), x_rt (_INIT(0.0)), x_rr (_INIT(0.0)), y_t (_INIT(0.0)), - h_T_t (_INIT(0.0)), h_T_r (_INIT(0.0)), m_T_t (_INIT(0.0)), m_T_r (_INIT(0.0)), - m_h (_INIT(0.0)), m_h2 (_INIT(0.0)), P_h (_INIT(0.0)), - N_tr (210), N_rt (410), N_rr (800), input (0.0) {set_RNG();} // Constructors Thalamic_Column(double* Par) - : Vt (_INIT(0)), Vr (_INIT(0)), Ca (_INIT(Ca_0)), - Phi_tt(_INIT(0.0)), Phi_tr (_INIT(0.0)), Phi_rt (_INIT(0.0)), Phi_rr (_INIT(0.0)), phi_t (_INIT(0.0)), - x_tt (_INIT(0.0)), x_tr (_INIT(0.0)), x_rt (_INIT(0.0)), x_rr (_INIT(0.0)), y_t (_INIT(0.0)), - h_T_t (_INIT(0.0)), h_T_r (_INIT(0.0)), m_T_t (_INIT(0.0)), m_T_r (_INIT(0.0)), - m_h (_INIT(0.0)), m_h2 (_INIT(0.0)), P_h (_INIT(0.0)), - N_tr (Par[0]), N_rt (Par[1]), N_rr (Par[2]), input (0.0) + : N_et (Par[0]), N_er (Par[1]) {set_RNG();} // get the pointer to the cortical module @@ -106,43 +95,121 @@ class Thalamic_Column { private: // Population variables - vector Vt, // TC membrane voltage - Vr, // RE membrane voltage - Ca, // Calcium concentration of TC population - Phi_tt, // PostSP from TC population to TC population - Phi_tr, // PostSP from TC population to RE population - Phi_rt, // PostSP from RE population to TC population - Phi_rr, // PostSP from RE population to RE population - phi_t, // axonal flux - x_tt, // derivative of Phi_tt - x_tr, // derivative of Phi_tr - x_rt, // derivative of Phi_rt - x_rr, // derivative of Phi_rr - y_t, // derivative of phi_t - h_T_t, // inactivation of T channel - h_T_r, // inactivation of T channel - m_T_t, // activation of T channel - m_T_r, // activation of T channel - m_h, // activation of h channel - m_h2, // activation of h channel bound with protein - P_h; // fraction of protein bound with calcium - - // Connectivities - double N_tr, // TC to RE loop - N_rt, // RE to TC loop - N_rr; // RE self loop - - // Noise parameters - double input; - - // pointer to the cortical module - Cortical_Column* Cortex; + vector Vt = _INIT(E_L_t), // TC membrane voltage + Vr = _INIT(E_L_r), // RE membrane voltage + Ca = _INIT(Ca_0), // Calcium concentration of TC population + Phi_tt = _INIT(0.0), // PostSP from TC population to TC population + Phi_tr = _INIT(0.0), // PostSP from TC population to RE population + Phi_rt = _INIT(0.0), // PostSP from RE population to TC population + Phi_rr = _INIT(0.0), // PostSP from RE population to RE population + phi_t = _INIT(0.0), // axonal flux + x_tt = _INIT(0.0), // derivative of Phi_tt + x_tr = _INIT(0.0), // derivative of Phi_tr + x_rt = _INIT(0.0), // derivative of Phi_rt + x_rr = _INIT(0.0), // derivative of Phi_rr + y_t = _INIT(0.0), // derivative of phi_t + h_T_t = _INIT(0.0), // inactivation of T channel + h_T_r = _INIT(0.0), // inactivation of T channel + m_T_t = _INIT(0.0), // activation of T channel + m_T_r = _INIT(0.0), // activation of T channel + m_h = _INIT(0.0), // activation of h channel + m_h2 = _INIT(0.0), // activation of h channel bound with protein + P_h = _INIT(0.0); // fraction of protein bound with calcium // Random number generators vector MTRands; // Container for noise vector Rand_vars; + + // Declaration and Initialization of parameters + // Membrane time in ms + const double tau_t = 30; + const double tau_r = 30; + + // Maximum firing rate in ms^-1 + const double Qt_max = 400.E-3; + const double Qr_max = 400.E-3; + + // Sigmoid threshold in mV + const double theta_t = -45; + const double theta_r = -45; + + // Sigmoid gain in mV + const double sigma_t = 9; + const double sigma_r = 9; + + // Scaling parameter for sigmoidal mapping (dimensionless) + const double C1 = (3.14159265/sqrt(3)); + + // PSP rise time in ms^-1 + const double gamma_e = 70E-3; + const double gamma_i = 58.6E-3; + + /* axonal flux time constant */ + const double nu = 60E-3; + + // Conductivities in mS/cm^-2 + // Leak current + const double g_L_t = 0.02; + const double g_L_r = 0.05; + + // Potassium leak current + const double g_LK_t = 0.02; + const double g_LK_r = 0.01; + + // T current + const double g_T_t = 2.2; + const double g_T_r = 2; + + /* h current */ + const double g_h = 0.07; + + // Connectivities (dimensionless) + const double N_tr = 2; + const double N_rt = 5.5; + const double N_rr = 5; + const double N_et = 10; + const double N_er = 10; + + // Reversal potentials in mV + // synaptic + const double E_AMPA = 0; + const double E_GABA = -70; + + // Leak + const double E_L_t = -70; + const double E_L_r = -55; + + // Potassium + const double E_K = -100; + + // I_T current + const double E_Ca = 120; + + // I_h current + const double E_h = -40; + + /* Calcium parameters */ + const double alpha_Ca = -50E-6; // influx per spike in nmol + const double tau_Ca = 5; // calcium time constant in ms + const double Ca_0 = 2E-4; // resting concentration + + /* I_h activation parameters */ + const double k1 = 2.5E7; + const double k2 = 5E-4; + const double k3 = 1E-1; + const double k4 = 1E-3; + const double n_P = 4; + const double g_inc = 2; + + // Noise parameters in ms^-1 + const double mphi = 0E-3; + const double dphi = 2E-3;; + double input = 0.0; + + /* Pointer to cortical column */ + Cortical_Column* Cortex; }; /****************************************************************************************************/ /* end */ diff --git a/parameters.h b/parameters.h deleted file mode 100644 index 0d8ec27..0000000 --- a/parameters.h +++ /dev/null @@ -1,181 +0,0 @@ -/****************************************************************************************************/ -/* header file containing all fixed values of the simulation */ -/****************************************************************************************************/ -#pragma once -/****************************************************************************************************/ -/* physical properties */ -/****************************************************************************************************/ -// Time constants for excitatory and inhibitory neurons in ms -#define tau_e 30 -#define tau_i 30 -#define tau_t 1 -#define tau_r 1 - -// Maximum firing rate in ms^-1 -#define Qe_max 30.E-3 -#define Qi_max 60.E-3 -#define Qr_max 400.E-3 -#define Qt_max 400.E-3 - -// Sigmoid threshold values in mV -/* fitting variable -#define theta_e -58.5 -*/ -#define theta_i -58.5 -#define theta_t -45 -#define theta_r -45 - -// Sigmoid gain in mV -/* fitting variables -#define sigma_e 4 -*/ -#define sigma_i 6 -#define sigma_t 9 -#define sigma_r 9 - -// Parameter for sigmoidal mapping (dimensionless) -#define C1 (3.14159265/sqrt(3)) -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* Firing rate adaption */ -/****************************************************************************************************/ -// parameters of the firing adaption -/* fitting variables -#define alpha_Na 2 // Sodium influx per spike in mM ms -#define tau_Na 1 -*/ - -#define R_pump 0.09 // Na-K pump constant in mM/ms -#define Na_eq 9.5 // Na-eq concentration in mM -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* Calcium parameters */ -/***************************************************************************************************/ -#define alpha_Ca -50E-6 // influx per spike in nmol -#define tau_Ca 5 // calcium time constant in ms -#define Ca_0 2E-4 // resting concentration -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - -/****************************************************************************************************/ -/* Synaptic parameters */ -/****************************************************************************************************/ -// PSP rise time in ms^-1 -#define gamma_e 70E-3 -#define gamma_i 58.6E-3 - -// axonal delay in ms^-1 -#define nu 60E-3 //(0.2*1.4) -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* Conductivities */ -/****************************************************************************************************/ -// Leak current -#define gL_e 1 -#define gL_i 1 -#define gL_t 0.02 -#define gL_r 0.05 -#define gLK_t 0.02 -#define gLK_r 0.02 - -// synaptic current -#define g_AMPA 0.1 -#define g_GABA 0.15 - -// I_T current -#define gTt 2.2 -#define gTr 2 - -// I_h current -#define gh 0.07 - -// KNa current -/* fitting variables -#define g_KNa 1.33 -*/ -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* Reversal potentials */ -/****************************************************************************************************/ -// synaptic inputs in mV -#define E_AMPA 0 -#define E_GABA -70 - -// Leak reversal -#define E_L_e -64 -#define E_L_i -64 -#define E_L_t -70 -#define E_L_r -55 -#define E_LK_t -95 -#define E_LK_r -95 - -// Potassium reversal -#define E_K -100 - -// I_T current -#define E_Ca 120 - -// I_h current -#define E_h -40 -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* I_h activation parameters */ -/****************************************************************************************************/ -#define k1 2.5E7 -#define k2 5E-4 -#define k3 1E-1 -#define k4 1E-3 -#define n_P 4 -#define g_inc 2 -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* noise parameters */ -/****************************************************************************************************/ -#define N_ee 120 -#define N_ei 72 -#define N_ie 100 -#define N_ii 100 -#define N_te 10 -#define N_ti 10 -#define N_et 10 -#define N_er 10 -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/ - - -/****************************************************************************************************/ -/* noise parameters */ -/****************************************************************************************************/ -#define mphi_c 0E-3 -#define mphi_t 0E-3 - -#define dphi_t 0.5E-3 -/****************************************************************************************************/ -/* end */ -/****************************************************************************************************/