-
Notifications
You must be signed in to change notification settings - Fork 4
/
Thalamic_Column.h
247 lines (201 loc) · 8.45 KB
/
Thalamic_Column.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*
* Copyright (c) 2015 University 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* 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
* 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
* 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
* THE SOFTWARE.
*
* AUTHORS: Michael Schellenberger Costa: [email protected]
*
* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response
* to auditory stimulation.
* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born, T Martinetz,
* JC Claussen.
* PLoS Computational Biology http://dx.doi.org/10.1371/journal.pcbi.1005022
*/
/******************************************************************************/
/* Implementation of a thalamic module */
/******************************************************************************/
#pragma once
#include <cmath>
#include <vector>
#include "Cortical_Column.h"
#include "Random_Stream.h"
class Cortical_Column;
class Thalamic_Column {
public:
/* Constructor for simulation */
Thalamic_Column(double* Param, double* Con)
: g_LK (Param[0]), g_h (Param[1]),
N_tp (Con[0]), N_rp (Con[1])
{set_RNG();}
/* Get the pointer to the cortical module */
void get_Cortex (Cortical_Column& C) {Cortex = &C;}
/* ODE functions */
void set_RK (int);
void add_RK (void);
/* Set strength of external input */
void set_input (double I) {input = I;}
private:
/* Declaration of private functions */
/* Initialize the RNGs */
void set_RNG (void);
/* Firing rates */
double get_Qt (int) const;
double get_Qr (int) const;
/* Synaptic currents */
double I_et (int) const;
double I_gt (int) const;
double I_er (int) const;
double I_gr (int) const;
/* Activation functions */
double m_inf_T_t (int) const;
double m_inf_T_r (int) const;
double m_inf_h (int) const;
double tau_m_h (int) const;
double P_h (int) const;
double act_h (void)const;
double m_inf_hs (int) const;
double tau_m_hs (int) const;
double tau_m_hf (int) const;
/* Deactivation functions */
double h_inf_T_t (int) const;
double h_inf_T_r (int) const;
double tau_h_T_t (int) const;
double tau_h_T_r (int) const;
/* Currents */
double I_L_t (int) const;
double I_L_r (int) const;
double I_LK_t (int) const;
double I_LK_r (int) const;
double I_T_t (int) const;
double I_T_r (int) const;
double I_h (int) const;
/* Noise functions */
double noise_xRK (int,int) const;
double noise_aRK (int) const;
/* Helper functions */
inline std::vector<double> init (double value)
{return {value, 0.0, 0.0, 0.0, 0.0};}
inline void add_RK (std::vector<double>& var)
{var[0] = (-3*var[0] + 2*var[1] + 4*var[2] + 2*var[3] + var[4])/6;}
inline void add_RK_noise (std::vector<double>& var, unsigned noise)
{var[0] = (-3*var[0] + 2*var[1] + 4*var[2] + 2*var[3] + var[4])/6 + noise_aRK(noise);}
/* Declaration and Initialization of parameters */
/* Membrane time in ms */
const double tau_t = 20;
const double tau_r = 20;
/* 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 = -58.5;
const double theta_r = -58.5;
/* Sigmoid gain in mV */
const double sigma_t = 6.;
const double sigma_r = 6.;
/* Scaling parameter for sigmoidal mapping (dimensionless) */
const double C1 = (M_PI/sqrt(3));
/* PSP rise time in ms^-1 */
const double gamma_e = 70E-3;
const double gamma_g = 100E-3;
/* Axonal flux time constant in ms^-1*/
const double nu = 120E-3;
/* Membrane capacitance in muF/cm^2 */
const double C_m = 1.;
/* Leak weight in aU */
const double g_L = 1.;
/* Synaptic weights in ms */
const double g_AMPA = 1.;
const double g_GABA = 1.;
/* Conductivities */
/* Potassium leak current in mS/m^2 */
const double g_LK = 0.02;
/* T current in mS/m^2 */
const double g_T_t = 3;
const double g_T_r = 2.3;
/* h current in mS/m^2 */
const double g_h = 0.06;
/* 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 = -70;
/* 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 = -51.8E-6; /* influx per spike in nmol */
const double tau_Ca = 10; /* calcium time constant in ms */
const double Ca_0 = 2.4E-4; /* resting concentration */
/* I_h activation parameters */
const double k1 = 2.5E7;
const double k2 = 4E-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 = 20E-3;
double input = 0.0;
/* Connectivities (dimensionless) */
const double N_rt = 3.;
const double N_tr = 5.;
const double N_rr = 25.;
/* Connectivities from cortex (dimensionless) */
const double N_tp = 2.6;
const double N_rp = 2.6;
/* Pointer to cortical column */
Cortical_Column* Cortex;
/* Parameters for SRK4 iteration */
const std::vector<double> A = {0.5, 0.5, 1.0, 1.0};
const std::vector<double> B = {0.75, 0.75, 0.0, 0.0};
/* Random number generators */
std::vector<randomStreamNormal> MTRands;
/* Container for noise */
std::vector<double> Rand_vars;
/* Population variables */
std::vector<double> 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 */
s_et = init(0.0), /* PostSP from TC population to TC population */
s_er = init(0.0), /* PostSP from TC population to RE population */
s_gt = init(0.0), /* PostSP from RE population to TC population */
s_gr = init(0.0), /* PostSP from RE population to RE population */
y = init(0.0), /* axonal flux */
x_et = init(0.0), /* derivative of s_et */
x_er = init(0.0), /* derivative of s_er */
x_gt = init(0.0), /* derivative of s_gt */
x_gr = init(0.0), /* derivative of s_gr */
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 */
/* Data storage access */
friend void get_data (int, Cortical_Column&, Thalamic_Column&, std::vector<double*>&);
friend class Cortical_Column;
};
/****************************************************************************************************/
/* end */
/****************************************************************************************************/