When is an ODE (numerically) reversible in time?

  • #1
Aidyan
182
14
I'm wondering whether a differential equation that can be integrated numerically forwards in time can also be integrated backwards in time starting from the final state and inverting the momenta/velocities? I tried and it didn't work. But I'm not sure whether I'm making a mistake with my solver or because an ODE must meet some conditions to be numerically reversible in time? In my case, it is a second order non-linear ODE (the damped driven oscillator): ## \ddot{\theta} + 2\beta \dot{\theta} + \omega_{0}^2 \sin \theta = \gamma \omega{_0}^2 \cos{\omega t}##, where ##\omega##, ##\omega_0##, ##\beta##, and ##\gamma## are constants. But my question is more general regarding every DE. That is, is there a conceptual fundamental reason that (sometimes or never?) a differential equation can't be integrable in reverse?
 
Physics news on Phys.org
  • #2
If you make the change of variable [itex]t - T - \tau[/itex] then [itex]\frac{d}{dt} = - \frac{d}{d\tau}[/itex]. Thus to be time-reversible on the interval [itex][0, T][/itex] the ODE [itex]\ddot x = f(x, \dot x, t)[/itex] must satisfy the symmetry [tex]f(x, -y, T - \tau) \equiv f(x, y, \tau).[/tex]
 
  • #3
In numerical integration, there is discretization error and roundoff error that is not the same over the reverse path, and which can grow or decay. Are you familiar with the concept of numerical integration stability?
 
  • #4
Chestermiller said:
In numerical integration, there is discretization error and roundoff error that is not the same over the reverse path, and which can grow or decay. Are you familiar with the concept of numerical integration stability?
Well, I'm not an expert, but the reason I would like to integrate back in time is precisely because I would like to check how accurately the solution returns to the initial conditions. That would suggest something on how the integration forward in time is correct (does it?) Say one finds a solution in the time span [0,T] and then reverses it by changing the sign of the first derivative and integrating from [T, 2T]. Even if there are large numerical errors, I would expect that at least in the first part of the reverse integration the solver returns similar values (say for some time between [T, T+dt].) But it doesn't at all. It goes completely astray. So, either there is a mistake in the code (but only in the reverse part, the forward is certainly correct, I've checked this with several solvers), or there is a fundamental logical reason why this can't work. I was asking in particular for the second alternative.
 
  • #5
Aidyan said:
Well, I'm not an expert, but the reason I would like to integrate back in time is precisely because I would like to check how accurately the solution returns to the initial conditions. That would suggest something on how the integration forward in time is correct (does it?) Say one finds a solution in the time span [0,T] and then reverses it by changing the sign of the first derivative and integrating from [T, 2T]. Even if there are large numerical errors, I would expect that at least in the first part of the reverse integration the solver returns similar values (say for some time between [T, T+dt].) But it doesn't at all. It goes completely astray. So, either there is a mistake in the code (but only in the reverse part, the forward is certainly correct, I've checked this with several solvers), or there is a fundamental logical reason why this can't work. I was asking in particular for the second alternative.
It doesn't take long for a numerical scheme to go unstable. Try $$\frac{dy}{dt}=-y$$ and $$\frac{dy}{dt}=+y$$ starting at y = 1.
 
Last edited by a moderator:

Similar threads

Back
Top