Closed lahramon closed 10 months ago
Looking into the code, I found that switching the two lines here (and using t=t with the updated time as for the correction time) would solve the issue. What do you think?
Sounds like you found an error in the source. Good catch!
How do you feel about a quick pull request? Your proposed solution sounds good :+1:
Okay, I'll try!
I released a new version. Your changes should be available with pip install --upgrade probdiffeq
now.
Thanks a lot for your quick action!
Hi,
related to issure #676, I have been trying to use the library for non-smooth vector fields. As a test, I used the vector field
$$ \dot{x}(t) = \begin{cases} 1, > \text{if $t < t{N/2}$} \ -1, > \text{if $t \geq t{N/2}$} \ \end{cases} $$
and got the following solution (you can disregard the orange lines):
While it was clear that integrating the non-differentiable vector field would lead to integration errors, I wondered about the time step at which the solution is updated for the first time with the new vector field observation (this would also be relevant for smooth, time-varying vector fields I guess). My expectation would have been that the jump in the gradient takes place at $t = N/2$; however, the gradient is updated only at $t = N/2 +1$. Here is what I would have expected to see (generated with my vanilla, non-optimized PN solver implementation):
Looking into the code, I found that switching the two lines here (and using
t=t
with the updated time as for the correction time) would solve the issue. What do you think?Here is the code to reproduce the figure:
Thanks, your insight would be much appreciated!