I am taking a class on computational physics. Instead of implementing everything myself, I figured I should use (and learn to use) existing frameworks.
One of the class problems involves using Leapfrog integration (Wiki). I can not find a leapfrog solver in the DifferentialEquations/OrdinaryDiffEq packages. I guess this is because in reality, one would rarely use this method.
It is however not the first time I encounter the Leapfrog method in teaching contexts, so perhaps it is worth implementing it. Not to solve differential equations well, but to perform “numerical experiments” and learn about numerical differential equation solving.
My concrete questions are:
- Is there any existing solver that implements the Leapfrog method, but that goes by a different name?
- If not, is it feasible to implement it myself (Lets say ~less than 50 LOC)? I started looking into the
src
ofOrdinaryDiffEq
, but there were a lot of lines of code specifying formalities (Order, beta-coefficients and so on), and I could not even find where the instructions for doing the calculations were defined.