Comparison between SageMath ODE solvers and Scipy ODE solvers
I'm pretty new to SageMath and I'm currently trying to work on solving geodesic equations in well-defined spacetime manifolds. I found the documentation of SageMath pretty extensive and broad and it gave me a lot of confidence in the software. But I'm still hesitating to use Sage ODE solvers because I know the capabilities of RK45
from scipy.integrate
as I have use that many times. I just want to know on a broad scale, are SageMath solvers faster than Scipy solvers and how reliable and stable are the solutions in general ?
Thanks in advance for the replies!
Scipy solvers are numerical solvers, using numerical integration to get a solution of (systems of) ordinary differential equations.Sagemath "default" numerical solvers come from Maxima, and give reasonable answers in reasonable time. Sagemath also offers access to Scipy solvers, as you noted. As far as I know, no formal benchark of these implementations has been published.
But Sagemath offers an alternative : symbolic solutions.
desolve
(anddesolve_system
), as well as Sympy'sdsolve
(try to) solve ODE systems symbolically (Scipy also offers a rudimentary attempt to solve some partial differential equations). Many ODE and PDE (systems) do not have explicit symbolic solutions, but those who do should be solved this way, avoiding all the problems of numerical solutions.Note that the geodesic solveralready implemented in SageMath allows one to choose between many ODE solvers, from SciPy or from the GSL: https://doc.sagemath.org/html/en/refe... The default geodesic solver is
odeint
from SciPy.Okay so I will implement Scipy solvers as I need numerical solutions for my work. Thanks for pointing out the symbolic solvers in SageMath, I didn't know about them and thanks for the reference to geodesic solver, I'll surely check it out. Cheers!