nest / nestml

A domain specific language for neuron and synapse models in spiking neural network simulation
GNU General Public License v2.0
45 stars 46 forks source link

Fix scaling for delta pulses #1013

Open clinssen opened 4 months ago

clinssen commented 4 months ago

When a spiking input port is written directly into the model, for instance:

equations:
    x' = -x / tau + spikes

input:
    spikes <- spike

then spikes is assumed to be a (piecewise) constant by ODE-toolbox, which means it generates code that involves a factor of Δt (the simulation resolution):

x(t + Δt) = x(t) + spikes * Δt

However, if spikes is not a (piecewise) constant value, but a Dirac delta function, the factor Δt should not be inserted.

This issue does not occur if the numerical solver is used, or if the delta appears inside a convolve() call inside the ODE.

See also #993.