Dear Charl,Thank you very much for this relevant answer.I was trying to reproduce with NESTML the model from this paper: Zhang, Yan-Feng, et al. "An axonal brake on striatal dopamine output by cholinergic interneurons." Nature Neuroscience 28.4 (2025): 783-794.". Though, I am starting to think that approximating their model with an alpha kernel, without any need for an heaviside function, may be a better option in my case.Thank you very much,Kind regards,Jeanne BarthelemyFrom: Charl Linssen <nest-users@turingbirds.com>
Sent: Monday, March 2, 2026 11:47 PM
To: users@nest-simulator.org <users@nest-simulator.org>
Subject: [NEST Users] Re: Heaviside function in a Kernel?Dear Jeanne,Thank you for writing in and thank you for this interesting question. I'm sorry that the advanced kernel shape you need is not supported by the numerical backend. The central issue with this kernel is that it cannot be described by a linear and time-invariant system. As such it makes adding contributions from different spikes much harder, because you cannot simply add the effects of different spikes together (something that only makes sense mathematically for LTI systems).Actually, there are two components that make this a tricky kernel to work with: the factor t^2 as well as the Heaviside function. May I ask how you obtained the shape and parameters of this kernel? Would it be possible to replace it with an LTI kernel like the “alpha” or “beta” function? (You can have a look at the neuron models in NESTML for a definition of both.)As for the Heaviside function: I tried to think of an approach to implement this behaviour. One thing you could do is to create an additional buffer in the model that corresponds to the 200 ms time interval. When a spike comes in (let's say at time t_sp), it would then not only trigger the kernel response (ignoring the Heaviside term), but also add an entry to the buffer, so that 200 ms later, a negative contribution would be added to the state, cancelling out the value at that time to reset the value back to zero. The magnitude of this negative contribution would be of equal magnitude to the kernel at time t_sp + 200 ms, but with an opposite sign, so that it cancels out. I believe this would work well, even with multiple spikes arriving all the time.If you can confirm that you are interested in making an implementation of this, I would be happy to look at it together.Much obliged,CharlOn Fri, Feb 27, 2026, at 10:20, Jeanne Barthelemy wrote:Dear all,This is a question about best practices for NESTML. I would like to build in the equations block a Kernel, such as for instance:"kernel inh_time_end = ((-0.00002*t*t)/(pow(tau,2.0)) + 0.0087*t/tau + 0.006)/tau", but modulated by the heaviside function H depending on 200 - t (i.e., H(200.0 ms -t)). To sum up, I would like to get the following kernel:"kernel inh_time_end_modulated = H(200.0 ms -t)*((-0.00002*t*t)/(pow(tau,2.0)) + 0.0087*t/tau + 0.006)/tau"There does not appear to be a direct implementation of the heaviside function H in nestml. I tried to build my own function to convert booleans to 1.0 or 0.0 in my NestML model, upon the condition "200.0 ms > t", and use that instead of the heaviside, but the model is really slow to build on my laptop. I tried other versions with if conditions in the update block, or ternary operators, but they all led to bugs. So, I am unsure of the correct practice to implement an heaviside-modulated polynomial kernel. If anyone has a good and fast solution to propose I would be very happy to learn about it !Thank you very much,Kind regards,Jeanne BARTHELEMY_______________________________________________NEST Users mailing list -- users@nest-simulator.orgTo unsubscribe send an email to users-leave@nest-simulator.org
CAUTION: This email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
_______________________________________________NEST Users mailing list -- users@nest-simulator.orgTo unsubscribe send an email to users-leave@nest-simulator.org