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 am working on a problem where I want to propagate a trajectory using diffrax, use a discrete terminating event to end that trajectory, and then get the derivative of that final time with respect to a variable. Regardless of the problems I have tried to do this on, the gradient of the final time always ends up as zero. Below is an example where I model the simplified dynamics of a cannonball and I try to evaluate the gradient of the final time with respect to the coefficient of drag.
So this is because you have a "discrete" terminating event -- the event halts at the end of the step in which the event was triggered. As that's a discrete thing then there (correctly) is no gradient.
You may like to try #387, which is a more featureful approach to events. In particular this includes the ability to (a) have an event return a real number, for which the solve terminates where that number is zero, and (b) have that exact location determined using a root find.
Tagging @cholberg for visibility, but I believe that should give you gradients.
Hello!
I am working on a problem where I want to propagate a trajectory using
diffrax
, use a discrete terminating event to end that trajectory, and then get the derivative of that final time with respect to a variable. Regardless of the problems I have tried to do this on, the gradient of the final time always ends up as zero. Below is an example where I model the simplified dynamics of a cannonball and I try to evaluate the gradient of the final time with respect to the coefficient of drag.Is there a correct/better way to do this? Thanks in advance!
The text was updated successfully, but these errors were encountered: