[ODE] Running ODE backwards in time?

Adam Moravanszky adam.moravanszky at novodex.com
Mon Nov 15 11:36:43 MST 2004


    mtoussai at inf.ed.ac.uk wrote:

Hi there!

I need to run some simulations backwards in time (for some planning
algorithms..). I know I could do this by inverting all dynamic properties
((angular) velocities, accelerations, etc.) of the system and running ODE
forwards. But is there a simpler way? Just setting a negative time interval in
a step function doesn't work.

Thanks!
Marc.
_____________________



:-)  It is not that easy.  You would have to rewrite the physics engine, 
reversing all of the operations, including their order.  For example, 
imagine the super simple hypothetical physics engine for simulating a 
point mass falling due to gravity:

 >> a = 10;
 >> v = 0;
 >> p = 0;  //acceleration, velocity, and position
 >> v = v + a; p = p + v; [p v]   //matlab code
ans =

       10       10

 >> v = v + a; p = p + v; [p v]
ans =

       30       20

 >> v = v + a; p = p + v; [p v]
ans =

       60       30


You can now make the particle go backwards in time if you reverse the 
whole process, but note how the code changes:

 >> p = p - v; v = v - a; [p v]
ans =

       30       20

 >> p = p - v; v = v - a; [p v]
ans =

       10       10

 >> p = p - v; v = v - a; [p v]
ans =

        0        0


--Adam





More information about the ODE mailing list