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 a2211a0 commit 5ec5e25
Show file tree
Hide file tree
Showing 5 changed files with 125 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
/*
A straight forward implementation of the RC circuit approach
*/
neuron iaf:
neuron rc_neuron:

state:
V_abs mV = 0mV
alias V_m mV = V_abs - E_L
I_syn pA = 0pA
end

equations:
Expand All @@ -17,6 +15,7 @@ neuron iaf:
E_L mV = -65mV
C_m pF = 250pF
tau_m ms = 10ms
I_syn pA = 10pA
end

input:
Expand All @@ -27,7 +26,6 @@ neuron iaf:

update:
integrate(V_abs)
I_syn = spikes.get_sum()
end

end
32 changes: 32 additions & 0 deletions src/test/resources/tutorial/12.rc_neuron_rel.nestml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
A straight forward implementation of the RC circuit approach
*/
neuron rc_neuron_rel:

state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L
end

equations:
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
end

input:
spikes <- spike
end

output: spike

update:
integrate(V_abs)
end

end
37 changes: 37 additions & 0 deletions src/test/resources/tutorial/21_rc_fire.nestml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
A straight forward implementation of the RC circuit approach.
Extends the integrate method with a threshold and fire behaviour.
*/
neuron rc_fire:

state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L

end

equations:
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 = 0pA
alias V_th mV = -55mV - E_L
alias V_reset mV = -65mV - E_L
end

input:
spikes <- spike
end

output: spike

update:
integrate(V_abs)

end

end
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
A straight forward implementation of the RC circuit approach.
Extends the integrate method with a threshold and fire behaviour.
*/
neuron iaf_reset:
neuron rc_refractory:

state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L
I_syn pA = 0pA
end

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

parameter:
E_L mV = -65mV
E_L mV = -70mV
C_m pF = 250pF
tau_m ms = 10ms
alias V_th mV = 55mV + E_L
alias V_reset mV = 10mV + E_L
I_syn pA = 10pA
alias V_th mV = -55mV - E_L
alias V_reset mV = -65mV - E_L
end

input:
Expand All @@ -32,8 +32,9 @@ neuron iaf_reset:
integrate(V_abs)
if V_abs > V_th:
V_abs = V_reset
emit_spike()
end
I_syn = spikes.get_sum()
end


end
47 changes: 47 additions & 0 deletions src/test/resources/tutorial/23_rc_alpha.nestml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
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:

state:
V_abs mV = 0mV
alias V_m mV = V_abs + E_L
end

equations:
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
refractory_counts integer = 0
end

input:
spikes <- spike
end

output: spike

update:
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


end

0 comments on commit 5ec5e25

Please sign in to comment.