Undergrad When is an ODE (numerically) reversible in time?

  • Thread starter Thread starter Aidyan
  • Start date Start date
  • Tags Tags
    Ode Reversible
Click For Summary
The discussion centers on the challenges of numerically integrating a second-order non-linear ordinary differential equation (ODE) both forwards and backwards in time. The user is investigating whether an ODE can be reversed in time by inverting momenta and velocities, but is encountering discrepancies in results, suggesting potential issues with numerical stability or inherent limitations of the ODE itself. It is noted that numerical integration can suffer from discretization and roundoff errors, which may affect reversibility and lead to instability. The user seeks to understand if there are fundamental reasons why certain differential equations cannot be integrated backwards accurately. The conversation highlights the importance of numerical stability in integration methods and the potential for errors to grow or decay during reverse integration.
Aidyan
Messages
182
Reaction score
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
If you make the change of variable t - T - \tau then \frac{d}{dt} = - \frac{d}{d\tau}. Thus to be time-reversible on the interval [0, T] the ODE \ddot x = f(x, \dot x, t) must satisfy the symmetry f(x, -y, T - \tau) \equiv f(x, y, \tau).
 
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?
 
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.
 
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

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
484
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
Replies
9
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K