Hi Wilhelm,
if you want these functions of time to overlap (e.g. to define synaptic
currents where a new spike can arrive before the current from the
previous spike is back to zero), then there is unfortunately no good
solution at the moment (we started some discussion about this topic in
https://github.com/brian-team/brian2/issues/1170). The only solution
would be to manually write a function in the target language or to use a
network_operation.
However, if the events are discrete in the sense that there is only one
function (per neuron) "replayed" at a time, then you should be able to
use a TimedArray for that purpose:
current = TimedArray(...)
eqs = '''
dv/dt = ... + I ... : volt
I = current(t - trigger_time) : amp
trigger_time : second
'''
And then have some event (e.g. the reset or the on_pre of a Synapses
object) set "trigger_time = t".
This assumes that the last entry of the array in "current" is 0 (because
when t-trigger_time exceeds the length of the array, the last value will
be used). You'd also have to set the trigger_time to some value like
-1000*second to avoid to have an event triggered in the very beginning.
Hope that helps, best
Marcel