Skip to content

Commit

Permalink
Merge pull request #348 from PTraeder/predefined-unit-variables
Browse files Browse the repository at this point in the history
Predefined unit variables
  • Loading branch information
Plotnikov committed May 23, 2017
2 parents ca8c731 + 189dd14 commit 4925a45
Show file tree
Hide file tree
Showing 63 changed files with 438 additions and 285 deletions.
4 changes: 2 additions & 2 deletions models/aeif_cond_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ neuron aeif_cond_alpha_neuron:

# Impulse to add to DG_EXC on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_E nS/ms = 1.0 nS * e / tau_syn_ex
PSConInit_E nS/ms = nS * e / tau_syn_ex

# Impulse to add to DG_INH on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_I nS/ms = 1.0 nS * e / tau_syn_in
PSConInit_I nS/ms = nS * e / tau_syn_in

# refractory time in steps
RefractoryCounts integer = steps(t_ref)
Expand Down
4 changes: 2 additions & 2 deletions models/aeif_cond_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ neuron aeif_cond_alpha_implicit:

# Impulse to add to DG_EXC on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_E nS/ms = 1.0 nS * e / tau_syn_ex
PSConInit_E nS/ms = nS * e / tau_syn_ex

# Impulse to add to DG_INH on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_I nS/ms = 1.0 nS * e / tau_syn_in
PSConInit_I nS/ms = nS * e / tau_syn_in

# refractory time in steps
RefractoryCounts integer = steps(t_ref)
Expand Down
4 changes: 2 additions & 2 deletions models/aeif_cond_exp_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ neuron aeif_cond_exp_implicit:
emit_spike()
end

g_ex += spikeExc * 1 nS
g_in += spikeInh * 1 nS
g_ex += spikeExc * nS
g_in += spikeInh * nS
I_stim = currents
end

Expand Down
24 changes: 12 additions & 12 deletions models/hh_cond_exp_traub.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ neuron hh_cond_exp_traub_neuron:
V_m mV = E_L # Membrane potential

