Confusion about sequential impulses method

Please don't post Bullet support questions here, use the above forums instead.
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Confusion about sequential impulses method

Post by John McCutchan »

I'm currently implementing a 3D sequential impulses constraint system.

This is what I'm doing:

K = J * W * JT
B = -beta * error - J * v;

lambda = K^-1 * B;

old_lambda = accumulated_lambda
accumulated_lambda += lambda
accumulated_lambda.clamp (lo, hi)
lambda = accumulated_lambda - old_lambda

P = JT * lambda

apply P to bodies.



In this thread: http://www.continuousphysics.com/Bullet ... ddfe218741

Dirk says that this is a slower and worse convergence than PGS

but in this thread: http://www.continuousphysics.com/Bullet ... efdd9aea48

Dirk says that this method is equivalent to a block Gauss seidel solver and has better convergence than PGS

In the first thread dirk is talking about solving for lambda*dt instead of just
for lambda.

I'd appreciate some clarification.

Also, I'm wondering if this is equivalent to erin catto's sequential impulses method?
User avatar
John McCutchan
Posts: 133
Joined: Wed Jul 27, 2005 1:05 pm
Location: Berkeley, CA

Post by John McCutchan »

I've also been wondering how the convergence would be effected by using a solver loop like:

Code: Select all

for i = 0; i < ITERATIONS; i++
      foreach joint J:
            P[J] = calculate_impulses (J);
      foreach joint J:
            apply impulse P[J] to bodies
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

In the first thread you mention, I speak abut the convergence between normal Gauss-Seidel and Block Gauss-Seidel. The Later has better convergence (about Sqrt(2) ). Think of a spherical constraint, if you satisfy it en block you have the correct solution after the first iteration. But I admit that I didn't mademyself very clear in the first thread. So iterative blockwise Gauss Seidel has superior convergence as I also state in the second thread.

In the first thread I take the equation and transform it a bit:

J*W*JT*lambda = -ERP * C / dt2 - J*( v/dt + w*f_ext )

Here lambda is a force. Of course you can multiply the whole equation by dt and get

J*W*JT*(lambda*dt) = -ERP * C / dt - J*( v + w*f_ext*dt)


Here you can basically see the equivalence between PGS and iterative impulses.

And finally what you describy there is identical to Erin method
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Post by Dirk Gregorius »

I've also been wondering how the convergence would be effected by using a solver loop like:
This is called Jacobi iteration and has worse convergence the Gauss-Seidel. Look for matrix splitting (e.g. in Kenny Phd). You have basically Jacobi, Gauss-Seidel and SOR.