How does the block solver work?

Any posts related to how dyn4j works, the math involved, class structure and hierarchy, etc.
SemiSober
Posts: 11
Joined: Wed Apr 23, 2014 1:20 am

How does the block solver work?

Postby SemiSober » Wed Oct 22, 2014 5:17 pm

i do not understand the contact solver when two contact point come in, why should we compute K-Matrix and what is maxCondition ? how does it work ?
can you provide me an explanation or paper about that?

thanks

William
Site Admin
Posts: 349
Joined: Sat Feb 06, 2010 10:23 pm

Re: How does the block solver work?

Postby William » Thu Oct 23, 2014 2:15 pm

I don't have a paper, but rather a link you can look over. This gives a decent explaination, but does assume some familiarity with the subject.

The block solver is an attempt to make the iterative solver more stable. By definition the iterative solver iterates over all the contacts and solves them one by one. Naturally, if a body has two contacts (in 2D), these will be solved separately. This isn't really an issue since the solver should converge to the global solution anyway, but solving both of these at the same time can increase numeric stability and the rate of convergence.

So the block solver, rather than solving one body's contact constraints (max of 2 in 2D) one by one, it solves them together using a mini-MLCP. This is possible with 2D and 2 constraints since there's only 4 possible variations of the complimentary conditions. These are the "ifs" you see in the code.

Take a look at Condition Numbers. In this context, the maxCondition is an number selected to determine whether we can solve (or invert) the matrix. What was noticed is that once the two contacts of a body were close enough, there tends to be a large amount of error (manifested as oscillation or large impulses for example). Using a condition number we can quickly avoid these situations and solve just one of the constraints.

William

SemiSober
Posts: 11
Joined: Wed Apr 23, 2014 1:20 am

Re: How does the block solver work?

Postby SemiSober » Thu Oct 23, 2014 7:55 pm

Good. thank you so much bro=;


Return to “Behind The Scenes”

Who is online

Users browsing this forum: No registered users and 1 guest