nest / nestml

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

Handling adaptive LIF model #489

Closed OlegFS closed 4 years ago

OlegFS commented 5 years ago

I come across a bug in generating an adaptive LIF model with delta synapses (see NESML file attached). The neuron model I am trying to get is a simplified version of adEx. V = -V/tau_m + 1/C_m * (I_spikes+ I_e + currents - w) w' = -w/tau_w where w is increased by b after each spike.

In the cpp file, NESTML outputs lines of code that initialize GSL integration. Yet, in the update step, there is an attempt to solve the equations analytically ignoring w. Also, NESTML substitutes b with ones.

I use NESTML v.3, commit a41eb31849b107b5dafa51fe1d1408791bbc25b7

We went through the code with @Silmathoron and he confirms that it's a bug. adapt_lif.txt

clinssen commented 5 years ago

Hi, thanks for reporting the bug! Some of these issues are solved by the PR #482. Could you try to merge the corresponding branch (clinssen:names-ref-conversion-fix) and check whether it indeed fixes your issues?

OlegFS commented 5 years ago

Thanks for your reply, @clinssen! It does fix the issue of substituting the variable b with zeros, but the main problem with integration is still there.

clinssen commented 5 years ago

I apologise for the issue; it lies at the intersection between NESTML and ode-toolbox, the latter of which is undergoing major revisions at this time to address exactly this type of issue. We plan to have this completed within the span of a few weeks. Meanwhile, there does not seem to be a simple workaround. Would it be an option for you to (temporarily) use exponential postsynaptic kernels instead of the delta function? (Possibly with a very short time constant?)

In addition I filed #492; if you have any comments please feel invited to share them.

Silmathoron commented 5 years ago

This issue is currently associated to a bug in the way the delta function is handled by NESTML. This requires an enhanced ODEtoolbox to deal with it properly.

The other part of the issue is associated to #481 and should soon be fixed for GSL also (see #495)