Numerical integration for physically based animation CSE 3541
Numerical integration for physically based animation CSE 3541 / 5541 Matt Boggus
Recording motion First, save a moving object’s position over time. Then, given time, look up position ; y = f(time)
Sampling A fixed amount of time passes between frames, approximate the continuous position curve with discrete samples.
Sampling Low sampling rate (large dt)
Sampling High sampling rate (smaller dt)
Kinematics terms • Position (x, y, z) – Point with respect to the origin • Velocity (x, y, z) – Speed (vector magnitude) – Direction • Acceleration (x, y, z) – Rate of change of velocity – Magnitude and direction r
Problem statement • Compute an unknown function f(time), using its known derivative f’(time) • Known current position and velocity – i. e. values at start of Update() • Unknown “next” position and velocity – i. e. what should values be at end of Update() • Known forces acting on object – Integrate to compute “next” velocity and position
Example acceleration • Initial conditions: – p = 0, v = 5 • If we have the function for acceleration, we can integrate it and use initial conditions to solve for the velocity and position functions velocity position
Euler integration For arbitrary function f (ti) with known derivative Step in the direction of the derivative
Example of inaccuracy during integration For arbitrary function, f(t) The force acting on a point may vary in space, i. e. in most cases
Integration and step size
Inaccuracy and instability
Runge Kutta Integration: 2 nd order aka Midpoint Method • Compute a “full” Euler step • Evaluate f’ at midpoint • Take a step from the original point using the midpoint f’ value
Runge Kutta Integration: 2 nd order aka Midpoint Method For unknown function, f(t); known f ’(t)
Step size Euler Integration Midpoint Method
Integration comparison
Integration comparison
Integration comparison
ADDITIONAL SLIDES
Other integration techniques • • Implicit Euler Huen Verlat Leapfrog
OSU CSE course: Numerical Methods • 5361 http: //coe-portal. cse. ohio-state. edu/pdfexports/CSE-5361. pdf • 541 (from quarter system) http: //web. cse. ohiostate. edu/~crawfis/cse 541/index. html
List of 5361/541 topics • Mathematical Preliminaries: Derivatives, Taylor Series • Representation of Numbers: Accuracy, Precision • Root Finding • Polynomial Interpolation • Numerical Differentiation • Numerical Integration • Random Numbers and Monte-Carlo Techniques • Linear Systems and Gaussian Elimination
- Slides: 22