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.
When a spiking input port is written directly into the model, for instance:
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):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.