# equilibrium values for (in)activation variables
function alpha_n_init 1/ms = 0.032/(1 ms* 1 mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n_init 1/ms = 0.5 /1 ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m_init 1/ms = 0.32/(1 ms* 1 mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m_init 1/ms = 0.28/(1 ms* 1 mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h_init 1/ms = 0.128/1 ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h_init 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / 1 ms
function alpha_n_init 1/ms = 0.032/(ms* mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n_init 1/ms = 0.5 / ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m_init 1/ms = 0.32/(ms* mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m_init 1/ms = 0.28/(ms* mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h_init 1/ms = 0.128/ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h_init 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / ms

Act_m real = alpha_m_init / ( alpha_m_init + beta_m_init )
Act_h real = alpha_h_init / ( alpha_h_init + beta_h_init )
Expand All @@ -67,12 +67,12 @@ neuron hh_cond_exp_traub_neuron:

# channel dynamics
function V_rel mV = V_m - V_T
function alpha_n 1/ms = 0.032/(1 ms* 1 mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n 1/ms = 0.5 /1 ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m 1/ms = 0.32/(1 ms* 1 mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m 1/ms = 0.28/(1 ms* 1 mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h 1/ms = 0.128/1 ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / 1 ms
function alpha_n 1/ms = 0.032/(ms* mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n 1/ms = 0.5 /ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m 1/ms = 0.32/(ms* mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m 1/ms = 0.28/(ms* mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h 1/ms = 0.128/ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / ms

Act_m' = ( alpha_m - ( alpha_m + beta_m ) * Act_m )
Act_h' = ( alpha_h - ( alpha_h + beta_h ) * Act_h )
Expand Down
28 changes: 14 additions & 14 deletions models/hh_cond_exp_traub_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ neuron hh_cond_exp_traub_implicit:
g_ex nS = 0nS # Excitatory synaptic conductance

# TODO: it should be possible, to define these variables in the internal block
function alpha_n_init 1/ms = 0.032/(1 ms* 1 mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n_init 1/ms = 0.5 /1 ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m_init 1/ms = 0.32/(1 ms* 1 mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m_init 1/ms = 0.28/(1 ms* 1 mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h_init 1/ms = 0.128/1 ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h_init 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / 1 ms
function alpha_n_init 1/ms = 0.032/(ms* mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n_init 1/ms = 0.5 /ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m_init 1/ms = 0.32/(ms* mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m_init 1/ms = 0.28/(ms* mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h_init 1/ms = 0.128/ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h_init 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / ms

Act_m real = alpha_m_init / ( alpha_m_init + beta_m_init )
Act_h real = alpha_h_init / ( alpha_h_init + beta_h_init )
Expand All @@ -64,12 +64,12 @@ neuron hh_cond_exp_traub_implicit:

# equilibrium values for (in)activation variables
function V_rel mV = V_m - V_T
function alpha_n 1/ms = 0.032/(1 ms* 1 mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n 1/ms = 0.5 /1 ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m 1/ms = 0.32/(1 ms* 1 mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m 1/ms = 0.28/(1 ms* 1 mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h 1/ms = 0.128/1 ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / 1 ms
function alpha_n 1/ms = 0.032/(ms* mV ) * ( 15. mV - V_m) / ( exp( ( 15. mV - V_m) / 5. mV ) - 1. )
function beta_n 1/ms = 0.5 /ms * exp( ( 10. mV - V_m ) / 40. mV )
function alpha_m 1/ms = 0.32/(ms* mV ) * ( 13. mV - V_m) / ( exp( ( 13. mV - V_m) / 4. mV ) - 1. )
function beta_m 1/ms = 0.28/(ms* mV ) * ( V_m - 40. mV ) / ( exp( ( V_m - 40. mV ) / 5. mV ) - 1. )
function alpha_h 1/ms = 0.128/ms * exp( ( 17. mV - V_m) / 18. mV )
function beta_h 1/ms = ( 4. / ( 1. + exp( ( 40. mV - V_m ) / 5. mV) ) ) / ms

Act_m' = ( alpha_m - ( alpha_m + beta_m ) * Act_m )
Act_h' = ( alpha_h - ( alpha_h + beta_h ) * Act_h )
Expand Down Expand Up @@ -126,8 +126,8 @@ neuron hh_cond_exp_traub_implicit:
# set new input current
I_stim = currents

g_ex += spikeExc * 1 nS
g_in += spikeInh * 1 nS
g_ex += spikeExc * nS
g_in += spikeInh * nS
end

end
36 changes: 18 additions & 18 deletions models/hh_psc_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ neuron hh_psc_alpha_neuron:
state:
V_m mV = -65. mV # Membrane potential

function alpha_n_init real = ( 0.01 * ( V_m / 1 mV + 55. ) ) / ( 1. - exp( -( V_m / 1 mV + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m / 1 mV + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m / 1 mV + 40. ) ) / ( 1. - exp( -( V_m / 1 mV + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m / 1 mV + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m / 1 mV + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m / 1 mV + 35. ) / 10. ) )
function alpha_n_init real = ( 0.01 * ( V_m / mV + 55. ) ) / ( 1. - exp( -( V_m / mV + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m / mV + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m / mV + 40. ) ) / ( 1. - exp( -( V_m / mV + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m / mV + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m / mV + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m / mV + 35. ) / 10. ) )

Act_m real = alpha_m_init / ( alpha_m_init + beta_m_init ) # Activation variable m
Act_h real = alpha_h_init / ( alpha_h_init + beta_h_init ) # Activation variable h
Expand All @@ -74,19 +74,19 @@ neuron hh_psc_alpha_neuron:
V_m' =( -( I_Na + I_K + I_L ) + currents + I_e + I_syn_inh + I_syn_exc ) / C_m

# Inact_n
function alpha_n real = ( 0.01 * ( V_m / 1 mV + 55. ) ) / ( 1. - exp( -( V_m / 1 mV + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m / 1 mV + 65. ) / 80. )
Inact_n' = ( alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n ) / 1 ms # n-variable
function alpha_n real = ( 0.01 * ( V_m / mV + 55. ) ) / ( 1. - exp( -( V_m / mV + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m / mV + 65. ) / 80. )
Inact_n' = ( alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n ) / ms # n-variable

# Act_m
function alpha_m real = ( 0.1 * ( V_m / 1 mV + 40. ) ) / ( 1. - exp( -( V_m / 1 mV + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m / 1 mV + 65. ) / 18. )
Act_m' = ( alpha_m * ( 1 - Act_m ) - beta_m * Act_m ) / 1 ms # m-variable
function alpha_m real = ( 0.1 * ( V_m / mV + 40. ) ) / ( 1. - exp( -( V_m / mV + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m / mV + 65. ) / 18. )
Act_m' = ( alpha_m * ( 1 - Act_m ) - beta_m * Act_m ) / ms # m-variable

# Act_h
function alpha_h real = 0.07 * exp( -( V_m / 1 mV + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m / 1 mV + 35. ) / 10. ) )
Act_h' = ( alpha_h * ( 1 - Act_h ) - beta_h * Act_h ) / 1 ms # h-variable
function alpha_h real = 0.07 * exp( -( V_m / mV + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m / mV + 35. ) / 10. ) )
Act_h' = ( alpha_h * ( 1 - Act_h ) - beta_h * Act_h ) / ms # h-variable
end

parameters:
Expand All @@ -106,11 +106,11 @@ neuron hh_psc_alpha_neuron:
internals:
# Impulse to add to DG_EXC on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_E pA/ms = 1.0 pA * e / tau_syn_ex
PSConInit_E pA/ms = pA * e / tau_syn_ex

# Impulse to add to DG_INH on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_I pA/ms = 1.0 pA * e / tau_syn_in
PSConInit_I pA/ms = pA * e / tau_syn_in


RefractoryCounts integer = steps(t_ref) # refractory time in steps
Expand All @@ -131,7 +131,7 @@ neuron hh_psc_alpha_neuron:
# sending spikes: crossing 0 mV, pseudo-refractoriness and local maximum...
if r > 0: # is refractory?
r -= 1
elif V_m > 0mV and U_old > V_m: # threshold && maximum
elif V_m > 0 mV and U_old > V_m: # threshold && maximum
r = RefractoryCounts
emit_spike()
end
Expand Down
34 changes: 17 additions & 17 deletions models/hh_psc_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ neuron hh_psc_alpha_implicit:
I_syn_ex pA # inputs from the exc spikes
I_syn_in pA # inputs from the inh spikes

function alpha_n_init real = ( 0.01 * ( V_m / 1 mV + 55. ) ) / ( 1. - exp( -( V_m / 1 mV + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m / 1 mV + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m / 1 mV + 40. ) ) / ( 1. - exp( -( V_m / 1 mV + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m / 1 mV + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m / 1 mV + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m / 1 mV + 35. ) / 10. ) )
function alpha_n_init real = ( 0.01 * ( V_m / mV + 55. ) ) / ( 1. - exp( -( V_m / mV + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m / mV + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m / mV + 40. ) ) / ( 1. - exp( -( V_m / mV + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m / mV + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m / mV + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m / mV + 35. ) / 10. ) )

Act_m real = alpha_m_init / ( alpha_m_init + beta_m_init ) # Activation variable m
Act_h real = alpha_h_init / ( alpha_h_init + beta_h_init ) # Activation variable h
Expand All @@ -79,19 +79,19 @@ neuron hh_psc_alpha_implicit:
V_m' =( -( I_Na + I_K + I_L ) + I_stim + I_e + I_syn_inh + I_syn_exc ) / C_m

# Inact_n
function alpha_n real = ( 0.01 * ( V_m / 1 mV + 55. ) ) / ( 1. - exp( -( V_m / 1 mV + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m / 1 mV + 65. ) / 80. )
Inact_n' = ( alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n ) / 1 ms # n-variable
function alpha_n real = ( 0.01 * ( V_m / mV + 55. ) ) / ( 1. - exp( -( V_m / mV + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m / mV + 65. ) / 80. )
Inact_n' = ( alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n ) / ms # n-variable

# Act_m
function alpha_m real = ( 0.1 * ( V_m / 1 mV + 40. ) ) / ( 1. - exp( -( V_m / 1 mV + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m / 1 mV + 65. ) / 18. )
Act_m' = ( alpha_m * ( 1 - Act_m ) - beta_m * Act_m ) / 1 ms # m-variable
function alpha_m real = ( 0.1 * ( V_m / mV + 40. ) ) / ( 1. - exp( -( V_m / mV + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m / mV + 65. ) / 18. )
Act_m' = ( alpha_m * ( 1 - Act_m ) - beta_m * Act_m ) / ms # m-variable

# Act_h'
function alpha_h real = 0.07 * exp( -( V_m / 1 mV + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m / 1 mV + 35. ) / 10. ) )
Act_h' = ( alpha_h * ( 1 - Act_h ) - beta_h * Act_h ) / 1 ms # h-variable
function alpha_h real = 0.07 * exp( -( V_m / mV + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m / mV + 35. ) / 10. ) )
Act_h' = ( alpha_h * ( 1 - Act_h ) - beta_h * Act_h ) / ms # h-variable
end

parameters:
Expand All @@ -111,11 +111,11 @@ neuron hh_psc_alpha_implicit:
internals:
# Impulse to add to DG_EXC on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_E pA/ms = 1.0 pA * e / tau_syn_ex
PSConInit_E pA/ms = pA * e / tau_syn_ex

# Impulse to add to DG_INH on spike arrival to evoke unit-amplitude
# conductance excursion.
PSConInit_I pA/ms = 1.0 pA * e / tau_syn_in
PSConInit_I pA/ms = pA * e / tau_syn_in


RefractoryCounts integer = steps(t_ref) # refractory time in steps
Expand Down
38 changes: 19 additions & 19 deletions models/ht_neuron.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ neuron ht_neuron_nestml:
function I_syn pA = I_syn_ampa + I_syn_nmda + I_syn_gaba_a + I_syn_gaba_b

# I_Na(p), m_inf^3 according to Compte et al, J Neurophysiol 2003 89:2707
function INaP_thresh mV = -55.7pA
function INaP_slope mV = 7.7pA
function INaP_thresh mV = -55.7 pA
function INaP_slope mV = 7.7 pA
function m_inf_NaP real = 1.0 / ( 1.0 + exp( -( V_m - INaP_thresh ) / INaP_slope ) )
# Persistent Na current; member only to allow recording
recordable function I_NaP pA = -NaP_g_peak * pow( m_inf_NaP, 3.0 )* ( V_m - NaP_E_rev )
Expand All @@ -82,14 +82,14 @@ neuron ht_neuron_nestml:
recordable function I_h pA = -h_g_peak * Ih_m * ( V_m - h_E_rev )
# The spike current is only activate immediately after a spike.
function I_spike mV = (g_spike) ? -( V_m - E_K ) / Tau_spike : 0
V_m' = ( ( I_Na + I_K + I_syn + I_NaP + I_KNa + I_T + I_h + I_stim ) / Tau_m + I_spike * 1 [pA/(ms * mV)] ) * 1 [s/nF]
V_m' = ( ( I_Na + I_K + I_syn + I_NaP + I_KNa + I_T + I_h + I_stim ) / Tau_m + I_spike * pA/(ms * mV) ) * s/nF
#############
# Intrinsic currents
#############
# I_T
function m_inf_T real = 1.0 / ( 1.0 + exp( -( V_m / 1 mV + 59.0 ) / 6.2 ) )
function h_inf_T real = 1.0 / ( 1.0 + exp( ( V_m / 1 mV + 83.0 ) / 4 ) )
function tau_m_h real = 1.0 / ( exp( -14.59 - 0.086 * V_m / 1 mV ) + exp( -1.87 + 0.0701 * V_m / 1 mV ) )
function m_inf_T real = 1.0 / ( 1.0 + exp( -( V_m / mV + 59.0 ) / 6.2 ) )
function h_inf_T real = 1.0 / ( 1.0 + exp( ( V_m / mV + 83.0 ) / 4 ) )
function tau_m_h real = 1.0 / ( exp( -14.59 - 0.086 * V_m / mV ) + exp( -1.87 + 0.0701 * V_m / mV ) )
# I_KNa
function D_influx_peak real = 0.025
function tau_D real = 1250.0 # yes, 1.25s
Expand All @@ -104,14 +104,14 @@ neuron ht_neuron_nestml:

# equation modified from y[](1-D_eq) to (y[]-D_eq), since we'd not
# be converging to equilibrium otherwise
IKNa_D' = ( D_influx_peak * D_influx * 1 nS - ( IKNa_D - KNa_D_EQ * 1 [1/mV] ) / tau_D ) /1 ms
function tau_m_T real = 0.22 / ( exp( -( V_m / 1 mV + 132.0 ) / 16.7 ) + exp( ( V_m / 1 mV + 16.8 ) / 18.2 ) ) + 0.13
function tau_h_T real = 8.2 + ( 56.6 + 0.27 * exp( ( V_m / 1 mV + 115.2 ) / 5.0 ) ) / ( 1.0 + exp( ( V_m / 1 mV + 86.0 ) / 3.2 ) )
IKNa_D' = ( D_influx_peak * D_influx * nS - ( IKNa_D - KNa_D_EQ / mV ) / tau_D ) / ms
function tau_m_T real = 0.22 / ( exp( -( V_m / mV + 132.0 ) / 16.7 ) + exp( ( V_m / mV + 16.8 ) / 18.2 ) ) + 0.13
function tau_h_T real = 8.2 + ( 56.6 + 0.27 * exp( ( V_m / mV + 115.2 ) / 5.0 ) ) / ( 1.0 + exp( ( V_m / mV + 86.0 ) / 3.2 ) )
function I_h_Vthreshold real = -75.0
function m_inf_h real = 1.0 / ( 1.0 + exp( ( V_m / 1 mV - I_h_Vthreshold ) / 5.5 ) )
IT_m' = ( m_inf_T * 1 nS - IT_m ) / tau_m_T /1 ms
IT_h' = ( h_inf_T * 1 nS - IT_h ) / tau_h_T /1 ms
Ih_m' = ( m_inf_h * 1 nS - Ih_m ) / tau_m_h /1 ms
function m_inf_h real = 1.0 / ( 1.0 + exp( ( V_m / mV - I_h_Vthreshold ) / 5.5 ) )
IT_m' = ( m_inf_T * nS - IT_m ) / tau_m_T / ms
IT_h' = ( h_inf_T * nS - IT_h ) / tau_h_T / ms
Ih_m' = ( m_inf_h * nS - Ih_m ) / tau_m_h / ms

#############
# Synapses
Expand Down Expand Up @@ -204,10 +204,10 @@ neuron ht_neuron_nestml:
end
r_potassium -= 1

g_AMPA' += AMPAInitialValue * AMPA * 1 [nS/ms]
g_NMDA' += NMDAInitialValue * NMDA * 1 [nS/ms]
g_GABAA' += GABA_AInitialValue * GABA_A * 1 [nS/ms]
g_GABAB' += GABA_BInitialValue * GABA_B * 1 [nS/ms]
g_AMPA' += AMPAInitialValue * AMPA * nS/ms
g_NMDA' += NMDAInitialValue * NMDA * nS/ms
g_GABAA' += GABA_AInitialValue * GABA_A * nS/ms
g_GABAB' += GABA_BInitialValue * GABA_B * nS/ms

if (not g_spike) and V_m >= Theta:
# Set V and Theta to the sodium reversal potential.
Expand Down Expand Up @@ -237,9 +237,9 @@ neuron ht_neuron_nestml:
# See: Exact digital simulation of time-invariant linear systems
# with applications to neuronal modeling, Rotter and Diesmann,
# section 3.1.2.
exact_integration_adjustment real = ( ( 1 / Tau_2 ) - ( 1 / Tau_1 ) ) * 1 ms
exact_integration_adjustment real = ( ( 1 / Tau_2 ) - ( 1 / Tau_1 ) ) * ms

t_peak real = ( Tau_2 * Tau_1 ) * log( Tau_2 / Tau_1 ) / ( Tau_2 - Tau_1 ) / 1 ms
t_peak real = ( Tau_2 * Tau_1 ) * log( Tau_2 / Tau_1 ) / ( Tau_2 - Tau_1 ) / ms
normalisation_factor real = 1 / ( exp( -t_peak / Tau_1 ) - exp( -t_peak / Tau_2 ) )

return g_peak * normalisation_factor * exact_integration_adjustment
Expand Down
Loading

0 comments on commit 4925a45

Please sign in to comment.