Skip to content
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

Derivative continuity choices #344

Open
ChrisRackauckas opened this issue Oct 11, 2024 · 1 comment
Open

Derivative continuity choices #344

ChrisRackauckas opened this issue Oct 11, 2024 · 1 comment

Comments

@ChrisRackauckas
Copy link
Member

There are many interpolations with a discontinuous derivative. Right now, ConstantInterpolation returns a NaN at the node points. That ends up being really bad behavior for many solver contexts because that NaN can be hard to recover from. Instead, it would be good to choose a directional derivative.

For the purpose of use in solvers, it almost always makes sense to use the right derivative. This is because solvers are trying [t, t+dt] moving from left to right, so if the derivative at the start is different, you get a jump the solver cannot handle. So normally it's this derivative. But it would be good to allow the choice. In DifferentialEquations this is handled via continuity = :right with a choice of :left. It would be good to add this argument to derivative.

@sathvikbhagavan
Copy link
Member

Makes sense. I will work on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants