I'm working in applied oceanography, where people are sometimes interested in calculating ``backwards trajectories'' of things floating on the ocean, i.e., going backwards in time to figure out where something came from. In trying out some toy examples, I came across the following point, which I thought was curious.
I'm solving an ODE
$$\dot{x} = f(x),$$
where $x$ is a 2-component vector, and $f(x)$ is a 2D vector field (constant in time). I'm using the 4th-order Runge-Kutta method, and I ran two tests:
- I calculated a trajectory (a solution) forwards in time, starting at $x_0$ and integrating over $t = [0, T]$, then I reversed the vector field (multiplying both components with $-1$), and calculated a trajectory backwards in time from $x(T)$ over the interval $[T, 0]$, ending up approximately back at $x_0$. Then I repeated the whole procedure for several timesteps, and plotted the error (final position - $x_0$), as a function of timestep.
- I calculated a forwards trajectory with a very short timestep, over the interval $[0, T]$, and called this $x(T)$ my reference solution. Then I repeated the exercise for several longer timesteps, and calculated the error relative to the reference solution, and plotted this as well as a function of timestep.
In the first case, I found that the error scaled as $\Delta t^5$, while in the second case it scaled as $\Delta t^4$, which is of course what I would expect from 4th-order Runge-Kutta. Results shown in the plot below.
My question is: What is the reason that I gain an extra order in the first case. I assume it must be something to do with the fact that going backwards along the same trajectory somehow cancels out the error in the pairwise opposing steps, but a more rigorous argument would be nice.
Update: Based on the suggestion from ConvexHull, I re-ran the analysis with a 3rd-order Runge-Kutta method (Kutta's 3rd-order method, https://en.wikipedia.org/wiki/List_of_Runge%E2%80%93Kutta_methods#Kutta's_third-order_method). Results in the plot below.