Skip to content

Commit

Permalink
Update models which are used in the NESTML tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriPlotnikov committed Sep 15, 2016
1 parent 5ec5e25 commit a010a2e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
9 changes: 6 additions & 3 deletions src/test/resources/tutorial/21_rc_fire.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ neuron rc_fire:
state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L

end

equations:
Expand All @@ -18,7 +17,7 @@ neuron rc_fire:
E_L mV = -70mV
C_m pF = 250pF
tau_m ms = 10ms
I_syn pA = 0pA
I_syn pA = 10pA
alias V_th mV = -55mV - E_L
alias V_reset mV = -65mV - E_L
end
Expand All @@ -31,7 +30,11 @@ neuron rc_fire:

update:
integrate(V_abs)

if V_abs > V_th:
V_abs = V_reset
emit_spike()
end
end


end
19 changes: 13 additions & 6 deletions src/test/resources/tutorial/22_rc_refractory.nestml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
A straight forward implementation of the RC circuit approach.
Extends the integrate method with a threshold and fire behaviour.
Extends firing model with an additional refractory state. It is entered directly after a spike is fired.
*/
neuron rc_refractory:

Expand All @@ -10,7 +10,7 @@ neuron rc_refractory:
end

equations:
V_abs' = -1/tau_m * V_abs + 1/C_m*I_syn
V_abs' = -1/tau_m * V_abs + 1/C_m*I_syn
end

parameter:
Expand All @@ -20,6 +20,8 @@ neuron rc_refractory:
I_syn pA = 10pA
alias V_th mV = -55mV - E_L
alias V_reset mV = -65mV - E_L
refractory_timeout ms = 5ms
refractory_counts integer = 0
end

input:
Expand All @@ -29,10 +31,15 @@ neuron rc_refractory:
output: spike

update:
integrate(V_abs)
if V_abs > V_th:
V_abs = V_reset
emit_spike()
if refractory_counts == 0:
integrate(V_abs)
if V_abs > V_th:
V_abs = V_reset
emit_spike()
refractory_counts = steps(refractory_timeout)
end
else:
refractory_counts -= 1
end
end

Expand Down
15 changes: 13 additions & 2 deletions src/test/resources/tutorial/23_rc_alpha.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@
A straight forward implementation of the RC circuit approach.
Extends firing model with an additional refractory state. It is entered directly after a spike is fired.
*/
neuron rc_refractory:
neuron rc_alpha:

state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L
g_in pA = 0pA # inputs from the inh conductance
end

equations:
# alpha function for the g_in
g_in'' = -g_in'/tau_syn_in
g_in' = g_in' - g_in/tau_syn_in
I_syn pA = g_in
V_abs' = -1/tau_m * V_abs + 1/C_m*I_syn
end

parameter:
E_L mV = -70mV
C_m pF = 250pF
tau_m ms = 10ms
I_syn pA = 10pA

alias V_th mV = -55mV - E_L
alias V_reset mV = -65mV - E_L
refractory_timeout ms = 5ms
Expand All @@ -28,6 +33,11 @@ neuron rc_refractory:
spikes <- spike
end

internal:
tau_syn_in ms = 2ms
PSConInit_I real = 1.0 * e / tau_syn_in
end

output: spike

update:
Expand All @@ -41,6 +51,7 @@ neuron rc_refractory:
else:
refractory_counts -= 1
end
g_in' += PSConInit_I*spikes.get_sum()
end


Expand Down

0 comments on commit a010a2e

Please sign in to comment.