-
Notifications
You must be signed in to change notification settings - Fork 21
Description
When using 4 or 9 parameter IZ models with Forward Euler, the calculations utilize v_next instead of v.
CARLsim6/carlsim/kernel/src/snn_cpu_module.cpp
Lines 2179 to 2186 in d527c55
| if (!groupConfigs[netId][lGrpId].withParamModel_9) | |
| { | |
| u += dudtIzhikevich4(v_next, u, a, b, timeStep); | |
| } | |
| else | |
| { | |
| u += dudtIzhikevich9(v_next, u, vr, a, b, timeStep); | |
| } |
and the same is used in the GPU module
CARLsim6/carlsim/kernel/src/gpu_module/snn_gpu_module.cu
Lines 2006 to 2013 in d527c55
| if (!groupConfigsGPU[grpId].withParamModel_9) | |
| { | |
| u += dudtIzhikevich4(v_next, u, a, b, timeStep); | |
| } | |
| else | |
| { | |
| u += dudtIzhikevich9(v_next, u, vr, a, b, timeStep); | |
| } |
Unless there is something I don't understand, there is no reason to use v_next and instead v should be used like the other methods (such as RK4)
CARLsim6/carlsim/kernel/src/snn_cpu_module.cpp
Lines 2194 to 2195 in d527c55
| float k1 = dvdtIzhikevich4(v, u, totalCurrent, timeStep); | |
| float l1 = dudtIzhikevich4(v, u, a, b, timeStep); |
This seems like a fundamental error in how voltage and the recovery variable would be calculated with forward euler.
I know that typically RK4 is used for simulations, but I am trying to mirror CARLsim simulations in another simulator to have side by side comparisons, and found this bug in trying to recreate a simple simulation.