Skip to content

Commit

Permalink
Merge pull request #343 from PTraeder/model-review
Browse files Browse the repository at this point in the history
Make an initial review of NESTML neuron models with regard to the used physical units in the model specification.
  • Loading branch information
Plotnikov authored Apr 10, 2017
2 parents 1374b77 + c0a589c commit 279c571
Show file tree
Hide file tree
Showing 46 changed files with 547 additions and 400 deletions.
2 changes: 1 addition & 1 deletion models/aeif_cond_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ neuron aeif_cond_alpha_neuron:
emit_spike()
end

I_stim = currents.get_sum()*1pA
I_stim = currents
end

end
10 changes: 5 additions & 5 deletions models/aeif_cond_alpha_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ neuron aeif_cond_alpha_implicit:
equations:
function V_bounded mV = min(V_m, V_peak) # prevent exponential divergence
# alpha function for the g_in
g_in'' = (-2/tau_syn_in) * g_in'-(1/tau_syn_in**2) * g_in
g_in'' = (-2/tau_syn_in) * g_in'-(1/tau_syn_in**2) * g_in
g_in' = g_in'

# alpha function for the g_ex
g_ex'' = (-2/tau_syn_ex) * g_ex'-(1/tau_syn_ex**2) * g_ex
g_ex'' = (-2/tau_syn_ex) * g_ex'-(1/tau_syn_ex**2) * g_ex
g_ex' = g_ex'

# Add aliases to simplify the equation definition of V_m
Expand Down Expand Up @@ -125,9 +125,9 @@ neuron aeif_cond_alpha_implicit:
emit_spike()
end

g_ex' += spikesExc.get_sum() * PSConInit_E
g_in' += spikesInh.get_sum() * PSConInit_I
I_stim = currents.get_sum()
g_ex' += spikesExc * PSConInit_E
g_in' += spikesInh * PSConInit_I
I_stim = currents
end

end
2 changes: 1 addition & 1 deletion models/aeif_cond_exp.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ neuron aeif_cond_exp_neuron:
emit_spike()
end

I_stim = currents.get_sum()
I_stim = currents
end

end
6 changes: 3 additions & 3 deletions models/aeif_cond_exp_implicit.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ neuron aeif_cond_exp_implicit:
emit_spike()
end

g_ex += spikeExc.get_sum()
g_in += spikeInh.get_sum()
I_stim = currents.get_sum()
g_ex += spikeExc * 1 nS
g_in += spikeInh * 1 nS
I_stim = currents
end

end
32 changes: 16 additions & 16 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 real = 0.032 * ( 15. - V_m ) / ( exp( ( 15. - V_m ) / 5. ) - 1. )
function beta_n_init real = 0.5 * exp( ( 10. - V_m ) / 40. )
function alpha_m_init real = 0.32 * ( 13. - V_m ) / ( exp( ( 13. - V_m ) / 4. ) - 1. )
function beta_m_init real = 0.28 * ( V_m - 40. ) / ( exp( ( V_m - 40. ) / 5. ) - 1. )
function alpha_h_init real = 0.128 * exp( ( 17. - V_m ) / 18. )
function beta_h_init real = 4. / ( 1. + exp( ( 40. - V_m ) / 5. ) )
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

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,16 +67,16 @@ neuron hh_cond_exp_traub_neuron:

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

Act_m' = alpha_m - ( alpha_m + beta_m ) * Act_m
Act_h' = alpha_h - ( alpha_h + beta_h ) * Act_h
Inact_n' = alpha_n - ( alpha_n + beta_n ) * Inact_n
Act_m' = ( alpha_m - ( alpha_m + beta_m ) * Act_m )
Act_h' = ( alpha_h - ( alpha_h + beta_h ) * Act_h )
Inact_n' = ( alpha_n - ( alpha_n + beta_n ) * Inact_n )

end

Expand Down Expand Up @@ -124,7 +124,7 @@ neuron hh_cond_exp_traub_neuron:
end

# set new input current
I_stim = currents.get_sum()
I_stim = currents

end

Expand Down
36 changes: 18 additions & 18 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 real = 0.032 * ( 15. - V_m ) / ( exp( ( 15. - V_m ) / 5. ) - 1. )
function beta_n_init real = 0.5 * exp( ( 10. - V_m ) / 40. )
function alpha_m_init real = 0.32 * ( 13. - V_m ) / ( exp( ( 13. - V_m ) / 4. ) - 1. )
function beta_m_init real = 0.28 * ( V_m - 40. ) / ( exp( ( V_m - 40. ) / 5. ) - 1. )
function alpha_h_init real = 0.128 * exp( ( 17. - V_m ) / 18. )
function beta_h_init real = 4. / ( 1. + exp( ( 40. - V_m ) / 5. ) )
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

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,16 +64,16 @@ neuron hh_cond_exp_traub_implicit:

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

