From 8ae1ecc127970326c2533b5fc608a00b6ef56bba Mon Sep 17 00:00:00 2001 From: Schellenberger Date: Tue, 25 Nov 2014 10:27:24 +0100 Subject: [PATCH] More Parameter tuning. Nice spindles during N2. Ok N3. Signed-off-by: Schellenberger --- Cortical_Column.h | 2 +- Plots.m | 32 +++++++++++++------------------- TC.cpp | 9 ++++++--- Thalamic_Column.cpp | 2 +- Thalamic_Column.h | 10 ++++------ saves.h | 3 ++- 6 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Cortical_Column.h b/Cortical_Column.h index b196f62..8d4972d 100644 --- a/Cortical_Column.h +++ b/Cortical_Column.h @@ -92,7 +92,7 @@ class Cortical_Column { void add_RK (void); /* Data storage access */ - friend void get_data (int, Cortical_Column&, Thalamic_Column&, _REPEAT(double*, 3)); + friend void get_data (int, Cortical_Column&, Thalamic_Column&, _REPEAT(double*, 4)); /* Stimulation protocol access */ friend class Stim; diff --git a/Plots.m b/Plots.m index 4cb45c5..f1983c1 100644 --- a/Plots.m +++ b/Plots.m @@ -12,28 +12,22 @@ function Plots(type) 1.35; % g_KNa 120E-3]; % dphi - Param_Thalamus = [0.037; % g_h - 0.024; % g_LK_t - 0.024]; % g_LK_r + Param_Thalamus = [0.053; % g_h + 0.024]; % g_LK else - Param_Cortex = [6.; % sigma_e - 2.1; % g_KNa + Param_Cortex = [6.; % sigma_e + 2.1; % g_KNa 120E-3]; % dphi - Param_Thalamus = [0.042; % g_h - 0.022; % g_LK_t - 0.022; % g_LK_r - 2.5; % k1 - 4; % k2 - 1; % k3 - 1]; % k4 + Param_Thalamus = [0.055; % g_h + 0.02]; % g_LK end -Connectivity = [ 4; % N_et - 4; % N_er +Connectivity = [ 2.5; % N_et + 2.5; % N_er 5; % N_te - 8]; % N_ti + 10]; % N_ti % stimulation parameters % first number is the mode of stimulation @@ -41,9 +35,9 @@ function Plots(type) % 1 == semi-periodic % 2 == phase dependend -var_stim = [ 2; % mode of stimulation +var_stim = [ 0; % mode of stimulation 80; % strength of the stimulus in Hz (spikes per second) - 150; % duration of the stimulus in ms + 120; % duration of the stimulus in ms 5; % time between stimulation events in s (ISI) 0; % range of ISI in s [ISI-range,ISI+range] 3; % Number of stimuli per event @@ -52,7 +46,7 @@ function Plots(type) T = 30; % duration of the simulation -[Ve, Vt, ah, Marker_Stim] = TC(T, Param_Cortex, Param_Thalamus, Connectivity, var_stim); +[Ve, Vt, Ca, ah, Marker_Stim] = TC(T, Param_Cortex, Param_Thalamus, Connectivity, var_stim); L = length(Vt); timeaxis = linspace(0,T,L); @@ -93,7 +87,7 @@ function Plots(type) hx = graph2d.constantline(Marker_Stim/1E2+(i-1)*var_stim(7)/1E3,'ydata', get(gca,'ylim'),'xdata', get(gca,'xlim'), 'color', 'black', 'LineStyle', ':'); changedependvar(hx,'x'); end -% [Pxx,f] = pwelch(Ve-mean(Ve),hamming(5*L/T), 2*L/T, [], L/T); +% [Pxx,f] = pwelch(Ve-mean(Ve),hamming(10*L/T), 2*L/T, [], L/T); % n = find(f<=30, 1, 'last' ); % % figure(2) diff --git a/TC.cpp b/TC.cpp index 04edf75..b2a4737 100644 --- a/TC.cpp +++ b/TC.cpp @@ -78,11 +78,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Create data containers */ mxArray* Ve = SetMexArray(1, T*res/red); mxArray* Vt = SetMexArray(1, T*res/red); + mxArray* Ca = SetMexArray(1, T*res/red); mxArray* ah = SetMexArray(1, T*res/red); /* Pointer to the actual data block */ double* Pr_Ve = mxGetPr(Ve); double* Pr_Vt = mxGetPr(Vt); + double* Pr_Ca = mxGetPr(Ca); double* Pr_ah = mxGetPr(ah); /* Simulation */ @@ -91,7 +93,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { ODE (Cortex, Thalamus); Stimulation.check_stim(t); if(t>=onset*res && t%red==0){ - get_data(count, Cortex, Thalamus, Pr_Ve, Pr_Vt, Pr_ah); + get_data(count, Cortex, Thalamus, Pr_Ve, Pr_Vt, Pr_Ca, Pr_ah); ++count; } } @@ -99,8 +101,9 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Output of the simulation */ plhs[0] = Ve; plhs[1] = Vt; - plhs[2] = ah; - plhs[3] = Stimulation.get_marker(); + plhs[2] = Ca; + plhs[3] = ah; + plhs[4] = Stimulation.get_marker(); return; } /****************************************************************************************************/ diff --git a/Thalamic_Column.cpp b/Thalamic_Column.cpp index 7524d81..bbde587 100644 --- a/Thalamic_Column.cpp +++ b/Thalamic_Column.cpp @@ -114,7 +114,7 @@ double Thalamic_Column::m_inf_T_t (int N) const{ /* Activation in RE population after Destexhe 1996 */ double Thalamic_Column::m_inf_T_r (int N) const{ _SWITCH((Vr)) - double m = 1/(1+exp(-(var_Vr+52)/7.2)); + double m = 1/(1+exp(-(var_Vr+52)/7.4)); return m; } diff --git a/Thalamic_Column.h b/Thalamic_Column.h index 10971ac..373cdf3 100644 --- a/Thalamic_Column.h +++ b/Thalamic_Column.h @@ -57,9 +57,7 @@ class Thalamic_Column { /* Constructor for simulation */ Thalamic_Column(double* Param, double* Con) - : g_LK_t (Param[1]), g_LK_r (Param[2]), g_h (Param[0]), - k1 (Param[3]*1E7), k2 (Param[4]*1E-4), - k3 (Param[5]*1E-1), k4 (Param[6]*1E-3), + : g_LK_t (Param[1]), g_LK_r (Param[1]), g_h (Param[0]), N_et (Con[0]), N_er (Con[1]) {set_RNG();} @@ -116,7 +114,7 @@ class Thalamic_Column { void add_RK (void); /* Data storage access */ - friend void get_data (int, Cortical_Column&, Thalamic_Column&, _REPEAT(double*, 3)); + friend void get_data (int, Cortical_Column&, Thalamic_Column&, _REPEAT(double*, 4)); private: /* Population variables */ @@ -227,8 +225,8 @@ class Thalamic_Column { /* Connectivities (dimensionless) */ const double N_tr = 3; - const double N_rt = 5; - const double N_rr = 16; + const double N_rt = 6; + const double N_rr = 19; const double N_et = 5; const double N_er = 5; diff --git a/saves.h b/saves.h index bcf9292..29f447e 100644 --- a/saves.h +++ b/saves.h @@ -30,9 +30,10 @@ /****************************************************************************************************/ /* Save data */ /****************************************************************************************************/ -inline void get_data(int counter, Cortical_Column& Cortex, Thalamic_Column& Thalamus, double* Ve, double* Vt, double* ah) { +inline void get_data(int counter, Cortical_Column& Cortex, Thalamic_Column& Thalamus, double* Ve, double* Vt, double* Ca, double* ah) { Ve [counter] = Cortex.Ve [0]; Vt [counter] = Thalamus.Vt [0]; + Ca [counter] = Thalamus.Ca [0]; ah [counter] = Thalamus.act_h (); } /****************************************************************************************************/