Numeric Integration Methods Jim Van Verth Red Storm Entertainment

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Lecture on Numerical Analysis Dr.-Ing. Michael Dumbser
Multistage Sampling.
Advanced Piloting Cruise Plot.
Analysis of Computer Algorithms
Kapitel 21 Astronomie Autor: Bennett et al. Galaxienentwicklung Kapitel 21 Galaxienentwicklung © Pearson Studium 2010 Folie: 1.
Dynamics 101 Jim Van Verth Red Storm Entertainment
Chapter 1 The Study of Body Function Image PowerPoint
1 On the Long-Run Behavior of Equation-Based Rate Control Milan Vojnović and Jean-Yves Le Boudec ACM SIGCOMM 2002, Pittsburgh, PA, August 19-23, 2002.
Finite Element Method CHAPTER 4: FEM FOR TRUSSES
SPECIAL PURPOSE ELEMENTS
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 5 Author: Julia Richards and R. Scott Hawley.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Fig 2.1 Chapter 2.
By D. Fisher Geometric Transformations. Reflection, Rotation, or Translation 1.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination.
Sigal Gottlieb, UMass Dartmouth: SAMSI workshop November 15, 2007 STRONG STABILITY PRESERVING RUNGE-KUTTA & MULTI-STEP TIME DISCRETIZATIONS Sigal Gottlieb,
Summary of Convergence Tests for Series and Solved Problems
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Title Subtitle.
0 - 0.
ALGEBRAIC EXPRESSIONS
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
Formal Computational Skills
ZMQS ZMQS
Method of Virtual Work.
Constrained Dynamics Marq Singer
Ordinary Differential Equations
Numerical Solution for Initial Value Problem Numerical Analysis.
BT Wholesale October Creating your own telephone network WHOLESALE CALLS LINE ASSOCIATED.
Spoofing State Estimation
ABC Technology Project
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
© Charles van Marrewijk, An Introduction to Geographical Economics Brakman, Garretsen, and Van Marrewijk.
1. 2 No lecture on Wed February 8th Thursday 9 th Feb 14: :00 Thursday 9 th Feb 14: :00.
Quadratic Inequalities
1 4 Square Questions B A D C Look carefully to the diagram Now I will ask you 4 questions about this square. Are you ready?
Squares and Square Root WALK. Solve each problem REVIEW:
Chapter 5 Test Review Sections 5-1 through 5-4.
GG Consulting, LLC I-SUITE. Source: TEA SHARS Frequently asked questions 2.
Addition 1’s to 20.
25 seconds left…...
Week 1.
We will resume in: 25 Minutes.
Eric Prebys, FNAL.  We have focused largely on a kinematics based approach to beam dynamics.  Most people find it more intuitive, at least when first.
How Cells Obtain Energy from Food
Lecture 6: Constraints II
State Variables.
Rigid Body Dynamics Jim Van Verth
Integration Techniques
Ordinary Differential Equations
MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro.
Computer graphics & visualization Rigid Body Simulation.
Dynamics 101 Jim Van Verth Red Storm Entertainment
Physics for Game Developers Jim Van Verth Christer Ericson Squirrel Eiserloh Gino van den Bergen Erin Catto Marq Singer.
Erin Catto Blizzard Entertainment Numerical Integration.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Numerical Integration and Rigid Body Dynamics for Potential Field Planners David Johnson.
Computer Animation Algorithms and Techniques
Scientific Computing Multi-Step and Predictor-Corrector Methods.
Particle Systems. Applications Particle systems are broadly defined for: Explosion Cloth Fluid And more… It is integrated into many animation software,
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Integrators of higher order
ECE 576 – Power System Dynamics and Stability
Class Notes 19: Numerical Methods (2/2)
Lecture #5 Implicit Method Oh-young Song Sejong University
Presentation transcript:

Numeric Integration Methods Jim Van Verth Red Storm Entertainment

2 Talk Summary Going to talk about: Eulers method subject to errors Implicit methods help, but complicated Verlet methods help, but velocity inaccurate Symplectic methods can be good for both

3 Forces Encountered Dependant on position: springs, orbits Dependant on velocity: drag, friction Constant: gravity, thrust Will consider how methods handle these

4 Eulers Method Has problems Expects the derivative at the current point is a good estimate of the derivative on the interval Approximation can drift off the actual function – adds energy to system! Worse farther from known values Especially bad when: System oscillates (springs, orbits, pendulums) Time step gets large

5 Eulers Method (contd) Example: orbiting object x0x0 x1x1 x2x2 t x x4x4 x3x3

6 Stiffness Have similar problems with stiff equations Have terms with rapidly decaying values Larger decay = stiffer equation = req. smaller h Often seen in equations with stiff springs (hence the name) t x

7 Euler Lousy for forces dependant on position Okay for forces dependant on velocity Bad for constant forces

8 Runge-Kutta Idea: single derivative bad estimate Use weighted average of derivatives across interval How error-resistant indicates order Midpoint method Order Two Usually use Runge-Kutta Order Four, or RK4

9 Runge-Kutta (contd) RK4 better fit, good for larger time steps Tends to dampen energy Expensive – requires many evaluations If function is known and fixed (like in physical simulation) can reduce it to one big formula

10 Runge-Kutta Okay for forces dependant on position Okay for forces dependant on velocity Great for constant forces But expensive: four evaluations of derivative

11 Implicit Methods Explicit Euler method adds energy Implicit Euler dampens it Use new velocity, not current E.g. Backwards Euler: Better for stiff equations

12 Implicit Methods Result of backwards Euler Solution converges - not great But it doesnt diverge! x0x0 x1x1 x2x2 x3x3

13 Implicit Methods How to compute or ? Derive from formula (most accurate) Solve using linear system (slowest, but general) Compute using explicit method and plug in value (predictor-corrector)

14 Implicit Methods Solving using linear system: Resulting matrix is sparse, easy to invert

15 Implicit Methods Example of predictor-corrector:

16 Backward Euler Okay for forces dependant on position Great for forces dependant on velocity Bad for constant forces But tends to converge: better but not ideal

17 Verlet Integration Velocity-less scheme From molecular dynamics Uses position from previous time step Very stable, but velocity estimated Good for particle systems, not rigid body

18 Verlet Integration Leapfrog Verlet Velocity Verlet

19 Verlet Integration Better for forces dependant on position Okay for forces dependant on velocity Okay for constant forces Not too bad, but still have estimated velocity problem

20 Symplectic Euler Idea: velocity and position are not independent variables Make use of relationship Run Eulers in reverse: compute velocity first, then position Very stable

21 Symplectic Euler Applied to orbit example (Admittedly this is a bit contrived) x0x0 x1x1 x2x2 x3x3

22 Symplectic Euler Good for forces dependant on position Okay for forces dependant on velocity Bad for constant forces But cheap and stable!

23 Which To Use? With simple forces, standard Euler or higher order RK might be okay But constraints, springs, etc. require stability Recommendation: Symplectic Euler Generally stable Simple to compute (just swap velocity and position terms) More complex integrators available if you need them -- see references

24 References Burden, Richard L. and J. Douglas Faires, Numerical Analysis, PWS Publishing Company, Boston, MA, Witken, Andrew, David Baraff, Michael Kass, SIGGRAPH Course Notes, Physically Based Modelling, SIGGRAPH Eberly, David, Game Physics, Morgan Kaufmann, 2003.

25 References Hairer, et al, Geometric Numerical Integration Illustrated by the St ö rmer/Verlet method, Acta Numerica (2003), pp Robert Bridson, Notes from CPSC 533d: Animation Physics, University of BC.