-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Handling discontinuities in time derivative? #58
Comments
This feels related to #13 but I cannot judge if this is precisely the same problem. |
No worries, glad you like it. As long as the time points (t1, ..., tn) are known in advance then this is is possible. Set (Note that FWIW #13 is about handling the case in which the (t1, ..., tn) are not known until during the solve, because they depend on the evolving state somehow. |
Thanks for the clarification! Makes total sense now that you would need event handling for #13. Luckily, since it's an external control, I know the time points in advance and can readily use your solution. If I may, I'd like to take the opportunity to ask for one more clarification. The reason why I'm asking is that in my case with external forcing, I'd expect the steps to depend on the external inputs as they heavily affect the dynamics. If the steps taken are the same for all entries in the batch, I'd expect that I might run into performance issues w/ batching. |
The steps are not the same for all batch elements; they're determined independently. So you should be all right! |
Great! Then I'm even more excited! :) Thanks for the prompt clarifications and congratulations for the great work! |
Hi,
|
Just for completeness, this happens with diffrax 0.0.6 |
And one last remark: I encountered similar issues in DiffEqFlux.jl when specifying discontinuities in float32 accuracy and had to make sure I used float64. Don't know if it's the same root cause here. |
This should be fixed in #89. This was a relatively subtle bug in how The correct behaviour is to move forward two ulps after a jump -- so that the next step starts just after the jump! Running your code with and without specifying By the way, specifying |
Thanks a lot for the swift response and fix and the explanation of the semantics of
because |
Right, this was a separate issue that I've fixed along the way. |
Cool, I will check it on my original problem as well once the changes have been merged into master and report back if I encounter any further problems. Again, thanks for the great support! |
Hi,
first of all, let me say that this looks like an amazing project.
I am looking forward to playing around with this :).
In a concrete problem I am dealing with, I have a forced system where the external force is piecewise constant. The external force changes at specific time points (t1, ..., tn), causing a discontinuity of the time derivative.
I would like to use adaptive step-size solvers for increased accuracy, but naively applying adaptive step-size solvers will "waste" a lot of steps to find the point of change.
Would including the change points in SaveAt avoid this problem?
Or is there some other recommended way to handle this?
The text was updated successfully, but these errors were encountered: