From 60a768b1e3a4401750b60d31dbddcda8eedc3274 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 1 Feb 2016 11:44:02 +0100 Subject: [PATCH] Switched to the random_stream header for RNGs and updated the naming convention. --- Cortical_Column.cpp | 78 +++++++++++++++++++++--------------------- Cortical_Column.h | 97 ++++++++++++++++++++++++++++------------------------- Data_Storage.h | 2 +- NM_TC.pro | 16 ++++----- ODE.h | 2 +- Random_Stream.h | 1 - Stimulation.h | 12 ++++--- TC.cpp | 3 ++ TC_mex.cpp | 1 + Thalamic_Column.cpp | 60 +++++++++++++++++---------------- Thalamic_Column.h | 87 +++++++++++++++++++++++++---------------------- 11 files changed, 189 insertions(+), 170 deletions(-) diff --git a/Cortical_Column.cpp b/Cortical_Column.cpp index 541c3ba..d0a223c 100644 --- a/Cortical_Column.cpp +++ b/Cortical_Column.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 University of Lübeck + * Copyright (c) 2015 UniVprsity of Lübeck * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -8,12 +8,12 @@ * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * - * The above copyright notice and this permission notice shall be included in + * The aboVp copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVpNT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN @@ -44,10 +44,10 @@ void Cortical_Column::set_RNG(void) { /* Create RNG for each stream */ for (int i=0; iy[N] - y_ee[N]) - 2 * gamma_e * x_ee[N]) + noise_xRK(N, 0); - x_ei[N+1] = x_ei[0] + A[N] * dt*(pow(gamma_e, 2) * (N_ei * get_Qe(N) + N_ti * Thalamus->y[N] - y_ei[N]) - 2 * gamma_e * x_ei[N]) + noise_xRK(N, 1) ; - x_ie[N+1] = x_ie[0] + A[N] * dt*(pow(gamma_i, 2) * (N_ie * get_Qi(N) - y_ie[N]) - 2 * gamma_i * x_ie[N]); - x_ii[N+1] = x_ii[0] + A[N] * dt*(pow(gamma_i, 2) * (N_ii * get_Qi(N) - y_ii[N]) - 2 * gamma_i * x_ii[N]); - x [N+1] = x [0] + A[N] * dt*(pow(nu, 2) * ( get_Qe(N) - y [N]) - 2 * nu * x [N]); + x_ep[N+1] = x_ep[0] + A[N] * dt*(pow(gamma_e, 2) * (N_ep * get_Qp(N) + N_tp * Thalamus->y[N] - s_ep[N]) - 2 * gamma_e * x_ep[N]) + noise_xRK(N, 0); + x_ei[N+1] = x_ei[0] + A[N] * dt*(pow(gamma_e, 2) * (N_ei * get_Qp(N) + N_ti * Thalamus->y[N] - s_ei[N]) - 2 * gamma_e * x_ei[N]) + noise_xRK(N, 1) ; + x_gp[N+1] = x_gp[0] + A[N] * dt*(pow(gamma_g, 2) * (N_ip * get_Qi(N) - s_gp[N]) - 2 * gamma_g * x_gp[N]); + x_gi[N+1] = x_gi[0] + A[N] * dt*(pow(gamma_g, 2) * (N_ii * get_Qi(N) - s_gi[N]) - 2 * gamma_g * x_gi[N]); + x [N+1] = x [0] + A[N] * dt*(pow(nu, 2) * ( get_Qp(N) - y [N]) - 2 * nu * x [N]); } /****************************************************************************************************/ /* end */ @@ -189,18 +189,18 @@ void Cortical_Column::set_RK (int N) { /* Function that adds all SRK terms */ /****************************************************************************************************/ void Cortical_Column::add_RK(void) { - Ve [0] = (-3*Ve [0] + 2*Ve [1] + 4*Ve [2] + 2*Ve [3] + Ve [4])/6; + Vp [0] = (-3*Vp [0] + 2*Vp [1] + 4*Vp [2] + 2*Vp [3] + Vp [4])/6; Vi [0] = (-3*Vi [0] + 2*Vi [1] + 4*Vi [2] + 2*Vi [3] + Vi [4])/6; Na [0] = (-3*Na [0] + 2*Na [1] + 4*Na [2] + 2*Na [3] + Na [4])/6; - y_ee[0] = (-3*y_ee[0] + 2*y_ee[1] + 4*y_ee[2] + 2*y_ee[3] + y_ee[4])/6; - y_ei[0] = (-3*y_ei[0] + 2*y_ei[1] + 4*y_ei[2] + 2*y_ei[3] + y_ei[4])/6; - y_ie[0] = (-3*y_ie[0] + 2*y_ie[1] + 4*y_ie[2] + 2*y_ie[3] + y_ie[4])/6; - y_ii[0] = (-3*y_ii[0] + 2*y_ii[1] + 4*y_ii[2] + 2*y_ii[3] + y_ii[4])/6; + s_ep[0] = (-3*s_ep[0] + 2*s_ep[1] + 4*s_ep[2] + 2*s_ep[3] + s_ep[4])/6; + s_ei[0] = (-3*s_ei[0] + 2*s_ei[1] + 4*s_ei[2] + 2*s_ei[3] + s_ei[4])/6; + s_gp[0] = (-3*s_gp[0] + 2*s_gp[1] + 4*s_gp[2] + 2*s_gp[3] + s_gp[4])/6; + s_gi[0] = (-3*s_gi[0] + 2*s_gi[1] + 4*s_gi[2] + 2*s_gi[3] + s_gi[4])/6; y [0] = (-3*y [0] + 2*y [1] + 4*y [2] + 2*y [3] + y [4])/6; - x_ee[0] = (-3*x_ee[0] + 2*x_ee[1] + 4*x_ee[2] + 2*x_ee[3] + x_ee[4])/6 + noise_aRK(0); + x_ep[0] = (-3*x_ep[0] + 2*x_ep[1] + 4*x_ep[2] + 2*x_ep[3] + x_ep[4])/6 + noise_aRK(0); x_ei[0] = (-3*x_ei[0] + 2*x_ei[1] + 4*x_ei[2] + 2*x_ei[3] + x_ei[4])/6 + noise_aRK(1); - x_ie[0] = (-3*x_ie[0] + 2*x_ie[1] + 4*x_ie[2] + 2*x_ie[3] + x_ie[4])/6; - x_ii[0] = (-3*x_ii[0] + 2*x_ii[1] + 4*x_ii[2] + 2*x_ii[3] + x_ii[4])/6; + x_gp[0] = (-3*x_gp[0] + 2*x_gp[1] + 4*x_gp[2] + 2*x_gp[3] + x_gp[4])/6; + x_gi[0] = (-3*x_gi[0] + 2*x_gi[1] + 4*x_gi[2] + 2*x_gi[3] + x_gi[4])/6; x [0] = (-3*x [0] + 2*x [1] + 4*x [2] + 2*x [3] + x [4])/6; /* Generate noise for the next iteration */ diff --git a/Cortical_Column.h b/Cortical_Column.h index 9e6ebe0..dbdb4b7 100644 --- a/Cortical_Column.h +++ b/Cortical_Column.h @@ -60,8 +60,8 @@ class Cortical_Column { {set_RNG();} Cortical_Column(double* Param, double* Con) - :sigma_e (Param[0]), g_KNa (Param[1]), dphi (Param[2]), - N_te (Con[2]), N_ti (Con[3]) + :sigma_p (Param[0]), g_KNa (Param[1]), dphi (Param[2]), + N_tp (Con[2]), N_ti (Con[3]) {set_RNG();} /* Connect to the thalamic module */ @@ -79,20 +79,21 @@ class Cortical_Column { friend class Thalamic_Column; private: + /* Declaration of private functions */ /* Initialize the RNGs */ void set_RNG (void); /* Firing rates */ - double get_Qe (int) const; + double get_Qp (int) const; double get_Qi (int) const; /* Currents */ - double I_ee (int) const; + double I_ep (int) const; double I_ei (int) const; - double I_ie (int) const; - double I_ii (int) const; - double I_L_e (int) const; - double I_L_i (int) const; + double I_gp (int) const; + double I_gi (int) const; + double I_L_p (int) const; + double I_L_g (int) const; double I_KNa (int) const; /* Potassium pump */ @@ -102,46 +103,25 @@ class Cortical_Column { double noise_xRK (int,int) const; double noise_aRK (int) const; - /* Population variables */ - vector Ve = _INIT(E_L_e), /* excitatory membrane voltage */ - Vi = _INIT(E_L_i), /* inhibitory membrane voltage */ - Na = _INIT(Na_eq), /* Na concentration */ - y_ee = _INIT(0.0), /* PostSP from excitatory to excitatory population */ - y_ei = _INIT(0.0), /* PostSP from excitatory to inhibitory population */ - y_ie = _INIT(0.0), /* PostSP from inhibitory to excitatory population */ - y_ii = _INIT(0.0), /* PostSP from inhibitory to inhibitory population */ - y = _INIT(0.0), /* axonal flux */ - x_ee = _INIT(0.0), /* derivative of y_ee */ - x_ei = _INIT(0.0), /* derivative of y_ei */ - x_ie = _INIT(0.0), /* derivative of y_ie */ - x_ii = _INIT(0.0), /* derivative of y_ii */ - x = _INIT(0.0); /* derivative of y */ - - /* 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_p = 30; const double tau_i = 30; /* Maximum firing rate in ms^-1 */ - const double Qe_max = 30.E-3; + const double Qp_max = 30.E-3; const double Qi_max = 60.E-3; /* Sigmoid threshold in mV */ - const double theta_e = -58.5; + const double theta_p = -58.5; const double theta_i = -58.5; /* Sigmoid gain in mV */ - const double sigma_e = 4; + const double sigma_p = 4; const double sigma_i = 6; /* Scaling parameter for sigmoidal mapping (dimensionless) */ - const double C1 = (3.14159265/sqrt(3)); + const double C1 = (M_PI/sqrt(3)); /* parameters of the firing adaption */ const double alpha_Na = 2; /* Sodium influx per spike in mM ms */ @@ -152,16 +132,20 @@ class Cortical_Column { /* PSP rise time in ms^-1 */ const double gamma_e = 70E-3; - const double gamma_i = 58.6E-3; + const double gamma_g = 58.6E-3; /* Axonal flux time constant */ const double nu = 120E-3; - /* Conductivities in mS/cm^-2 */ - /* Leak */ - const double g_L = 1; + /* Conductivities */ + /* Leak in aU*/ + const double g_L = 1.; - /* KNa */ + /* Synaptic conductivities in ms */ + const double g_AMPA = 1.; + const double g_GABA = 1.; + + /* KNa in mS/cm^2 */ const double g_KNa = 1.33; /* Reversal potentials in mV */ @@ -170,8 +154,8 @@ class Cortical_Column { const double E_GABA = -70; /* Leak */ - const double E_L_e = -64; - const double E_L_i = -64; + const double E_L_p = -64; + const double E_L_g = -64; /* Potassium */ const double E_K = -100; @@ -182,19 +166,40 @@ class Cortical_Column { double input = 0.0; /* Connectivities (dimensionless) */ - const double N_ee = 115; + const double N_ep = 115; const double N_ei = 72; - const double N_ie = 90; + const double N_ip = 90; const double N_ii = 90; - const double N_te = 2.5; + const double N_tp = 2.5; const double N_ti = 2.5; /* Pointer to thalamic column */ Thalamic_Column* Thalamus; - /* Interation matrix for SRK4 */ - const vector A = {0.5, 0.5, 1.0, 1.0}; + /* Parameters for SRK4 iteration */ + const vector A = {0.5, 0.5, 1.0, 1.0}; const vector B = {0.75, 0.75, 0.0, 0.0}; + + /* Random number generators */ + vector MTRands; + + /* Container for noise */ + vector Rand_vars; + + /* Population variables */ + vector Vp = _INIT(E_L_p), /* excitatory membrane voltage */ + Vi = _INIT(E_L_g), /* inhibitory membrane voltage */ + Na = _INIT(Na_eq), /* Na concentration */ + s_ep = _INIT(0.0), /* PostSP from excitatory to excitatory population */ + s_ei = _INIT(0.0), /* PostSP from excitatory to inhibitory population */ + s_gp = _INIT(0.0), /* PostSP from inhibitory to excitatory population */ + s_gi = _INIT(0.0), /* PostSP from inhibitory to inhibitory population */ + y = _INIT(0.0), /* axonal flux */ + x_ep = _INIT(0.0), /* derivative of s_ep */ + x_ei = _INIT(0.0), /* derivative of s_ei */ + x_gp = _INIT(0.0), /* derivative of s_gp */ + x_gi = _INIT(0.0), /* derivative of s_gi */ + x = _INIT(0.0); /* derivative of y */ }; /****************************************************************************************************/ /* end */ diff --git a/Data_Storage.h b/Data_Storage.h index 1edda30..dcb7473 100644 --- a/Data_Storage.h +++ b/Data_Storage.h @@ -38,7 +38,7 @@ /****************************************************************************************************/ /* Save data */ /****************************************************************************************************/ -inline void get_data(int counter, Cortical_Column& Cortex, Thalamic_Column& Thalamus, vector Data) { +void get_data(int counter, Cortical_Column& Cortex, Thalamic_Column& Thalamus, vector Data) { Data[0][counter] = Cortex.Ve [0]; Data[1][counter] = Thalamus.Vt [0]; Data[2][counter] = Thalamus.Ca [0]; diff --git a/NM_TC.pro b/NM_TC.pro index 24487b9..0eeabed 100644 --- a/NM_TC.pro +++ b/NM_TC.pro @@ -6,16 +6,16 @@ CONFIG -= qt TARGET = TC.cpp SOURCES += Cortical_Column.cpp \ - TC.cpp \ - TC_mex.cpp \ + TC.cpp \ + TC_mex.cpp \ Thalamic_Column.cpp -HEADERS += Cortical_Column.h \ - Data_Storage.h \ - ODE.h \ - Random_Stream.h \ - Stimulation.h \ - Thalamic_Column.h +HEADERS += Cortical_Column.h \ + Data_Storage.h \ + ODE.h \ + Random_Stream.h \ + Stimulation.h \ + Thalamic_Column.h QMAKE_CXXFLAGS += -std=c++11 -O3 diff --git a/ODE.h b/ODE.h index c17a319..99b6bcd 100644 --- a/ODE.h +++ b/ODE.h @@ -38,7 +38,7 @@ /****************************************************************************************************/ /* Evaluation of SRK4 */ /****************************************************************************************************/ -inline void ODE(Cortical_Column& Cortex, Thalamic_Column& Thalamus) { +void ODE(Cortical_Column& Cortex, Thalamic_Column& Thalamus) { /* First calculate every ith RK moment. Has to be in order, 1th moment first */ for (int i=0; i<4; ++i) { Cortex.set_RK(i); diff --git a/Random_Stream.h b/Random_Stream.h index abd6c10..f5fb19a 100644 --- a/Random_Stream.h +++ b/Random_Stream.h @@ -21,7 +21,6 @@ * * AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com * Stefanie Gareis: gareis@inb.uni-luebeck.de - * */ /****************************************************************************************************/ diff --git a/Stimulation.h b/Stimulation.h index f1fbf38..5c0048e 100644 --- a/Stimulation.h +++ b/Stimulation.h @@ -35,7 +35,6 @@ #include "Random_Stream.h" #include "Cortical_Column.h" #include "Thalamic_Column.h" - /****************************************************************************************************/ /* Stimulation object */ /****************************************************************************************************/ @@ -143,10 +142,10 @@ class Stim { Thalamic_Column* Thalamus; /* Data containers */ - std::vector marker_stimulation; + std::vector marker_stimulation; /* Random number generator in case of semi-periodic stimulation */ - random_stream_uniform_int Rand_Uniform; + random_stream_uniform_int Uniform_Distribution; }; /****************************************************************************************************/ /* end */ @@ -196,7 +195,10 @@ void Stim::setup (double* var_stim) { /* If ISI is random create RNG */ if (ISI_range != 0){ /* Create the generator */ - Rand_Uniform = random_stream_uniform_int(ISI-ISI_range, ISI+ISI_range); + Generator = ENG(rand()); + + /* Combine RNG with distribution */ + Uniform_Distribution = DIST_int(ISI-ISI_range, ISI+ISI_range); } } else { /* In case of phase dependent stimulation, time_to_stim is the time from minimum detection to start of stimulation */ @@ -234,7 +236,7 @@ void Stim::check_stim (int time) { } /* After last stimulus in event update the timer with respect to (random) ISI*/ else { - time_to_stimuli += (ISI_range==0)? ISI : Rand_Uniform(); + time_to_stimuli += (ISI_range==0)? ISI : Uniform_Distribution(Generator); /* Reset the stimulus counter for next stimulation event */ count_stimuli = 1; diff --git a/TC.cpp b/TC.cpp index bf49ad8..d816f96 100644 --- a/TC.cpp +++ b/TC.cpp @@ -30,9 +30,12 @@ /****************************************************************************************************/ /* Main file for compilation tests */ +/* The Simulation requires the following boost libraries: Random */ /****************************************************************************************************/ #include #include +#include "Cortical_Column.h" +#include "Thalamic_Column.h" #include "ODE.h" diff --git a/TC_mex.cpp b/TC_mex.cpp index 7eedf77..da470eb 100644 --- a/TC_mex.cpp +++ b/TC_mex.cpp @@ -32,6 +32,7 @@ /* Implementation of the simulation as MATLAB routine (mex compiler) */ /* mex command is given by: */ /* mex CXXFLAGS="\$CXXFLAGS -std=c++11" TC_mex.cpp Cortical_Column.cpp Thalamic_Column.cpp */ +/* The Simulation requires the following boost libraries: Random */ /****************************************************************************************************/ #include #include "mex.h" diff --git a/Thalamic_Column.cpp b/Thalamic_Column.cpp index 7da1485..4739830 100644 --- a/Thalamic_Column.cpp +++ b/Thalamic_Column.cpp @@ -43,9 +43,11 @@ void Thalamic_Column::set_RNG(void) { /* Create RNG for each stream */ for (int i=0; iy[N] - y_tt[N]) - 2 * gamma_e * x_tt[N]) + noise_xRK(N,0); - x_tr [N+1] = x_tr [0] + A[N]*dt*(pow(gamma_e, 2) * (N_tr * get_Qt(N) + N_er * Cortex->y[N] - y_tr[N]) - 2 * gamma_e * x_tr[N]); - x_rt [N+1] = x_rt [0] + A[N]*dt*(pow(gamma_i, 2) * (N_rt * get_Qr(N) - y_rt[N]) - 2 * gamma_i * x_rt[N]); - x_rr [N+1] = x_rr [0] + A[N]*dt*(pow(gamma_i, 2) * (N_rr * get_Qr(N) - y_rr[N]) - 2 * gamma_i * x_rr[N]); + x_et [N+1] = x_et [0] + A[N]*dt*(pow(gamma_e, 2) * ( + N_pt * Cortex->y[N] - y_et[N]) - 2 * gamma_e * x_et[N]) + noise_xRK(N,0); + x_er [N+1] = x_er [0] + A[N]*dt*(pow(gamma_e, 2) * (N_tr * get_Qt(N) + N_pr * Cortex->y[N] - y_er[N]) - 2 * gamma_e * x_er[N]); + x_rt [N+1] = x_rt [0] + A[N]*dt*(pow(gamma_g, 2) * (N_rt * get_Qr(N) - y_rt[N]) - 2 * gamma_g * x_rt[N]); + x_rr [N+1] = x_rr [0] + A[N]*dt*(pow(gamma_g, 2) * (N_rr * get_Qr(N) - y_rr[N]) - 2 * gamma_g * x_rr[N]); x [N+1] = x [0] + A[N]*dt*(pow(nu, 2) * ( get_Qt(N) - y [N]) - 2 * nu * x [N]); h_T_t [N+1] = h_T_t[0] + A[N]*dt*(h_inf_T_t(N) - h_T_t[N])/tau_h_T_t(N); h_T_r [N+1] = h_T_r[0] + A[N]*dt*(h_inf_T_r(N) - h_T_r[N])/tau_h_T_r(N); @@ -280,13 +282,13 @@ void Thalamic_Column::add_RK(void) { Vt [0] =(-3*Vt [0] + 2*Vt [1] + 4*Vt [2] + 2* Vt [3] + Vt [4])/6; Vr [0] =(-3*Vr [0] + 2*Vr [1] + 4*Vr [2] + 2* Vr [3] + Vr [4])/6; Ca [0] =(-3*Ca [0] + 2*Ca [1] + 4*Ca [2] + 2* Ca [3] + Ca [4])/6; - y_tt [0] =(-3*y_tt [0] + 2*y_tt [1] + 4*y_tt [2] + 2* y_tt [3] + y_tt [4])/6; - y_tr [0] =(-3*y_tr [0] + 2*y_tr [1] + 4*y_tr [2] + 2* y_tr [3] + y_tr [4])/6; + y_et [0] =(-3*y_et [0] + 2*y_et [1] + 4*y_et [2] + 2* y_et [3] + y_et [4])/6; + y_er [0] =(-3*y_er [0] + 2*y_er [1] + 4*y_er [2] + 2* y_er [3] + y_er [4])/6; y_rt [0] =(-3*y_rt [0] + 2*y_rt [1] + 4*y_rt [2] + 2* y_rt [3] + y_rt [4])/6; y_rr [0] =(-3*y_rr [0] + 2*y_rr [1] + 4*y_rr [2] + 2* y_rr [3] + y_rr [4])/6; y [0] =(-3*y [0] + 2*y [1] + 4*y [2] + 2* y [3] + y [4])/6; - x_tt [0] =(-3*x_tt [0] + 2*x_tt [1] + 4*x_tt [2] + 2* x_tt [3] + x_tt [4])/6 + noise_aRK(0); - x_tr [0] =(-3*x_tr [0] + 2*x_tr [1] + 4*x_tr [2] + 2* x_tr [3] + x_tr [4])/6; + x_et [0] =(-3*x_et [0] + 2*x_et [1] + 4*x_et [2] + 2* x_et [3] + x_et [4])/6 + noise_aRK(0); + x_er [0] =(-3*x_er [0] + 2*x_er [1] + 4*x_er [2] + 2* x_er [3] + x_er [4])/6; x_rt [0] =(-3*x_rt [0] + 2*x_rt [1] + 4*x_rt [2] + 2* x_rt [3] + x_rt [4])/6; x_rr [0] =(-3*x_rr [0] + 2*x_rr [1] + 4*x_rr [2] + 2* x_rr [3] + x_rr [4])/6; x [0] =(-3*x [0] + 2*x [1] + 4*x [2] + 2* x [3] + x [4])/6; diff --git a/Thalamic_Column.h b/Thalamic_Column.h index fd1f214..46554bb 100644 --- a/Thalamic_Column.h +++ b/Thalamic_Column.h @@ -62,7 +62,7 @@ class Thalamic_Column { /* Constructor for simulation */ Thalamic_Column(double* Param, double* Con) : g_LK (Param[1]), g_h (Param[0]), - N_et (Con[0]), N_er (Con[1]) + N_pt (Con[0]), N_pr (Con[1]) {set_RNG();} /* Get the pointer to the cortical module */ @@ -80,6 +80,7 @@ class Thalamic_Column { void set_input (double I) {input = I;} private: + /* Declaration of private functions */ /* Initialize the RNGs */ void set_RNG (void); @@ -89,9 +90,9 @@ class Thalamic_Column { /* Synaptic currents */ double I_et (int) const; - double I_it (int) const; + double I_gt (int) const; double I_er (int) const; - double I_ir (int) const; + double I_gr (int) const; /* Activation functions */ double m_inf_T_t (int) const; @@ -124,31 +125,6 @@ class Thalamic_Column { double noise_xRK (int,int) const; double noise_aRK (int) const; - /* Population variables */ - 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 */ - y_tt = _INIT(0.0), /* PostSP from TC population to TC population */ - y_tr = _INIT(0.0), /* PostSP from TC population to RE population */ - y_rt = _INIT(0.0), /* PostSP from RE population to TC population */ - y_rr = _INIT(0.0), /* PostSP from RE population to RE population */ - y = _INIT(0.0), /* axonal flux */ - x_tt = _INIT(0.0), /* derivative of y_tt */ - x_tr = _INIT(0.0), /* derivative of y_tr */ - x_rt = _INIT(0.0), /* derivative of y_rt */ - x_rr = _INIT(0.0), /* derivative of y_rr */ - x = _INIT(0.0), /* derivative of y */ - h_T_t = _INIT(0.0), /* inactivation of T channel */ - h_T_r = _INIT(0.0), /* inactivation of T channel */ - m_h = _INIT(0.0), /* activation of h channel */ - m_h2 = _INIT(0.0); /* activation of h channel bound with protein */ - - /* Random number generators */ - vector MTRands; - - /* Container for noise */ - vector Rand_vars; - /* Declaration and Initialization of parameters */ /* Membrane time in ms */ const double tau_t = 20; @@ -167,27 +143,31 @@ class Thalamic_Column { const double sigma_r = 6; /* Scaling parameter for sigmoidal mapping (dimensionless) */ - const double C1 = (3.14159265/sqrt(3)); + const double C1 = (M_PI/sqrt(3)); /* PSP rise time in ms^-1 */ const double gamma_e = 70E-3; - const double gamma_i = 100E-3; + const double gamma_g = 100E-3; /* axonal flux time constant */ const double nu = 120E-3; - /* Conductivities in mS/cm^-2 */ - /* Leak current */ - const double g_L = 1; + /* Conductivities */ + /* Leak in aU */ + const double g_L = 1.; + + /* Synaptic conductivity in ms */ + const double g_AMPA = 1.; + const double g_GABA = 1.; - /* Potassium leak current */ + /* Potassium leak current in mS/m^2 */ const double g_LK = 0.02; - /* T current */ + /* T current in mS/m^2 */ const double g_T_t = 3; const double g_T_r = 2.3; - /* h current */ + /* h current in mS/m^2 */ const double g_h = 0.051; /* Reversal potentials in mV */ @@ -230,15 +210,42 @@ class Thalamic_Column { const double N_tr = 3; const double N_rt = 5; const double N_rr = 19; - const double N_et = 2.6; - const double N_er = 2.6; + + /* Connectivities from cortex (dimensionless) */ + const double N_pt = 2.6; + const double N_pr = 2.6; /* Pointer to cortical column */ Cortical_Column* Cortex; - /* SRK integration parameters */ - const vector A = {0.5, 0.5, 1.0, 1.0}; + /* Parameters for SRK4 iteration */ + const vector A = {0.5, 0.5, 1.0, 1.0}; const vector B = {0.75, 0.75, 0.0, 0.0}; + + /* Random number generators */ + vector MTRands; + + /* Container for noise */ + vector Rand_vars; + + /* Population variables */ + 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 */ + y_et = _INIT(0.0), /* PostSP from TC population to TC population */ + y_er = _INIT(0.0), /* PostSP from TC population to RE population */ + y_rt = _INIT(0.0), /* PostSP from RE population to TC population */ + y_rr = _INIT(0.0), /* PostSP from RE population to RE population */ + y = _INIT(0.0), /* axonal flux */ + x_et = _INIT(0.0), /* derivative of y_et */ + x_er = _INIT(0.0), /* derivative of y_er */ + x_rt = _INIT(0.0), /* derivative of y_rt */ + x_rr = _INIT(0.0), /* derivative of y_rr */ + x = _INIT(0.0), /* derivative of y */ + h_T_t = _INIT(0.0), /* inactivation of T channel */ + h_T_r = _INIT(0.0), /* inactivation of T channel */ + m_h = _INIT(0.0), /* activation of h channel */ + m_h2 = _INIT(0.0); /* activation of h channel bound with protein */ }; /****************************************************************************************************/ /* end */