Nov 9, 2015
Updated the code with correct license.
|
|
|
2 |
* Copyright (c) 2015 University of Lübeck |
|
3 |
* |
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
|
5 |
* of this software and associated documentation files (the "Software"), to deal |
|
6 |
* in the Software without restriction, including without limitation the rights |
|
7 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
8 |
* copies of the Software, and to permit persons to whom the Software is |
|
9 |
* furnished to do so, subject to the following conditions: |
|
10 |
* |
|
11 |
* The above copyright notice and this permission notice shall be included in |
|
12 |
* all copies or substantial portions of the Software. |
|
13 |
* |
|
14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
15 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|
16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|
17 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|
18 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|
19 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|
20 |
* THE SOFTWARE. |
|
21 |
* |
|
22 |
* AUTHORS: Michael Schellenberger Costa: mschellenbergercosta@gmail.com |
|
23 |
* |
|
24 |
* Based on: A thalamocortical neural mass model of the EEG during NREM sleep and its response |
|
25 |
* to auditory stimulation. |
|
26 |
* M Schellenberger Costa, A Weigenand, H-VV Ngo, L Marshall, J Born, T Martinetz, |
|
27 |
* JC Claussen. |
Sep 13, 2016
Major cleanup and moderinization
|
|
|
51 |
|
|
52 |
/* Get the random number for the first iteration */ |
|
53 |
Rand_vars.push_back(MTRands[2*i]()); |
|
54 |
Rand_vars.push_back(MTRands[2*i+1]()); |
|
55 |
} |
|
56 |
} |
|
57 |
/******************************************************************************/ |
|
58 |
/* RK noise scaling */ |
|
59 |
/******************************************************************************/ |
|
60 |
double Thalamic_Column::noise_xRK(int N, int M) const{ |
|
61 |
return gamma_e * gamma_e * (Rand_vars[2*M] + Rand_vars[2*M+1]/std::sqrt(3))*B[N]; |
Sep 13, 2016
Major cleanup and moderinization
|
|
|
201 |
extern const double dt; |
|
202 |
Vt [N+1] = Vt [0] + A[N]*dt*(-(I_L_t(N) + I_et(N) + I_gt(N))/tau_t - C_m * (I_LK_t(N) + I_T_t(N) + I_h(N))); |
|
203 |
Vr [N+1] = Vr [0] + A[N]*dt*(-(I_L_r(N) + I_er(N) + I_gr(N))/tau_r - C_m * (I_LK_r(N) + I_T_r(N))); |
|
204 |
Ca [N+1] = Ca [0] + A[N]*dt*(alpha_Ca * I_T_t(N) - (Ca[N] - Ca_0)/tau_Ca); |
|
205 |
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); |
|
206 |
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); |
|
207 |
m_h [N+1] = m_h [0] + A[N]*dt*((m_inf_h(N) * (1 - m_h2[N]) - m_h[N])/tau_m_h(N) - k3 * P_h(N) * m_h[N] + k4 * m_h2[N]); |
|
208 |
m_h2 [N+1] = m_h2 [0] + A[N]*dt*(k3 * P_h(N) * m_h[N] - k4 * m_h2[N]); |
|
209 |
s_et [N+1] = s_et [0] + A[N]*dt*(x_et[N]); |
|
210 |
s_er [N+1] = s_er [0] + A[N]*dt*(x_er[N]); |
|
211 |
s_gt [N+1] = s_gt [0] + A[N]*dt*(x_gt[N]); |
|
212 |
s_gr [N+1] = s_gr [0] + A[N]*dt*(x_gr[N]); |
|
213 |
y [N+1] = y [0] + A[N]*dt*(x [N]); |
|
214 |
x_et [N+1] = x_et [0] + A[N]*dt*(gamma_e*gamma_e * ( + N_tp * Cortex->y[N] - s_et[N]) - 2 * gamma_e * x_et[N]) + noise_xRK(N,0); |
|
215 |
x_er [N+1] = x_er [0] + A[N]*dt*(gamma_e*gamma_e * (N_rt * get_Qt(N) + N_rp * Cortex->y[N] - s_er[N]) - 2 * gamma_e * x_er[N]); |
|
216 |
x_gt [N+1] = x_gt [0] + A[N]*dt*(gamma_g*gamma_g * (N_tr * get_Qr(N) - s_gt[N]) - 2 * gamma_g * x_gt[N]); |
|
217 |
x_gr [N+1] = x_gr [0] + A[N]*dt*(gamma_g*gamma_g * (N_rr * get_Qr(N) - s_gr[N]) - 2 * gamma_g * x_gr[N]); |
|
218 |
x [N+1] = x [0] + A[N]*dt*(nu * nu * ( get_Qt(N) - y [N]) - 2 * nu * x [N]); |