SV: [ODE] Iterative solution
david@csworkbench.com
david at csworkbench.com
Mon Mar 17 11:39:02 2003
My system is a dual Athlon MP 1.2 GHz, 1 GB DDR Ram. Of course, only one
of those processors is used for the simulation.
As far as the worst-offenders-first idea goes, I'm not sure it would make
much of a difference. The current algorithm is something like:
foreach joint
get Jacobian info (J) and other LCP vectors.
next joint
for i = 0 to maxIterations
foreach body
compute global I and invI matrices from mass.I and rotation
add Inertia to torque and force accumulators
add gravity to force accumulators
next body
foreach joint
calculate A = J * invM * J' //30% of time here
solve LCP problem for A //20% of time here
add resulting forces to each body's accumulators
next joint
foreach body
adjust body's linear and angular velocity by force and torque accumulator
adjust body's position and rotation by linear and angular velocity
reset force and torque accumulators to 0
next body
next i
So it shouldn't matter what order the joints are evaluated in, since they
are all evaluated, then all the bodies are updated.
David
>
>> fps, hardly varying at all. The old solution runs at
>> anywhere from 5 to
>> 25 fps until the cars hit the wall and the two islands join, then I
>> couldn't tell you what it runs at, mine segfaults.
>
> What's the specs for the machine your running this on?
>
>> Either way, if you want to have a look at the eye candy, check out
>> http://www.csworkbench.com/crash.mpg . I'm aiming for a
>> (beta) release
>> in the next couple of days (next weekend at the latest), as soon as I
>> get it just a bit more stable/optimized.
>
> That looks very good. Will be fun to check out the code and also to hear
> what Russ has for insight into this solution.
>
> I'm not sure if your doing it already but it might be a good idea to
> find the constraint with the largest oposing force and solve that one
> first and so forth. It should make him come to a global solution faster.
>
> /Joakim E. - http://www.planestate.net
>
>
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode