Skip to content

Commit

Permalink
add timestep() predefined function akin to resolution()
Browse files Browse the repository at this point in the history
  • Loading branch information
C.A.P. Linssen committed Sep 22, 2024
1 parent cf0363f commit 2d5e24d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/neurons/aeif_cond_exp_neuron.nestml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ model aeif_cond_exp_neuron:
# neuron not refractory
integrate_odes(w, V_m)

onCondition(V_m >= V_th and refr_t <= 0 ms):
onCondition(V_m >= V_peak and refr_t <= 0 ms):
# threshold crossing
refr_t = refr_T # start of the refractory period
V_m = V_reset # clamp potential
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,20 @@ class TestSimulator:
for neuron_id, neuron_log in simulator.log.items():
if neuron_id == "t":
continue

if len(neuron_log) == 0:
continue

fig, ax = plt.subplots(nrows=len(neuron_log))
for i, (var_name, values) in enumerate(neuron_log.items()):
for i, (var_name, values) in sorted(enumerate(neuron_log.items())):
ax[i].plot(simulator.log["t"], values, label="Neuron " + str(neuron_id) + ": " + str(var_name))
ax[i].legend()
ax[i].set_xlim(0, t_stop)
ax[i].grid(True)
#plt.show()
if i < len(neuron_log.items()) - 1:
ax[i].set_xticklabels([])

ax[-1].set_xlabel("Time [ms]")
fig.savefig("/tmp/test_python_standalone_simulation_[neuron=" + simulator.neurons[neuron_id].get_model() + "].png")

return neuron_log

0 comments on commit 2d5e24d

Please sign in to comment.