torchdiffeq icon indicating copy to clipboard operation
torchdiffeq copied to clipboard

Perform one integration step

Open JackCaster opened this issue 11 months ago • 2 comments

I am looking forward to using some of the solvers in this repo. Thank you for your work!

I am porting a code from Scipy to Pytorch. I have an ODE with time-varying coefficients so I cannot solve the equation in one go, but I'd need to perform a step-by-step integration. In Scipy, I am using the RK45's step method. Is there something equivalent in torchdiffeq I could use?

JackCaster avatar Mar 10 '24 12:03 JackCaster

The current API isn't designed with this mind unfortunately. The only way to implement it is to use the internal functions. The equivalent to the step method is the _advance method: https://github.com/rtqichen/torchdiffeq/blob/master/torchdiffeq/_impl/solvers.py#L34.

rtqichen avatar Mar 12 '24 02:03 rtqichen