Permalink
Browse files

Updated implementation of the Thalamo-cortical model

Stimulation protocol has been reworked
Multiple code cleanups and spelling fixes

Signed-off-by: Schellenberger <schellenberger@inb.uni-luebeck.de>
  • Loading branch information...
1 parent b409096 commit 790a3f1e58701edf36443947129bb5e15d0e1d7d @miscco committed Oct 1, 2014
Showing with 307 additions and 228 deletions.
  1. +3 −3 .cproject
  2. +6 −6 Cortical_Column.h
  3. +4 −4 Main.cpp
  4. +38 −25 Plots.m
  5. +239 −174 Stimulation.h
  6. +11 −10 TC.cpp
  7. +6 −5 Thalamic_Column.h
  8. +0 −1 saves.h
View
@@ -23,7 +23,7 @@
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1024163887" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.787584377" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.312080211" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.other.other.74128570" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-std=c++0x -c -fmessage-length=0" valueType="string"/>
+ <option id="gnu.cpp.compiler.option.other.other.74128570" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-std=c++11 -c -fmessage-length=0" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1054982019" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.900081259" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
@@ -33,7 +33,7 @@
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.2088031771" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.590332858" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
- <option id="gnu.cpp.link.option.flags.218353989" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-std=c++0x" valueType="string"/>
+ <option id="gnu.cpp.link.option.flags.218353989" name="Linker flags" superClass="gnu.cpp.link.option.flags" value="-std=c++11" valueType="string"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1214797218" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
@@ -101,7 +101,7 @@
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="TC_v2.cdt.managedbuild.target.gnu.exe.517165918" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+ <project id="TC_model.cdt.managedbuild.target.gnu.exe.1203717936" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
View
@@ -54,9 +54,9 @@ class Cortical_Column {
Cortical_Column(void)
{set_RNG();}
- Cortical_Column(double* Par, double* Con)
- :sigma_e (Par[0]), g_KNa (Par[1]), dphi (Par[2]),
- N_te (Con[2]), N_ti (Con[3])
+ 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])
{set_RNG();}
/* Connect to the thalamic module */
@@ -94,7 +94,7 @@ class Cortical_Column {
/* Data storage access */
friend void get_data (int, Cortical_Column&, Thalamic_Column&, _REPEAT(double*, 2));
- /* Stimulation protocoll access */
+ /* Stimulation protocol access */
friend class Stim;
private:
@@ -141,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; /* Sodium time constant in ms */
+ const double tau_Na = 1.5; /* 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 */
@@ -161,7 +161,7 @@ class Cortical_Column {
const double g_KNa = 1.33;
/* Reversal potentials in mV */
- /* synaptic */
+ /* Synaptic */
const double E_AMPA = 0;
const double E_GABA = -70;
View
@@ -36,10 +36,10 @@
/* Fixed simulation settings */
/****************************************************************************************************/
extern const int T = 30; /* Simulation length 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 */
+extern const int res = 1E4; /* Number of iteration steps per s */
+extern const int red = 1E2; /* Fraction of iterations that is saved */
+extern const double dt = 1E3/res; /* Duration of a iteration step in ms */
+extern const double h = sqrt(dt); /* Square root of dt for SRK iteration */
/****************************************************************************************************/
/* end */
/****************************************************************************************************/
View
63 Plots.m
@@ -4,19 +4,29 @@
function Plots(T)
if nargin == 0
- Input_N3 = [ 6.5; % sigma_e
- 2.1; % g_KNa
- 120E-3]; % dphi
+
+ Param_Cortex_N2 = [4.7; % sigma_e
+ 1.43; % g_KNa
+ 120E-3]; % dphi
+
+ Param_Cortex_N3 = [6.3; % sigma_e
+ 2.; % g_KNa
+ 120E-3]; % dphi
+
+
+ Param_Thalamus_N2 = [0.025; % g_LK_t
+ 0.025; % g_LK_r
+ 0.08]; % g_h
- Input_N2 = [ 4.7; % sigma_e
- 1.5; % g_KNa
- 120E-3]; % dphi
+ Param_Thalamus_N3 = [0.021; % g_LK_t
+ 0.021; % g_LK_r
+ 0.08]; % g_h
- Connectivity= [2.4; % N_et
- 2.5; % N_er
- 5; % N_te
- 5]; % N_ti
+ Connectivity = [2.4; % N_et
+ 2.6; % N_er
+ 5; % N_te
+ 10]; % N_ti
% stimulation parameters
% first number is the mode of stimulation
@@ -27,37 +37,40 @@ function Plots(T)
var_stim = [ 0; % mode of stimulation
60; % strength of the stimulus in Hz (spikes per second)
- 100; % duration of the stimulus in ms
+ 200; % duration of the stimulus in ms
5; % time between stimuli in s
- 650]; % time until stimuli after negativ peak in ms
+ 300]; % time until stimuli after negativ peak in ms
- T = 30; % duration of the simulation
+ T = 600; % duration of the simulation
end
-[Ve, Vt, Marker_Stim] = TC(T, Input_N2, Connectivity, var_stim);
+%[Ve, Vt, Marker_Stim] = TC(T, Param_Cortex_N2, Param_Thalamus_N2, Connectivity, var_stim);
+[Ve, Vt, Marker_Stim] = TC(T, Param_Cortex_N3, Param_Thalamus_N3, Connectivity, var_stim);
L = max(size(Vt));
timeaxis = linspace(0,T,L);
figure(1)
subplot(211), plot(timeaxis,Ve)
title('Pyramidal membrane voltage'), xlabel('time in s'), ylabel('Ve in mV')
+ylim([-80, -40])
% vertical line for markers
-%hx = graph2d.constantline(Marker_Stim(3,:));
-%changedependvar(hx,'x');
+hx1 = graph2d.constantline(Marker_Stim(2,:), 'color', 'black');
+hx2 = graph2d.constantline(Marker_Stim(1,:), 'color', 'red');
+changedependvar(hx1,'x');
+changedependvar(hx2,'x');
subplot(212), plot(timeaxis,Vt)
title('Thalamic relay membrane voltage'), xlabel('time in s'), ylabel('Vt in mV')
% vertical line for markers
-%hx = graph2d.constantline(Marker_Stim(3,:));
-%changedependvar(hx,'x');
+hx = graph2d.constantline(Marker_Stim(2,:));
+changedependvar(hx,'x');
+[Pxx,f] = pwelch(Ve-mean(Ve),hamming(L/30), 4*L/T, 2048, L/T);
+n = find(f<=30, 1, 'last' );
-% [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');
+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
Oops, something went wrong.

0 comments on commit 790a3f1

Please sign in to comment.