Multiplication by time step in Sequential Impulses

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
Dani3L
Posts: 28
Joined: Tue Jun 30, 2009 6:56 am
Location: Switzerland
Contact:

Multiplication by time step in Sequential Impulses

Post by Dani3L »

Hello,

I am studying the Sequential Impulse theory for rigid bodies simulation using the slides of Erin Catto from GDC 2009. At the slide 52, it is written that the impulse P is equal to the Force F times the time step h :

P = h F

with the force :

F = J^T lambda

Then, at slide 53, it is written that we have tu update the velocity V2 using the impulse P:

V2 = V2 + M^-1 P

Therefore, according to this equation, the velocity update should be :

V2 = V2 + M^-1 h J^T lambda

However, at slide 56, we see that the velocity update is :

V2 = V2 + M^-1 P

with P = J^T lambda

As you can see here, the multiplication by the time step h has disapeared in the last equation. I have also taken a look at the code of the sequential impulse solver in Box2D and it also seem that we never multiply the force by the time step h to compute the impulse P that we use to update the velocity V2.

There is probably something that I don't understand here but I don't see how we can remove the multiplication by the time step h to compute the impulse P. Does someone has any idea how we can drop this multiplication ?
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Multiplication by time step in Sequential Impulses

Post by Dirk Gregorius »

You don't drop, but essentially substitute F * h = P. All this says is that forces and impulses are linear dependent.

Here is where it comes from:

dv/dt = M^-1 * ( f + JT * lambda )
J * v = 0

( v2 - v1 ) / h = M^-1 * ( f + JT * lambda )
v2 = v1 + M^-1 * ( f + JT * lambda ) * h

J * v2 = 0
J * M^-1 * JT * (lambda * h) = -J * ( v1 + M^-1 * f * h )

Here lambda is a force and we relabel lamba' = lambda * h where lambda' is an impulse now.

J * M^-1 * JT * lambda' = -J * ( v1 + M^-1 * f * h )
Dani3L
Posts: 28
Joined: Tue Jun 30, 2009 6:56 am
Location: Switzerland
Contact:

Re: Multiplication by time step in Sequential Impulses

Post by Dani3L »

Ok I see. It makes much more sense that way :)

Thanks a lot Dirk !
c0der
Posts: 74
Joined: Sun Jul 08, 2012 11:32 am

Re: Multiplication by time step in Sequential Impulses

Post by c0der »

The way I understood it is, since the impulse is applied almost instantly, there is no need to integrate the force over time and assume it occurs instantaneously, therefore making P=JT*lambda rather than JT*lambda*h. Is this a correct assumption or should I multiply by the timestep regardless?

I have excluded h from the suspension bridge demo and the harmonic oscillator behaves fine.
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Multiplication by time step in Sequential Impulses

Post by Dirk Gregorius »

You need to multiply by the timestep ratio if you want to support varying timesteps. I don't remember the details, but you can look it up in Box2D. If you don't support varying timesteps forget about it.
Post Reply