patrick-kidger / patrick-kidger/diffrax
Making a simulation simulatneously on 2 different solvers
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 189
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 1
Description
Hi,
First, thanks to those developing this library that is useful to my work.
I want to compute an ODETerm running on two different solvers simultaneously. Is it possible ?
Let me explain myself:
I have a
class State(eqx.Module):
y: Array
error: Array
where I would like to compute y along a Tsit5 solver and error along a Euler one for instance.
(I don't need a large precision over the error for the resolution, and a structure preserving schema, so running it on euler why running the y on Tsit5 would make sense)
Why not running them separately ?
Because the error is itended to be an posteriori estimates of the error made by the truncation in space for y (which theoreticaly lives in an infinite dimensional space, but has to be truncated to a finite one to be computed, which induces an approximation).
If 'error' estimates that the truncature is poor at a moment t of the simulation, it goes out of diffrax via a DiscreteTerminatingEvent, widen the truncature for y, and return to diffrax at this t.
I have $\frac{d(error)}{dt}=f(y)$" with f being a non trivial function. Thus I cannot run those things separately.
Is there a way to do such a thing ?
I hope i'm clear enough. Don't hesitate to tell if it's not the case.
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 files, tests, or entry points. Start by reviewing Diffrax's solver, term, state, and DiscreteTerminatingEvent APIs to determine whether one coupled state can advance its components with different solvers. Done would require a clearly supported approach for the coupled y/error simulation, with its behavior and limitations documented.
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
- Mostly clear
- Newbie friendliness
- 25/100