Force independent of timestep

Hello,

The force being applied now is +50

If frame rate is 60 and timestep is 1/60 it behaves differently than when frame rate is 30 and timestep is 1/30.

Is this normal for a physics simulation ?!?

I find this kinda weird...

Bye,
Skybuck.
I am trying to understand why the forces are different when the timestep changes...

I think this might have something to do because of "numerical integration" which your physics simulator uses ?

This link mentions it:

http://en.wikipedia.org/wiki/Integrator

"an integrator is a numerical method for integrating trajectories from forces (and thereby accelerations) that are only calculated at discrete time steps"

Apperently this is the most accurate method ?:

http://en.wikipedia.org/wiki/Runge-Kutta_method

Maybe your physiscs simulator could use that one instead and give better results when timestep changes ?

Bye,
Skybuck.
This is probably what your physics engine should do:

http://ocw.mit.edu/courses/aeronautics- ... 6/spl2.pdf

It should approximate forces and curves and stuff like that... it shouldn't matter what the timestep is... the curve would become less exact but should be roughly the same right ?

That doesn't seem to be the case with your physics engine so I am wondering if there is a bug/mistake in it somewhere...

It could be that the delphi port screwed up but I think that's unlikely... none the less.. it requires further investigation... I will try to make a c++ example... and simply print out some positions of a "cannon ball" being fired along different timesteps, the path should roughly be similiar... if it isn't then there must be a bug in your engine ? Or is it normal for integrators to be way off ???
Gje apperently it's normal for integrators to have big errors:

http://en.wikipedia.org/wiki/Euler_integration

^ Easiest way to do trajectories...

Hmm...

Also did you check out the taylor series ? 😉

Bye,
Skybuck.
I suggest you write a simple 1 dimensional particle simulation and try different integrators and time steps. This will get you outside of the big code base of Box2D and help you understand the interaction between time steps, forces, and accuracy.
I think I already understand..

I just need confirmation from you that if the timestep changes that forces will be applied differently if it's just done for one single step... and that trajectories will indeed be slightly different and that this is normal 😉 🙂

For example:

TimeStep := 1/30; Force := 25; <- Applied for one step.
vs
TimeStep := 1/60; Force := 50; <- Applied for one step.

Trajectories will be slightly different.

Bye,
Skybuck.
Yeah, if you only apply the force for one step, the results should be very different.

Original thread: https://box2d.org/forum/viewtopic.php?t=5422