-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from DimitriPlotnikov/master
Update models which are used in the NESTML tutorial
- Loading branch information
Showing
7 changed files
with
151 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
src/main/resources/org/nest/nestml/function/MemberInitialization.ftl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
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_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 | ||
|
||
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 | ||
|
||
internal: | ||
tau_syn_in ms = 2ms | ||
PSConInit_I real = 1.0 * e / tau_syn_in | ||
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 | ||
g_in' += PSConInit_I*spikes.get_sum() | ||
end | ||
|
||
|
||
end |