I'm interested in numerically solving the geodesic equations of motion for a particle in the Schwarzschild geometry. Deriving the equations is no problem but I simply have no idea how to initialise and make sense of the output here. We have 4 spacetime coordinates given by $x^\alpha = (t(\lambda),r(\lambda),\theta(\lambda),\phi(\lambda))$, where $\lambda$ is an affine parameter and $t>0, 0<r<\infty, 0<\theta<\pi$ and $0<\varphi<2\pi$. Two of the equations of motion are given by \begin{equation} \frac{d \varphi}{d\lambda} = \frac{h}{r^2}, \\ \frac{dt}{d\lambda} = \frac{E}{\left(1-\frac{2GM}{c^2r}\right)}, \end{equation} where $E,h$ are the energy and the magnitude of the angular momentum. Has anyone references to numerically solving these equations? There is a Mathematica code which is very very cool but I'm more interested to do it myself as a learning exercise rather than just use this not to mention my Mathematica skills are almost as bad as my numerical.

For example, consider the second integral. After a certain number of integration steps the parameter $\lambda$ and $t$ should be different indicating time dilation. Again, I'm not really concerned with the physics of the problem more about the mathematical set-up and mainly some resources.

  • 1
    $\begingroup$ If you have little experience in numerical solutions of differential equations, starting with a system of nonlinear ODEs is tough! There are many different methods you could try; perhaps looking though a book on numerical solutions to differential equations first would be good. Once you understand the ideas and how to implement them, you should then be able to apply the techniques to any ODE (or system of ODEs), such as yours. I am certainly not aware of any books that solve the geodesic equation in Schwarzschild - perhaps some journal articles? $\endgroup$ Mar 2, 2017 at 9:47
  • $\begingroup$ I get your point. I am familiar with the Runge Kutta numerical integrators. I should re word the question to be more clear. It's more the initial set up of the problem and trying to understand the outut. I understand how Runge Kutta family of integrators work from the sort of standard undergrad problems we have all faced. BUT saying that I just can't wrap my head around these geodesic equations. $\endgroup$ Mar 2, 2017 at 9:52
  • 1
    $\begingroup$ Have you solved a system of ODEs before? Starting with something as trivial as $$\frac{df}{dx}=g(x),\;\frac{dg}{dx}= - f(x)$$ might give you some good insight into your problem. As for resources, happy to offer a list of books that I have found useful on numerically solving differential equations, but they aren't specific to the geodesic equation. $\endgroup$ Mar 2, 2017 at 10:01
  • $\begingroup$ @AloneAndConfused some resources would be great. Do you have any on solving systems of coupled DE's? I think we need to employ implicit methods for coupled DE's. Is that correct? $\endgroup$ Mar 6, 2017 at 7:06
  • $\begingroup$ Will post as an answer as any reply will be too long to write as a comment! $\endgroup$ Mar 6, 2017 at 10:57

1 Answer 1


There are many different books on numerical solutions of ODEs and nearly all will consider coupled systems of ODEs, simply because any second- (or higher-) order ODE can be written as a system of first-order ODEs. A sample of some books I have used are:

As for methods, you could use finite differences, finite volumes, finite element, spectral methods - I don't believe you will be limited just because it is a system. What is more likely to be a problem is the nonlinearity in the geodesic equation!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .