patrick-kidger / patrick-kidger/diffrax
Creating Support for Delay Differential Equations
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 189
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 1
Description
Hey all!
I am Praneeth Merugu, an undergraduate at Georgia State, and I have been using diffrax for quite awhile. I have noticed that adding support for delay differential equations is relatively low hanging fruit given the awesome tools Patrick has made. I recently had the curiosity and researched how current literature handles them, as well as delaydiffeq.jl. From my research, it seems as though we have 3 issues:
- Function History - Because DDEs reference previous function values and their derivatives, my implementation preserves the dense output of the solver at each step. This means that the solver that is being wrapped will preserve its order during the delay
- Discontinuities in the delay - Since discontinuities are a major source of error within DDE solvers, much of the difficulty lies here. To ensure that we preserve the order of our solver, we have to make sure our solver doesnt overshoot a discontinuity, but rather solves exactly at that value. By setting up a optimization problem within a step size controller, we were able to acheive discontinuity tracking for variable delay diff eqs.
- Memory Management - Since Jax hates reallocating memory (tracer errors :( ), I employed solve functions that either manage a circular buffer of dense histories, or splits the solve into a jax.lax.scan where it is solved in chunks.
I would love to work on this further and eventually make a contribution of some sorts. All feedback is welcome.
https://github.com/PraneethMerugu/diffraxdde
Thanks!
Praneeth Merugu
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no diffrax files, tests, or entry points and links to the external diffraxdde project. Start by reviewing that project alongside diffrax's existing solver APIs. The completion criteria and contribution scope are not defined, so those should be agreed before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100