You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running a pretty simple model and found what I think must be numerical errors in the integrator. Just wondering if the developers have any suggestions about how to avoid it.
Running the following code gives a result of -70 for the entire simulation, as it should.
Increasing nseg to 3 causes the voltage to drift to 0. Using fwd_euler prevents this for nseg=3. (Although my understanding is that bwd_euler should generally be preferred over fwd_euler.) Decreasing delta_t and using bwd_euler or CN improves the situation, but there is still some error. Generally increasing nseg (with the default solver and delta_t) reduces the error (e.g. solution is perfect for nseg=4, better but not great for nseg=5,6,7 and back to no error for nseg=13 or 20.
I'm somewhat familiar with numerical methods for solving PDEs, so I'm guessing there is some spatial-temporal tradeoff going on. What is somewhat surprising is how nseg=2 or 4 seem to be outliers here.
Any general guidelines for choosing a default nseg value (assuming a user uses default delta_t and solver) would be appreciated! (Seems like the answer is use nseg=2, but any other guidance would be welcome!)
The text was updated successfully, but these errors were encountered:
I should have done this before but forgot, so will do the following now: 1) change the default to jaxley.thomas and 2) raise a NotImplementedError for nseg=3,5,6,7,9,...
I'm running a pretty simple model and found what I think must be numerical errors in the integrator. Just wondering if the developers have any suggestions about how to avoid it.
Running the following code gives a result of -70 for the entire simulation, as it should.
Increasing
nseg
to 3 causes the voltage to drift to 0. Usingfwd_euler
prevents this fornseg=3
. (Although my understanding is that bwd_euler should generally be preferred over fwd_euler.) Decreasingdelta_t
and usingbwd_euler
or CN improves the situation, but there is still some error. Generally increasingnseg
(with the default solver anddelta_t
) reduces the error (e.g. solution is perfect fornseg=4
, better but not great for nseg=5,6,7 and back to no error for nseg=13 or 20.I'm somewhat familiar with numerical methods for solving PDEs, so I'm guessing there is some spatial-temporal tradeoff going on. What is somewhat surprising is how nseg=2 or 4 seem to be outliers here.
Any general guidelines for choosing a default nseg value (assuming a user uses default delta_t and solver) would be appreciated! (Seems like the answer is use nseg=2, but any other guidance would be welcome!)
The text was updated successfully, but these errors were encountered: