SciML / OrdinaryDiffEq.jl

High performance ordinary differential equation (ODE) and differential-algebraic equation (DAE) solvers, including neural ordinary differential equations (neural ODEs) and scientific machine learning (SciML)
https://diffeq.sciml.ai/latest/
Other
521 stars 198 forks source link

added method ROK4a #2260

Closed cwittens closed 5 days ago

cwittens commented 1 week ago

Checklist

Additional context

added method ROK4a from Rosenbrock--Krylov Methods for Large Systems of Differential Equations I dont think OrdinaryDiffEq currently utilizes Krylov Solvers for solving the Jacobian, but I need the _transformtab(Alpha,Gamma,B,Bhat) in function ROK4aTableau() for a different project, so I thought I might as well implement the method, if I already added the Tableau.

ChrisRackauckas commented 1 week ago

I dont think OrdinaryDiffEq currently utilizes Krylov Solvers for solving the Jacobian

That's a choice. Just change linsolve = KrylovJL_GMRES() and it'll use a Krylov method. The tableau and the way the linear equations are solved are not 1-1.

cwittens commented 1 week ago

Ohh I didn't know that. What do you mean with The tableau and the way the linear equations are solved are not 1-1. ?

ChrisRackauckas commented 1 week ago

Every tableau can be used with every linear solver, and every linear solver can be used with every tableau.

ChrisRackauckas commented 6 days ago

What's the next steps here?

cwittens commented 6 days ago

are the failed checks from this method? I thought they were general. Otherwise I will try and look for a fix.

The "different project" I was talking about is something in Fortran where I needed the coefficients in the a,C,b,btilde,d,cformat and not Alpha,Gamma,B,Bhat as given in the paper, which is why I used _transformtab(Alpha,Gamma,B,Bhat). And after already implementing the Alpha,Gamma,B,Bhat coefficients, i thought I made as well add this as a new method, but I didnt plan to do more with it in julia/ordinarydiffeq.

ChrisRackauckas commented 5 days ago

The failed checks were from the method, but it was just a typo so I handled it.

Thanks! Did you benchmark it on a few problems to see how it works in practice?

cwittens commented 2 days ago

Thanks. Nop, I only checked if it works but did not benchmark it in any way.