[ODE] Croteam's optimizations

Russ Smith russ at q12.org
Tue May 11 11:12:32 MST 2004


> P.S. For those who want to know more, this solver is, as Nguyen noted,
> the GS solver. If you just solve the LCP in a Gauss-Seidel manner,
> row-by-row directly from its sparse J*Minv*Jt formulation, it does
> converge towards a plausible solution. But it needs some tweaks in
> proper places. Downside is that it is not as precise as the direct
> solver, but we were able to get plausible results in all cases we
> tested. It is really hard to compare it with direct solver, because
> with direct solver some of those test cases just run in spf instead of
> fps. ;)
> 
> And it comes with a few bonuses. One is that this thing can be easily
> understood and implemented by someone without knowledge of arcane math
> speak. What in turn makes is easy to implement in vectorization
> hardware(SSE, VU...). And the other is that it doesn't need CFM. What
> is a big step towards less interpenetration and stiffer joints.


hi alen,

a few comments the CFM thing to maybe help you out. the basic role of
CFM is to make close-to-singular matrices less singular (i.e. "more"
positive definite) by adding numbers to the diagonal of the system
matrix. this has two advantages:

(1) a solution can be found even in cases where constraints are
redundant, for example if there are too many contacts all trying to do
the same thing. without CFM, tiny imprecisions in the factorizer and LCP
solver would quickly blow up into major numerical errors, and the
solution would be useless. you can see this in action if you make piles
of objects with too many contact points, and set CFM to zero - the pile
will twitch and jerk occasionally - this is numerical error being
amplified. with some added CFM, the redundant constraints just share the
load, and there is no problem.

(2) with added CFM, the constraints become "springy". this can be viewed
as a disadvantage as well, since often springyness is not what you want.
but the amount of springyness can be precisely controlled, and this is
good for modeling very stiff springs. note that, unlike springs modeled
with externally added forces, springs modeled with CFM can be made very
stiff without stability problems.

now, an important point is that added CFM will benefit just about any
matrix solving algorithm: direct methods will have less imprecision, and
iterative methods will converge more quickly (or alternatively, will
produce a better solution in a fixed number of iterations). so CFM is
your friend!

russ.

-- 
Russell Smith
http://www.q12.org


More information about the ODE mailing list