patrick-kidger / diffrax

Numerical differential equation solvers in JAX. Autodifferentiable and GPU-capable. https://docs.kidger.site/diffrax/
Apache License 2.0
1.46k stars 133 forks source link

Coupled ODEs implementation #119

Closed thibmonsel closed 2 years ago

thibmonsel commented 2 years ago

Hi Patrick,

I want to implement a coupled ODE of the sort :

dx/dt = f(x) + y  
dy/dt = g(y)

I was wondering if it were the same without bigging deeper in the code of Multiterm and ODETerm :

Thanks again for the library :)

patrick-kidger commented 2 years ago

Hey there. Creating a single F is the correct/simplest way to go.

(MultiTerm is used to express e.g. both the drift and diffusion in an SDE; you never need it when working with ODEs. You could use it here if you really wanted to... but it'd make life more difficult for no reason!)

thibmonsel commented 2 years ago

Thanks for clearing that up !