I am getting the error mentioned in the title when running my simulation of a custom Hodgkin-Huxley network.
The simulation files are not attached due to size restrictions and dependencies with outside files. I can provide snippets of code (i.e. the equations module and the group declarations below).
The code is complex and has multiple dependencies to other files, i.e. neuron positions from numpy saved arrays and configuration files. It also depends on initial states and network configurations. I apologize in advance for what follows, as I have attached my code in the following file: brian2_error.zip.py (615.3 KB)
NOTE: I was not allowed to upload .zip files so I renamed it to .py. To extract you will have to remove the .py extension and treat it as a normal zipped file.
I believe the error lies in the differential equations (i.e. HH_equations.py) for the inhibitory neurons (
inh_eqs). However, in case you would like to run the model itself, the full code is provided.
- Replaced the
exprel(), as per Marcel’s suggestion in an older post.
- Monitored the values
hin the faulty group (EC_inh group); the
mvalue jumps to negative at the end of the simulation provided for neuron #313 (accessed through
- Tried reducing the integration time step to 0.01ms and running the simulation with the RK4 integration method instead the exponential Euler, as per Marcel’s suggestion in older posts. Didn’t solve the issue.
- I replaced in my equations all integer divisions with floating point divisions (explicitly). This removes the warnings that brian2 provides when encountering an integer division, but produces the ZeroDivisionError. Don’t know if it is relevant.
Also, I read the topics below:
These seemed very relevant, so I followed them but with no success. I rewrote my equations (paying attention to the signs), lowered the time step, changed my
exprel(), but still get the errors.
Division by Zero of a single neuron, caused by its
m value going negative over a single timestep.
You will find attached the corresponding log file. Not for the faint of heart. I followed the trace myself but I couldn’t pinpoint the error. It looks like an integration method error, yet it doesn’t go away when I test other integration methods.
brian_debug_q7mz5oe4.log (3.0 MB)
Apologies for the long post. I tried to be as thorough as possible, but if you feel as if something is missing, I will gladly provide more information.
Thank you all in advance.