Act_m' = alpha_m - ( alpha_m + beta_m ) * Act_m
Act_h' = alpha_h - ( alpha_h + beta_h ) * Act_h
Inact_n' = alpha_n - ( alpha_n + beta_n ) * Inact_n
Act_m' = ( alpha_m - ( alpha_m + beta_m ) * Act_m )
Act_h' = ( alpha_h - ( alpha_h + beta_h ) * Act_h )
Inact_n' = ( alpha_n - ( alpha_n + beta_n ) * Inact_n )

# synapses: exponential conductance
g_ex' = -g_ex / tau_syn_ex
Expand Down Expand Up @@ -124,10 +124,10 @@ neuron hh_cond_exp_traub_implicit:
end

# set new input current
I_stim = currents.get_sum()
I_stim = currents

g_ex += spikeExc.get_sum()
g_in += spikeInh.get_sum()
g_ex += spikeExc * 1 nS
g_in += spikeInh * 1 nS
end

end
30 changes: 15 additions & 15 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 + 55. ) ) / ( 1. - exp( -( V_m + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m + 40. ) ) / ( 1. - exp( -( V_m + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m + 35. ) / 10. ) )
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. ) )

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 + 55. ) ) / ( 1. - exp( -( V_m + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m + 65. ) / 80. )
Inact_n' = alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n # n-variable
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

# Act_m
function alpha_m real = ( 0.1 * ( V_m + 40. ) ) / ( 1. - exp( -( V_m + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m + 65. ) / 18. )
Act_m' = alpha_m * ( 1 - Act_m ) - beta_m * Act_m # m-variable
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

# Act_h
function alpha_h real = 0.07 * exp( -( V_m + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m + 35. ) / 10. ) )
Act_h' = alpha_h * ( 1 - Act_h ) - beta_h * Act_h # h-variable
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
end

parameters:
Expand Down
36 changes: 18 additions & 18 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 + 55. ) ) / ( 1. - exp( -( V_m + 55. ) / 10. ) )
function beta_n_init real = 0.125 * exp( -( V_m + 65. ) / 80. )
function alpha_m_init real = ( 0.1 * ( V_m + 40. ) ) / ( 1. - exp( -( V_m + 40. ) / 10. ) )
function beta_m_init real = 4. * exp( -( V_m + 65. ) / 18. )
function alpha_h_init real = 0.07 * exp( -( V_m + 65. ) / 20. )
function beta_h_init real = 1. / ( 1. + exp( -( V_m + 35. ) / 10. ) )
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. ) )

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 + 55. ) ) / ( 1. - exp( -( V_m + 55. ) / 10. ) )
function beta_n real = 0.125 * exp( -( V_m + 65. ) / 80. )
Inact_n' = alpha_n * ( 1 - Inact_n ) - beta_n * Inact_n # n-variable
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

# Act_m
function alpha_m real = ( 0.1 * ( V_m + 40. ) ) / ( 1. - exp( -( V_m + 40. ) / 10. ) )
function beta_m real = 4. * exp( -( V_m + 65. ) / 18. )
Act_m' = alpha_m * ( 1 - Act_m ) - beta_m * Act_m # m-variable
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

# Act_h'
function alpha_h real = 0.07 * exp( -( V_m + 65. ) / 20. )
function beta_h real = 1. / ( 1. + exp( -( V_m + 35. ) / 10. ) )
Act_h' = alpha_h * ( 1 - Act_h ) - beta_h * Act_h # h-variable
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
end

parameters:
Expand Down Expand Up @@ -141,15 +141,15 @@ neuron hh_psc_alpha_implicit:
# sending spikes: crossing 0 mV, pseudo-refractoriness and local maximum...
if r > 0: # is refractory?
r -= 1
elif V_m > 0 and U_old > V_m: # threshold && maximum
elif V_m > 0 mV and U_old > V_m: # threshold && maximum
r = RefractoryCounts
emit_spike()
end

I_stim = currents

I_syn_ex' += spikeExc.get_sum() * PSConInit_E
I_syn_in' += spikeInh.get_sum() * PSConInit_I
I_syn_ex' += spikeExc * PSConInit_E
I_syn_in' += spikeInh * PSConInit_I
end

