Presentation is loading. Please wait.

Presentation is loading. Please wait.

 d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu.

Similar presentations


Presentation on theme: " d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu."— Presentation transcript:

1  d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu

2 d.s. wu  2 objective Determine the force vector to ensure appropriate behavior for contacting objects or alternatively: make the game do the right thing when objects collide with one another - also make it work when they rest on one another

3 d.s. wu  3 customer requirements Stability uncommon circumstances should not prevent further play Perceived accuracy behavior should appear correct Perceived precision or consistency known actions may be applied to produce consistent effect Performance avoid O(2 n ) complexity Iteration that never converges is not acceptable Stability really important Customer Satisfaction Stability Consistency Accuracy Performance

4 d.s. wu  4 “what methods are there for solving the problem?” Apply impulses for collisions and forces for resting contact Solve using iterative constraints Declare collision resolution “beyond the scope of this simulator” Use Potentials that “encourage” appropriate behavior (penalty methods)

5 d.s. wu  5 “which are you currently using?” please review title page

6 d.s. wu  6 “why penalty methods?” penalty methods are trivial to implement classic analytical methods have many degenerate configurations a lot of special cased code is required to ‘elegantly handle’ these penalty methods decay gracefully in awkward situations analytic methods tend to have worst case performance that is O(n!), O(2 n ), or O(n 3 ) penalty methods extend robustly to more complex problems such as deformable representations such as FEM or FFD lattice

7 d.s. wu  7 meeting the needs Penalty methods Stability Tends to converge Few degenerate cases Doesn’t explode

8 d.s. wu  8 “penalty methods are numerical hacks” Before continuing, you will need to accept the following axioms:  Penalty Methods are not all that bad They robustly solve many difficult problems Implementation is intuitive Most physics researchers and programmers don’t trust penalty methods Most programmers who are about to write their first physics code will implement penalty methods, armed with their first year physics text Potential methods are not a good place to start, before you go off and throw arbitrary potentials at every problem you encounter, learn and understand the more established methods, these will specify the desired behavior for non- degenerate situations

9 d.s. wu  9 more persuasion II. independence between numerical integration and contact resolution is a luxury combining the two can be justified solving the problems independently is the most most common implementation modular, independent components are nice, but in this case, they limit your potential methods for solution

10 d.s. wu  10 more persuasion III. Implicit Euler is not a joke First order accuracy is really not all that bad provided that it is stable Stiff decay is a good thing when things get really nasty, diminishing high frequency components is desirable A-Stability is not just an inconsequential feature of obscure integration schemes Explicit integration schemes are not suitable for stiff systems No implicit or explicit multi-step methods are A-Stable

11 d.s. wu  11 implementation synopsis Each contact is classified as either a collision or a resting contact if (relative velocity * normal > [insert magic threshold] ) collision otherwise, resting contact Two linear potentials are created. One acts along normal to repel objects, the other acts on the tangent plane to represent friction. nonlinear force along contact normal is approximated by a piecewise cubic spline Friction cone is approximated by a piecewise cubic patch

12 d.s. wu  12 Conventions (what do those obscure letters mean?) Scalar: lower case italic, e.g. ‘k’ Vector: lower case e.g. ‘q’ vector Matrix: upper case e.g. ‘M’ q = position q’ = velocity q’’ = acceleration

13 d.s. wu  13 more letters nf = unit vector along collision normal f = a vector constrained to the tangent plane s p = jacobian that projects the relative velocity contact point into the velocity space of the potential f n = contact normal reaction force f f = friction reaction force

14 d.s. wu  14 Equations Resting contact normal force: fn=L*(sn t *kb+ksn*sn t *q+kdn*sn t *q’) Collision normal force: ksn is 0 kdn is large in both cases: L is a piecewise cubic spline that smoothly interpolates (e.g. with continuity of G 2 ) 0 when |f| <= 0 1 when |f| >= [insert magic threshold]

15 d.s. wu  15 continued Friction forces: f f = L * (q’ / |q’| *(k1 + k2*|q’| + k3*|q’| 2 ) ) L is a piecewise cubic spline that smoothly interpolates (e.g. with continuity of G 2 ) 0 when |f| <= [insert small magic threshold] 1 when |f| >= [insert big magic threshold]

16 d.s. wu  16 “discontinuous potentials break my integrator” First and second derivatives w.r.t in q and q’ are continuous (due to the spline being C 2 ), this should be sufficient for robust equation solvers) the numerical integration equation is nonlinear (for Implicit Euler, q(t 1 ) = q(t 0 ) + [step size] * f(q(t 1 ), t 1 )) a technique that use a quadratic manifold to approximate equations will require multiple iterations (techniques such as Newton/Rhampson Iteration and Linear Conjugate Gradient) in my experience, Quasi-Newton and Nonlinear Conjugate Gradient are more effective

17 d.s. wu  17 Where do ksx, kdz, etc come from? Resting contact kdz = m sz *p ksz = m sz *sqr(p)/8.0 Over damped, velocity half life of p Collision: kdzc = Msz*p p is very high, chosen such that 95% of desired velocity will be reached one after one step

18 d.s. wu  18 “kdz is too high” use a stable integrator

19 d.s. wu  19 “you are using potentials to emulate velocity constraints and impulses” With backward Euler integration, an impulse occurring at any point within a time step is equivalent to a force during the time step with an equal integral over the time step Solving the system: q(t 1 ) = q(t 0 ) + [step size] * f(q(t 1 ), t 1 ) handles over-determined systems gracefully Each potential is given an explicit priority Solution applies a weighted least square minimization to error

20 d.s. wu  20 Questions Ask questions


Download ppt " d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu."

Similar presentations


Ads by Google