Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implicit Methods Patrick Quirk February 10, 2005.

Similar presentations


Presentation on theme: "Implicit Methods Patrick Quirk February 10, 2005."— Presentation transcript:

1 Implicit Methods Patrick Quirk February 10, 2005

2 Introduction, Motivation Explicit methods have a difficult time with some types of ODE’sExplicit methods have a difficult time with some types of ODE’s They guess where the function is headingThey guess where the function is heading Stiff ODE’sStiff ODE’s –One component big for a short time –Does not contribute later –Must make time step small for explicit to handle it

3 Solution – Implicit Methods Backward Euler MethodBackward Euler Method Evaluates ƒ at the point we’re aiming atEvaluates ƒ at the point we’re aiming at –Less guessing, more accuracy Consequently, the step size can be largerConsequently, the step size can be larger

4 Implicit Methods Last example was simplisitcLast example was simplisitc Typically cannot directly solve for y n+1Typically cannot directly solve for y n+1 –Unless ƒ is linear So…approximate ƒ with its Taylor ExpansionSo…approximate ƒ with its Taylor Expansion

5 Implicit Methods More equation manipulations are doneMore equation manipulations are done Allows us to approximate ΔxAllows us to approximate Δx –Albeit with an inverse of a matrix! In general this extra computation isn’t badIn general this extra computation isn’t bad –Larger time step offsets this

6 An Aside - Explicit Method Verlet AlgorithmVerlet Algorithm Does away with the velocity termDoes away with the velocity term –Stores only current, previous position –Approximates velocity by x n -x n-1

7 An Aside - Explicit Method But it’s explicit!But it’s explicit! –It’s a second-order method, higher accuracy –Has the computational cost of a first-order –No numerical drift like in some other explicit and implicit methods –Easy to code! –Widely used in games and physics –Often chosen over implicit methods for these reasons

8 Big Picture - Implicit Methods Explicit Method code is easyExplicit Method code is easy Implicit Method code is harderImplicit Method code is harder Try to make problem un-stiff if possibleTry to make problem un-stiff if possible –Then use an explicit method and small Δt Otherwise write an implicit solverOtherwise write an implicit solver –Use the larger time stepto your advantage

9 Second Order ODEs Dynamics problems are often second orderDynamics problems are often second order Need to convert it to a first order problemNeed to convert it to a first order problem

10 Second Order ODEs Introduce new variables to get first orderIntroduce new variables to get first order But this gives a 2n x 2n linear systemBut this gives a 2n x 2n linear system –Bad news for BEM, has to solve that system –Can we reduce the size?

11 Second Order ODEs Can reduce it to n x nCan reduce it to n x n –Introduce some more new variables Taylor Expand ƒ (in two dimensions)Taylor Expand ƒ (in two dimensions) –Put that back into the equation

12 Second Order ODEs Substitute the first row into the secondSubstitute the first row into the second Regroup terms and solve for ΔvRegroup terms and solve for Δv If there is a variance in time, an extra term:If there is a variance in time, an extra term:

13 Sources SIGGRAPH Course NotesSIGGRAPH Course Notes –http://www.pixar.com/companyinfo/research/pbm2001/notesd.pdf http://www.pixar.com/companyinfo/research/pbm2001/notesd.pdf Mathworld ReferencesMathworld References –http://mathworld.wolfram.com http://mathworld.wolfram.com “A Practical Dynamics System”. Kačić-Alesić, Nordenstam, Bullock. Eurographics/SIGGRAPH 2003.“A Practical Dynamics System”. Kačić-Alesić, Nordenstam, Bullock. Eurographics/SIGGRAPH 2003. –http://portal.acm.org/citation.cfm?id=846276.846278 http://portal.acm.org/citation.cfm?id=846276.846278 “Advanced Character Physics”. Thomas Jakobsen. Gamasutra. 2003“Advanced Character Physics”. Thomas Jakobsen. Gamasutra. 2003 –http://www.gamasutra.com/resource_guide/20030121/jacobson_01.shtml http://www.gamasutra.com/resource_guide/20030121/jacobson_01.shtmlhttp://www.gamasutra.com/resource_guide/20030121/jacobson_01.shtml

14 Interactive Animation of Structured Deformable Objects Mathieu Desbrun, Peter Schröder, Alan Barr Caltech