end
52 changes: 25 additions & 27 deletions models/ht_neuron.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -99,38 +99,36 @@ 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

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]
#############
# Intrinsic currents
#############
# I_T
function m_inf_T real = 1.0 / ( 1.0 + exp( -( V_m + 59.0 ) / 6.2 ) )
function h_inf_T real = 1.0 / ( 1.0 + exp( ( V_m + 83.0 ) / 4 ) )
function tau_m_h real = 1.0 / ( exp( -14.59 - 0.086 * V_m ) + exp( -1.87 + 0.0701 * V_m ) )
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 ) )
# I_KNa
function D_influx_peak real = 0.025
function tau_D real = 1250.0 # yes, 1.25s
function D_thresh real = -10.0
function D_slope real = 5.0
function D_thresh mV = -10.0
function D_slope mV = 5.0
function D_influx real = 1.0 / ( 1.0 + exp( -( V_m - D_thresh ) / D_slope ) )

function I_Na real = -g_NaL * ( V_m - E_Na )
function I_K real = -g_KL * ( V_m - E_K )
function I_Na pA = -g_NaL * ( V_m - E_Na )
function I_K pA = -g_KL * ( V_m - E_K )

Theta' = -( Theta - Theta_eq ) / Tau_theta

# 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 - ( IKNa_D - KNa_D_EQ ) / tau_D

function tau_m_T real = 0.22 / ( exp( -( V_m + 132.0 ) / 16.7 ) + exp( ( V_m + 16.8 ) / 18.2 ) ) + 0.13
function tau_h_T real = 8.2 + ( 56.6 + 0.27 * exp( ( V_m + 115.2 ) / 5.0 ) ) / ( 1.0 + exp( ( V_m + 86.0 ) / 3.2 ) )
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 ) )
function I_h_Vthreshold real = -75.0
function m_inf_h real = 1.0 / ( 1.0 + exp( ( V_m - I_h_Vthreshold ) / 5.5 ) )
IT_m' = ( m_inf_T - IT_m ) / tau_m_T
IT_h' = ( h_inf_T - IT_h ) / tau_h_T
Ih_m' = ( m_inf_h - Ih_m ) / tau_m_h
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

#############
# Synapses
Expand All @@ -139,13 +137,13 @@ neuron ht_neuron_nestml:
g_AMPA' = g_AMPA' - g_AMPA / AMPA_Tau_2

g_NMDA'' = -g_NMDA' / NMDA_Tau_1
g_NMDA' = g_NMDA' - g_NMDA / NMDA_Tau_2
g_NMDA' = g_NMDA' - g_NMDA / NMDA_Tau_2

g_GABAA'' = -g_GABAA' / GABA_A_Tau_1
g_GABAA' = g_GABAA' - g_GABAA / GABA_A_Tau_2
g_GABAA' = g_GABAA' - g_GABAA / GABA_A_Tau_2

g_GABAB'' = -g_GABAB' / GABA_B_Tau_1
g_GABAB' = g_GABAB' - g_GABAB /GABA_B_Tau_2
g_GABAB' = g_GABAB' - g_GABAB /GABA_B_Tau_2
end

parameters:
Expand Down Expand Up @@ -223,10 +221,10 @@ neuron ht_neuron_nestml:
end
r_potassium -= 1

g_AMPA' += AMPAInitialValue * AMPA
g_NMDA' += NMDAInitialValue * NMDA
g_GABAA' += GABA_AInitialValue * GABA_A
g_GABAB' += GABA_BInitialValue * GABA_B
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]

if (not g_spike) and V_m >= Theta:
# Set V and Theta to the sodium reversal potential.
Expand All @@ -247,7 +245,7 @@ neuron ht_neuron_nestml:
emit_spike()
end

I_stim = currents.get_sum()
I_stim = currents
end

function compute_synapse_constant(Tau_1 ms, Tau_2 ms, g_peak real) real:
Expand All @@ -256,9 +254,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 )
exact_integration_adjustment real = ( ( 1 / Tau_2 ) - ( 1 / Tau_1 ) ) * 1 ms

t_peak real = ( Tau_2 * Tau_1 ) * log( Tau_2 / Tau_1 ) / ( Tau_2 - Tau_1 )
t_peak real = ( Tau_2 * Tau_1 ) * log( Tau_2 / Tau_1 ) / ( Tau_2 - Tau_1 ) / 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 279c571

Please sign in to comment.