From b409096462c5522a0ab5e4069deb722ec9c49a70 Mon Sep 17 00:00:00 2001 From: Schellenberger Date: Thu, 21 Aug 2014 11:39:12 +0200 Subject: [PATCH] Tuned the parameters of both the thalammic and the cortical column. Increased g_KLeak to and g_KNa to counteract excitation from the other column. Signed-off-by: Schellenberger --- Cortical_Column.h | 7 +++---- Figures.m | 59 ------------------------------------------------------- Plots.m | 56 +++++++++++++++++++++++++++++++--------------------- Stimulation.h | 31 +++++++++++++++++------------ Thalamic_Column.h | 18 ++++++++--------- 5 files changed, 64 insertions(+), 107 deletions(-) delete mode 100644 Figures.m diff --git a/Cortical_Column.h b/Cortical_Column.h index 3e94d3b..1196be9 100644 --- a/Cortical_Column.h +++ b/Cortical_Column.h @@ -55,8 +55,7 @@ class Cortical_Column { {set_RNG();} Cortical_Column(double* Par, double* Con) - :sigma_e (Par[0]), alpha_Na (Par[1]), tau_Na (Par[2]), g_KNa (Par[3]), - dphi (Par[4]), + :sigma_e (Par[0]), g_KNa (Par[1]), dphi (Par[2]), N_te (Con[2]), N_ti (Con[3]) {set_RNG();} @@ -142,7 +141,7 @@ class Cortical_Column { /* parameters of the firing adaption */ const double alpha_Na = 2; /* Sodium influx per spike in mM ms */ - const double tau_Na = 1.2; /* Sodium time constant in 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 */ @@ -152,7 +151,7 @@ class Cortical_Column { const double gamma_i = 58.6E-3; /* Axonal flux time constant */ - const double nu = 60E-3; + const double nu = 120E-3; /* Conductivities in mS/cm^-2 */ /* Leak */ diff --git a/Figures.m b/Figures.m deleted file mode 100644 index 669a734..0000000 --- a/Figures.m +++ /dev/null @@ -1,59 +0,0 @@ -% mex command is given by: -% mex CXXFLAGS="\$CXXFLAGS -std=c++0x" TC.cpp Cortical_Column.cpp Thalamic_Column.cpp - -function Figures(T) - -if nargin == 0 - Input_N3 = [ 8.7; % sigma_e - 2.6; % alpha_Na - 3; % tau_Na - 1.6; % g_KNa - 60E-3]; % dphi - - - Input_N2 = [ 4.6; % sigma_e - 2; % alpha_Na - 1.2; % tau_Na - 1.33; % g_KNa - 60E-3]; % dphi - - Connectivity= [2; % N_et - 2; % N_er - 4; % N_te - 4]; % 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 = [ 1; % mode of stimulation - 40; % strength of the stimulus in Hz (spikes per second) - 50; % duration of the stimulus in ms - 5; % time between stimuli in s - 0]; % time until stimuli after min in ms - - T = 30; % duration of the simulation -end - -[Ve_N2, Vt_N2] = TC(T, Input_N2, Connectivity, var_stim); - -[Ve_N3, Vt_N3] = TC(T, Input_N3, Connectivity, var_stim); - -L = max(size(Vt)); -timeaxis = linspace(0,T,L); - -figure(1) -subplot(211), plot(timeaxis,Ve_N2) -title('Pyramidal membrane voltage'), xlabel('time in s'), ylabel('Ve in mV') -subplot(212), plot(timeaxis,Vt_N2) -title('Thalamic relay membrane voltage'), xlabel('time in s'), ylabel('Vt in mV') - -figure(2) -subplot(211), plot(timeaxis,Ve_N3) -title('Pyramidal membrane voltage'), xlabel('time in s'), ylabel('Ve in mV') -subplot(212), plot(timeaxis,Vt_N3) -title('Thalamic relay membrane voltage'), xlabel('time in s'), ylabel('Vt in mV') -%save('TC.mat','Ve','Vt') diff --git a/Plots.m b/Plots.m index 4af50d2..d1b52f1 100644 --- a/Plots.m +++ b/Plots.m @@ -1,26 +1,22 @@ % mex command is given by: -% mex CXXFLAGS="\$CXXFLAGS -std=c++0x" TC.cpp Cortical_Column.cpp Thalamic_Column.cpp +% mex CXXFLAGS="\$CXXFLAGS -std=c++11" TC.cpp Cortical_Column.cpp Thalamic_Column.cpp function Plots(T) if nargin == 0 - Input_N3 = [ 8.7; % sigma_e - 2.6; % alpha_Na - 3; % tau_Na - 1.6; % g_KNa - 60E-3]; % dphi + Input_N3 = [ 6.5; % sigma_e + 2.1; % g_KNa + 120E-3]; % dphi - Input_N2 = [ 4.6; % sigma_e - 2; % alpha_Na - 1.2; % tau_Na - 1.33; % g_KNa - 60E-3]; % dphi - - Connectivity= [2.5; % N_et - 2.5; % N_er - 4; % N_te - 4]; % N_ti + Input_N2 = [ 4.7; % sigma_e + 1.5; % g_KNa + 120E-3]; % dphi + + Connectivity= [2.4; % N_et + 2.5; % N_er + 5; % N_te + 5]; % N_ti % stimulation parameters % first number is the mode of stimulation @@ -30,15 +26,15 @@ function Plots(T) % 3 == phase dependend down state var_stim = [ 0; % mode of stimulation - 40; % strength of the stimulus in Hz (spikes per second) - 150; % duration of the stimulus in ms - 5; % time between stimuli in s - 0]; % time until stimuli after min in ms + 60; % strength of the stimulus in Hz (spikes per second) + 100; % duration of the stimulus in ms + 5; % time between stimuli in s + 650]; % time until stimuli after negativ peak in ms T = 30; % duration of the simulation end -[Ve, Vt] = TC(T, Input_N2, Connectivity, var_stim); +[Ve, Vt, Marker_Stim] = TC(T, Input_N2, Connectivity, var_stim); L = max(size(Vt)); timeaxis = linspace(0,T,L); @@ -46,6 +42,22 @@ function Plots(T) figure(1) subplot(211), plot(timeaxis,Ve) title('Pyramidal membrane voltage'), xlabel('time in s'), ylabel('Ve in mV') +% vertical line for markers +%hx = graph2d.constantline(Marker_Stim(3,:)); +%changedependvar(hx,'x'); + subplot(212), plot(timeaxis,Vt) title('Thalamic relay membrane voltage'), xlabel('time in s'), ylabel('Vt in mV') -%save('TC.mat','Ve','Vt') +% vertical line for markers +%hx = graph2d.constantline(Marker_Stim(3,:)); +%changedependvar(hx,'x'); + + +% [Pxx,f] = pwelch(Ve-mean(Ve),[], [], [], L/T); +% n = find(f<=30, 1, 'last' ); +% +% figure(2) +% plot(f(1:n),log(Pxx(1:n))) +% title('Powerspectrum with pwelch'), xlabel('frequency in Hz'), ylabel('Power (log)') +% save('Timeseries', 'Ve', 'Vt'); +end \ No newline at end of file diff --git a/Stimulation.h b/Stimulation.h index 12eb22a..6e973b2 100644 --- a/Stimulation.h +++ b/Stimulation.h @@ -49,20 +49,23 @@ class Stim { /* Mode of stimulation */ mode = (int) var_stim[0]; - /* Scale the stimulation strength from s^-1 to ms^-1 */ + /* Scale the stimulation strength from s^-1 (Hz) to ms^-1 */ strength = var_stim[1] / 1000; /* Scale duration from ms to dt */ duration = (int) var_stim[2] * res / 1000; - /* Scale the ISI from s to ms^-1 */ + /* Scale the ISI from s to ms */ ISI = (int) var_stim[3] * res; /* Scale time to stimulus from ms to dt */ time_to_stim= (int) var_stim[4] * res / 1000; + /* Set the onset correction for the marker */ + correction = onset * res; + if(mode==1) { - time_to_stim = (onset+1) * res; + time_to_stim = (int) (onset+1) * res; } correction = onset * res; @@ -80,7 +83,7 @@ class Stim { /* Periodic stimulation */ case 1: - /* Check if time is reached */ + /* Check if stimulation time is reached */ if(time == time_to_stim) { /* Switch stimulation on */ stimulation_started = true; @@ -89,7 +92,7 @@ class Stim { /* Update the timer */ time_to_stim += ISI; - + /* Add marker */ marker_threshold.push_back(0); marker_minimum.push_back(0); marker_stimulation.push_back(time - correction); @@ -181,15 +184,17 @@ class Stim { /* Create MATLAB container for marker storage */ mxArray* get_marker(void) { + extern const int res; 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; + std::vector marker_threshold; + std::vector marker_minimum; + std::vector marker_stimulation; }; /****************************************************************************************************/ /* end */ diff --git a/Thalamic_Column.h b/Thalamic_Column.h index 10b5a32..446d2a4 100644 --- a/Thalamic_Column.h +++ b/Thalamic_Column.h @@ -154,18 +154,18 @@ class Thalamic_Column { const double theta_r = -58.6; /* Sigmoid gain in mV */ - const double sigma_t = 2; - const double sigma_r = 2; + const double sigma_t = 4; + const double sigma_r = 4; /* 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; + const double gamma_i = 100E-3; /* axonal flux time constant */ - const double nu = 60E-3; + const double nu = 120E-3; /* Conductivities in mS/cm^-2 */ /* Leak current */ @@ -174,14 +174,14 @@ class Thalamic_Column { /* Potassium leak current */ const double g_LK_t = 0.025; - const double g_LK_r = 0.02; + const double g_LK_r = 0.025; /* T current */ const double g_T_t = 3; const double g_T_r = 2; /* h current */ - const double g_h = 0.06; + const double g_h = 0.08; /* Reversal potentials in mV */ /* Synaptic */ @@ -216,14 +216,14 @@ class Thalamic_Column { /* Noise parameters in ms^-1 */ const double mphi = 0E-3; - const double dphi = 20E-3;; + const double dphi = 10E-3;; double input = 0.0; /* Connectivities (dimensionless) */ - const double N_tr = 5; + const double N_tr = 6; const double N_rt = 5; - const double N_rr = 50; + const double N_rr = 100; const double N_et = 10; const double N_er = 10;