-
-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
casadi safe mode #853
Comments
Those all sound sensible, would lean towards 1 and 2 as hard to say what "sensible" chunks would be. For a battery model you could also get an estimate to t_eval by looking at c_n_init, c_p_init and integral(I), but that doesn't generalize ... |
rtimms
added a commit
that referenced
this issue
Apr 3, 2020
rtimms
added a commit
that referenced
this issue
Apr 15, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The solution time when using casadi "safe" mode depends on the number of values in
t_eval
. For exampletakes around 1.6s but
only takes 0.2 s.
The current way safe mode is implemented is to integrate over each
dt
int_eval
. If there are lots of points int_eval
the result in the solver restarting a lot, which is slow.There are some alternatives, each of which has pros and cons (here
t_eval = [t0, t1, ... tf]
):SolverError
s e.g. if concentration goes negativet0
totf
(outputting at all the points int_eval
): If success then truncate as above, if fail then try to integrate fromt0
totf/2
(again outputting at all points int_eval
that fall in this range). Then repeat, halving the window you are integrating over until the solver finishes successfully. If the event is near the start then this may lead you to unnecessarily integrate for longer than you need to.I think for most use cases all of those are reasonable. Does anyone have any input as to why one may be better than the other, or have other suggestions for tackling events in casadi?
The text was updated successfully, but these errors were encountered: