Penalty methods for contact resolution
1 / 20

Penalty Methods for Contact Resolution - PowerPoint PPT Presentation

  • Uploaded on

Penalty Methods for Contact Resolution. interactive contact resolution that usually works pi david s wu. objective. Determine the force vector to ensure appropriate behavior for contacting objects or alternatively:

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' Penalty Methods for Contact Resolution' - phoebe-cooley

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Penalty methods for contact resolution

Penalty Methods for Contact Resolution


contact resolution

that usually works


david s wu


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

Customer requirements
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(2n) complexity

    • Iteration that never converges is not acceptable

  • Stability

    • really important





What methods are there for solving the problem
“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)

Which are you currently using
“which are you currently using?”

  • please review title page

Why penalty methods
“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(2n), or O(n3)

  • penalty methods extend robustly to more complex problems such as deformable representations such as FEM or FFD lattice

Meeting the needs



Few degenerate


Tends to converge

meeting the needs

  • Penalty methods

    • Stability

Penalty methods are numerical hacks
“penalty methods are numerical hacks”

Before continuing, you will need to accept the following axioms:

  • Penalty Methods are not all that bad

    • They robustlysolve 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

More persuasion
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

More persuasion1
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

Implementation synopsis
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

  • Conventions what do those obscure letters mean
    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

    More letters
    more letters

    • nf = unit vector along collision normal

    • f = a vector constrained to the tangent plane

    • sp = jacobian that projects the relative velocity contact point into the velocity space of the potential

    • fn= contact normal reaction force

    • ff= friction reaction force


    • Resting contact normal force:

      • fn=L*(snt*kb+ksn*snt*q+kdn*snt*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 G2)

        • 0 when |f| <= 0

        • 1 when |f| >= [insert magic threshold]


    • Friction forces:

      • ff = L * (q’ / |q’| *(k1 + k2*|q’| + k3*|q’|2) )

      • L is a piecewise cubic spline that smoothly interpolates (e.g. with continuity of G2)

        • 0 when |f| <= [insert small magic threshold]

        • 1 when |f| >= [insert big magic threshold]

    Discontinuous potentials break my integrator
    “discontinuous potentials break my integrator”

    • First and second derivatives w.r.t in q and q’ are continuous (due to the spline being C2), this should be sufficient for robust equation solvers)

    • the numerical integration equation is nonlinear

      (for Implicit Euler, q(t1) = q(t0) + [step size] * f(q(t1), t1))

      • 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

    Where do ksx kdz etc come from
    Where do ksx, kdz, etc come from?

    • Resting contact

      • kdz = msz*p

      • ksz = msz*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

    Kdz is too high
    kdz is too high”

    • use a stable integrator

    You are using potentials to emulate velocity constraints and impulses
    “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(t1) = q(t0) + [step size] * f(q(t1), t1) handles over-determined systems gracefully

      • Each potential is given an explicit priority

      • Solution applies a weighted least square minimization to error

    Questions and impulses”

    • Ask questions