[ODE] ODE uses forces that are twice as large as specified. Bug?

Jon Watte hplus-ode at mindcontrol.org
Wed Jan 12 11:49:45 MST 2005


> dt: 0.04
> pos = (0.000000, 0.000000, -0.001600)
> vel = (0.000000, 0.000000, -0.040000)

> The velocity is v=g*dt which is -0.04 for the z component, so that's 
> correct. But the position should be p=0.5*g*dt^2 which should yield a z 
> component of -0.0008 but the z component in the ODE simulation is twice 

If the velocity is 0.04, and acceleration is linear, then physics say 
that you really should have moved by 0.02, as position is just the 
integral of velocity, and with constant acceleration, velocity is a 
triangle.

If you think just about the fact that ODE uses a first-order Euler 
integrator, then the body shouldn't have moved at all.

So, neither of these "expected" outcomes happen. This means that the 
integrator is something else. If you plot the position over a number 
of time steps, you can chart how accurate the integrator actually is, 
but it's not going to be "perfect", even for a second-order problem.

Cheers,

			/ h+




More information about the ODE mailing list