15 Introduction, Motivation Interactive deformation is toughInteractive deformation is tough –Simulation methods are too slow –Usually used in VR, user has control Limited greatly by time stepLimited greatly by time step –Too big means instability in simulation –Too small means alteration in reality Implicit IntegrationImplicit Integration –Offers low computational time –Nearly arbitrary time step

16 Implicit Integration : 1D case Replace all forces at time t by t+1 Now positions are not blindly reached, but are logically inferred. Now positions are not blindly reached, but are logically inferred. n+1 In other words: Explicit steps into the unknown with only initial conditions. Explicit steps into the unknown with only initial conditions. Implicit tries to hit the next position correctly. Implicit tries to hit the next position correctly.

17 Implicit Integration : 1D case Must compute F n+1 at t+dt (spring forces) Use a first order approximation (since we don’t know what exactly F n+1 (t+dt) is) Use a first order approximation (since we don’t know what exactly F n+1 (t+dt) is) Here Δ n+1 x is called the backward difference operator: Here Δ n+1 x is called the backward difference operator:

18 Add artificial viscosityAdd artificial viscosity –Increases stability Force filteringForce filtering –Uses matrix multiplication (H=dF/dx) –Global force effects –Smoothes large force differences Pull it all together…Pull it all together… Implicit Integration : 1D case

19 Final Form for 1D:Final Form for 1D: Look closely, is it really implicit?Look closely, is it really implicit? Damping Force Force Filter Matrix

20 Implicit Integration : 1D case Loss in accuracyLoss in accuracy –Force smoothing –Artificial viscosity Force filtering matrix changes at each time step (2D/3D only) –Forces you to solve a linear system Gain in speedGain in speed

21 Implicit Integration: 1D case Some of the “Bads” aren’t all that bad:Some of the “Bads” aren’t all that bad: Artificial viscosityArtificial viscosity –It is frequently added to simulations. –If it is already taken care of, so much the better. Changing filter matrix –Even if this does take time, the computational advantages are already so significant it doesn’t matter too much. –Approximating it makes it a constant Compute it once, use it forever

22 Implicit Integration: 2D/3D case Similar to 1D case, though the smoothing matrix changes with each step.Similar to 1D case, though the smoothing matrix changes with each step. –This paper removes the need to solve a linear system Splits the force into a linear and non-linear partSplits the force into a linear and non-linear part –Linear is easily solved, non-linear approximated to zero Magnitude does not change (internal forces), just directionMagnitude does not change (internal forces), just direction Preserve linear/angular momentaPreserve linear/angular momenta Includes inverse dynamics to remove stretchingIncludes inverse dynamics to remove stretching

23 Implicit Integration : 2D/3D case In 2D/3D, implicit integration is done by computing the Hessian matrix HIn 2D/3D, implicit integration is done by computing the Hessian matrix H –It depends on position of particle nodes, changing Equation for one element of H is too long to show hereEquation for one element of H is too long to show here –Each node is a 3x3 matrix, total of 3nx3n elements Too large to solve efficientlyToo large to solve efficiently –Approximate it

24 Implicit Integration : 2D/3D case Matrix split into 2 partsMatrix split into 2 parts –Linear –Non-Linear Simple, assume its zeroSimple, assume its zero It’s constant in magnitude, but will rotateIt’s constant in magnitude, but will rotate

25 Implicit Integration : 2D/3D case Check if linear, angular momenta are conservedCheck if linear, angular momenta are conserved –Linear is Sum of artificial viscosity forces is zeroSum of artificial viscosity forces is zero Force filtering has no effectForce filtering has no effect –Angular is not! Because of that assumption about the non-linear hessianBecause of that assumption about the non-linear hessian Desbrun corrects this with some inverse dynamicsDesbrun corrects this with some inverse dynamics

26 Results

27 Sources “Interactive Animation of Structured Deformable Objects”. Desbrun, Schröder, Barr. Graphics Interface. 1999“Interactive Animation of Structured Deformable Objects”. Desbrun, Schröder, Barr. Graphics Interface. 1999 –http://www.multires.caltech.edu/pubs/GI99.pdf http://www.multires.caltech.edu/pubs/GI99.pdf


Download ppt "Implicit Methods Patrick Quirk February 10, 2005."

Similar presentations


Ads by Google