[ODE] CFM and timesteps

nlin@nlin.net nlin at nlin.net
Fri Mar 14 08:40:01 2003


Hello,

Coming somewhat late into this discussion...

On Wed, Mar 12, 2003 at 07:34:23PM +0100, amundb??rsand wrote:
> "gl" <gl@ntlworld.com> skreiv:
> 
> > The best way to run ODE in real-time is to use a fixed timestep, and simply
> > execute it often enough to 'catch up' with the amount of time passed since
> > the last frame.
> 
> Why should this cause any problems? I've noticed you (all of you)
> stressing this, but why? Except for CFM and ERP, if ODE is properly
> written physics-wise (and it certainly is as far as I can see), and
> except for the possibility of colliding objects travelling through
> eachother, there really shouldn't be any problems.

Because ODE uses a so-called "time-stepping" integrator, which at the
theoretical level uses the size of the timestep as part of the analytical
system of equations to be solved - the Newtonian equations of motion
are combined with the equations for the numerical integration, and the
whole system is solved analytically. Thus the solution does not separate
the equations of motion from the integration scheme; both are tightly
coupled together. Therefore you are not solving the analytical motion 
instantaneously, but only within the framework of a particular numerical
integration scheme; in other words, over a "time step". This theoretical
time-stepping foundation assumes the use of a particular numerical integrator -
currently Euler, but there is one PhD thesis about how to use a trapezoidal
time-stepping integrator (non-trivial).

Since numerical integration requires a timestep, you have to account for the
timestep in the analytical equations. The timestep is assumed to be fixed.

If you have an arbitrarily variable timestep dependent on CPU load, then
you cannot express your timestep as an analytical function (it is not
known a priori), so you cannot express your numerical integration scheme
as an analytical function, so you can't use a time-stepping integration
method.

That's the theory, anyway. I know people are using variable timesteps, but
there is a theoretical problem with doing so.

-Norman