Compilation issue with numerical methods other that explicit Euler

29 views
Skip to first unread message

michel B

unread,
Nov 22, 2017, 11:18:07 AM11/22/17
to ANNarchy
Dear ANNarchy group,

Thanks (again) for this great tool!
I was trying to evaluate different numerical methods for solving the ODEs, and it turned out that I cannot run my codes with anything else than explicit Euler.
I get either with setup(method='implicit')


ANNarchyException: Can not analyse tau * dv/dt = -v + Vleak -1/gleak * tau*(JgabaE*g_gaba+JampaE*g_ampa+JampaExtE*g_ampaExt)


Or with setup(method='midpoint')

ks[name] = Global.config['precision'] + ' _k_' + name + ' = ' + ccode(evaluation[0]) + ';'


IndexError: list index out of range


For the first error I could not find information on how differential equations should be written to be Parsed correctly for a particular method (besides the general rules provided in the documentation), do you think the issue is related to that?

For the second error, it seems some setup variables are undefined by default, are there more details on which variables to setup for a given method?


I get this issue with both rate and spiking models.


Many thanks,

Michel

Julien Vitay

unread,
Nov 26, 2017, 4:57:20 PM11/26/17
to ANNarchy
Hi Michel,

sorry for the delay. Turns out these were two different problems:

  1. The implicit method was broken. I have no idea since when, but it must be a while.... Anyway, I would recommend against using the implicit method, as it currently only works for linear ODEs, in which case exponential is superior (when using a single equation) or midpoint.
  2. The problem with midpoint came from specifying the method in setup(), not for each equation after a colon (which is why my tests did not catch this error). Implicit equations (in your case resetting g_gaba etc to 0 after each step) was assigned the midpoint method, which does not make sense as it is not an ODE... 
This is now fixed in the git repo, and will be used in 4.6.5.

Can you test again to see if it fixes your problem?

By the way, as these were real bugs and not doubts about usage, you could use the Bitbucket Issues forum for that: https://bitbucket.org/annarchy/annarchy/issues It does not change much, but at least we can keep track of which issues are still open or not.

Best regards
Julien

michel B

unread,
Nov 30, 2017, 12:46:43 PM11/30/17
to ANNarchy
Many thanks Julien for the quick and efficient fix. Sorry I could not look into this earlier. It compiled directly for the midpoint method after a pull request. I did not check the implicit method yet as my equations are non-linear. I created a resolved issue for midpoint.
Best,
Michel
Reply all
Reply to author
Forward
0 new messages