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) Plot roughly based on dropping a non very bouncy ball
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) Velocity (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 Kinematics - the branch of mechanics concerned with the motion of objects without reference to the forces that cause the motion.
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 Initial conditions: 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
Step in the direction of the derivative Euler integration For arbitrary function f (ti) with known derivative Also draw locations of new point if doubling dt or negating dt Euler pronunciation: like “oiler” Step in the direction of the derivative
Example of inaccuracy during integration For arbitrary function, f(t) Ex: wind, springs The force acting on a point may vary in space, i.e. in most cases
Integration and step size Here x is the same thing as time or t in the previous slides
Inaccuracy and instability
Runge Kutta Integration: 2nd 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: 2nd order aka Midpoint Method For unknown function, f(t); known f ’(t)
Step size Euler Integration Midpoint Method
Integration comparison Image from http://www.physics.drexel.edu/students/courses/Comp_Phys/Integrators/simple.html
Integration comparison Image based on http://www.physics.drexel.edu/students/courses/Comp_Phys/Integrators/simple.html
Integration comparison Image based on http://www.physics.drexel.edu/students/courses/Comp_Phys/Integrators/simple.html
Additional slides
Other integration techniques Implicit Euler Huen Verlat Leapfrog
OSU CSE course: Numerical Methods 5361 http://coe-portal.cse.ohio-state.edu/pdf-exports/CSE/CSE-5361.pdf 541 (from quarter system) http://web.cse.ohio-state.edu/~crawfis/cse541/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