Particle Systems. University of Texas at Austin CS384G - Computer Graphics

Similar documents
Particle Systems. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Reading. Required: Witkin, Particle System Dynamics, SIGGRAPH 97 course notes on Physically Based Modeling.

Reading. Particle Systems. What are particle systems? Overview

Predicting the future with Newton s Second Law

Optimising the Computational Simulation of Mechanical Models: Designing a Real-Time Mass-Aggregate Physics Engine

Dynamics. Kinematics and Dynamics. Passive vs. Active Dynamics. Passive Dynamics. Passive Dynamics. Particle Systems

Lecture IV: Time Discretization

Ordinary differential equations. Phys 420/580 Lecture 8

Donald Fussell. October 28, Computer Science Department The University of Texas at Austin. Point Masses and Force Fields.

Passive Dynamics and Particle Systems COS 426

Lecture V: The game-engine loop & Time Integration

the gamedesigninitiative at cornell university Lecture 17 Physics and Motion

In the presence of viscous damping, a more generalized form of the Lagrange s equation of motion can be written as

Runga-Kutta Schemes. Exact evolution over a small time step: Expand both sides in a small time increment: d(δt) F (x(t + δt),t+ δt) Ft + FF x ( t)

Modeling and Experimentation: Compound Pendulum

Physically Based Modeling: Principles and Practice Differential Equation Basics

Physically Based Modeling Differential Equation Basics

CS229 Programming Assignment 3: Dynamics

Time scales. Notes. Mixed Implicit/Explicit. Newmark Methods [ ] [ ] "!t = O 1 %

CHAPTER 1 INTRODUCTION TO NUMERICAL METHOD

Modeling and Solving Constraints. Erin Catto Blizzard Entertainment

Fundamentals Physics

1.1 GRAPHS AND LINEAR FUNCTIONS

Computer Animation. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics. Slides courtesy of Leonard McMillan and Jovan Popovic

Physically Based Modeling: Principles and Practice Implicit Methods for Differential Equations

Ordinary differential equations - Initial value problems

Ordinary Differential Equations (ODEs)

Ordinary Differential Equations

PHYS 211 Lecture 9 - Examples of 3D motion 9-1

Rigid Body Dynamics and Beyond

PSE Game Physics. Session (6) Angular momentum, microcollisions, damping. Oliver Meister, Roland Wittmann

CS 378: Computer Game Technology

PDE Solvers for Fluid Flow

(Refer Slide Time 1:25)

Fourth Order RK-Method

Euler s method for solving a differential equation (approximately)

Math 3313: Differential Equations Second-order ordinary differential equations

δ Substituting into the differential equation gives: x i+1 x i δ f(t i,x i ) (3)

Boiling Heat Transfer and Two-Phase Flow Fall 2012 Rayleigh Bubble Dynamics. Derivation of Rayleigh and Rayleigh-Plesset Equations:

Introduction to First Order Equations Sections

Ordinary Differential Equations II

Read textbook CHAPTER 1.4, Apps B&D

Matthew S. Norton PHY 112 Lab Report CL-4 Damped Oscillator: Feynman-Newton Method for Solving First-Order Differential Equations March 2, 2006

MATH 1231 MATHEMATICS 1B Calculus Section 3A: - First order ODEs.

Particle Systems. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2017

Chapter 9b: Numerical Methods for Calculus and Differential Equations. Initial-Value Problems Euler Method Time-Step Independence MATLAB ODE Solvers

Ordinary Differential Equations II

CS 480/680: GAME ENGINE PROGRAMMING

Physics 202 Laboratory 3. Root-Finding 1. Laboratory 3. Physics 202 Laboratory

Simple Harmonic Motion

Mechanics IV: Oscillations

Thursday Simulation & Unity

CS888 Advanced Topics in Computer Graphics: Physics-Based Animation. Jan. 7, 2014

An Introduction to Physically Based Modeling: An Introduction to Continuum Dynamics for Computer Graphics

Figure 1: Doing work on a block by pushing it across the floor.

Simple ODE Solvers - Derivation

Introduction to Process Control

Francis X. Giraldo,

MB4018 Differential equations

Gaussians Distributions, Simple Harmonic Motion & Uncertainty Analysis Review. Lecture # 5 Physics 2BL Summer 2015

3. What type of force is the woman applying to cart in the illustration below?

Revision History Date Version Description Author 03/06/ Initial Version Sergio Miguel Martin. Table of Contents

Integration of Differential Equations

Visual Interactive Simulation, TDBD24, Spring 2006

Physics 132 3/31/17. March 31, 2017 Physics 132 Prof. E. F. Redish Theme Music: Benny Goodman. Swing, Swing, Swing. Cartoon: Bill Watterson

Maps and differential equations

CS-184: Computer Graphics

Lecture 17 - Gyroscopes

Logistic Map, Euler & Runge-Kutta Method and Lotka-Volterra Equations

MATH 312 Section 4.3: Homogeneous Linear Equations with Constant Coefficients

Physics 111. Tuesday, October 05, Momentum

Updated 2013 (Mathematica Version) M1.1. Lab M1: The Simple Pendulum

How to work out really complicated motion. Iteration and Problem Solving Strategies. Let s go. Vertical spring-mass.

Theoretical physics. Deterministic chaos in classical physics. Martin Scholtz

Introduction to Controls

Chapter 3 Acceleration

Physically Based Modeling CS Notes Spring 1997 Particle Collision and Contact

Physics 6010, Fall Relevant Sections in Text: Introduction

Multistep Methods for IVPs. t 0 < t < T

Dan s Morris s Notes on Stable Fluids (Jos Stam, SIGGRAPH 1999)

Motion along a straight line. Physics 11a. 4 Basic Quantities in Kinematics. Motion

2.2 Separable Equations

spring mass equilibrium position +v max

Procedural Animation. D.A. Forsyth

Numerical methods for physics simulations.

Computational Physics (6810): Session 8

Chapter 3 Acceleration

Physics 115/242 The leapfrog method and other symplectic algorithms for integrating Newton s laws of motion

Fundamentals Physics. Chapter 15 Oscillations

Numerical method for approximating the solution of an IVP. Euler Algorithm (the simplest approximation method)

Feedback Basics. David M. Auslander Mechanical Engineering University of California at Berkeley. copyright 1998, D.M. Auslander

Lecture 4. Magic Numbers

Numerical Methods for the Solution of Differential Equations

Chapter 3 Numerical Methods

Differential Equations

Derivation of Kinematic Equations. View this after Motion on an Incline Lab

Chapter 3 Acceleration

Mon Jan Improved acceleration models: linear and quadratic drag forces. Announcements: Warm-up Exercise:

Math background. Physics. Simulation. Related phenomena. Frontiers in graphics. Rigid fluids

Oscillations Simple Harmonic Motion

Transcription:

Particle Systems University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Reading Required: Witkin, Particle System Dynamics, SIGGRAPH 97 course notes on Physically Based Modeling. Witkin and Baraff, Differential Equation Basics, SIGGRAPH 01 course notes on Physically Based Modeling. Optional Hocknew and Eastwood. Computer simulation using particles. Adam Hilger, New York, 1988. Gavin Miller. The motion dynamics of snakes and worms. Computer Graphics 22:169-178, 1988. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 2

What are particle systems? A particle system is a collection of point masses that obeys some physical laws (e.g, gravity, heat convection, spring behaviors, ). Particle systems can be used to simulate all sorts of physical phenomena: University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 3

Particle in a flow field We begin with a single particle with: Position, " x = x % $ # y& y Velocity, v = x = d x dt " dx dt% = $ # dy dt& g(x,t) Suppose the velocity is actually dictated by some driving function g: x = g( x,t) x University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 4

Vector fields At any moment in time, the function g defines a vector field over x: How does our particle move through the vector field? University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 5

Diff eqs and integral curves The equation x = g( x,t) is actually a first order differential equation. We can solve for x through time by starting at an initial point and stepping along the vector field: Start Here This is called an initial value problem and the solution is called an integral curve. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 6

Euler s method One simple approach is to choose a time step, Δt, and take linear steps along the flow: x (t + Δt) = Writing as a time iteration: x (t) + Δt x(t) = x (t) + Δt g( x,t) x i+1 = x i + Δt v i This approach is called Euler s method and looks like: Properties: Simplest numerical method Bigger steps, bigger errors. Error ~ O(Δt 2 ). Need to take pretty small steps, so not very efficient. Better (more complicated) methods exist, e.g., Runge-Kutta and implicit integration. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 7

Particle in a force field Now consider a particle in a force field f. In this case, the particle has: Mass, m Acceleration, a x = d v dt = d 2 x dt 2 The particle obeys Newton s law: f = m a = mx The force field f can in general depend on the position and velocity of the particle as well as time. Thus, with some rearrangement, we end up with: f ( x,x,t) x = m University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 8

Second order equations This equation: x = f ( x,x,t) m is a second order differential equation. Our solution method, though, worked on first order differential equations. We can rewrite this as: x = v " f ( x, v % $,t) v = # $ m & where we have added a new variable v to get a pair of coupled first order equations. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 9

Phase space " x % $ # v & " x% $ # v& " x% " v % $ = $ # v& # f m& Concatenate x and v to make a 6- vector: position in phase space. Taking the time derivative: another 6-vector. A vanilla 1 st -order differential equation. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 10

Differential equation solver Starting with: Applying Euler s method: And making substitutions: Writing this as an iteration, we have: Again, performs poorly for large Δt. " x% " v % $ = $ # v& # f m& x (t + Δt) = x (t) + Δt x(t) x(t + Δt) = x(t) + Δt x(t) x (t + Δt) = x (t) + Δt v (t) x(t + Δt) = x(t) + Δt f ( x,x,t) m x i+1 = x i + Δt v i v i+1 = v f i i + Δt m University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 11

Verlet Integration Also called Størmer s Method Invented by Delambre (1791), Størmer (1907), Cowell and Crommelin (1909), Verlet (1960) and probably others More stable than Euler s method (timereversible as well) University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 12

Forces Each particle can experience a force which sends it on its merry way. Where do these forces come from? Some examples: Constant (gravity) Position/time dependent (force fields) Velocity-dependent (drag) Combinations (Damped springs) How do we compute the net force on a particle? University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 13

Gravity and viscous drag The force due to gravity is simply: f grav = m G p->f += p->m * F->G Often, we want to slow things down with viscous drag: f drag = k v p->f -= F->k * p->v University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 14

Damped spring Recall the equation for the force due to a spring: We can augment this with damping: f = k spring (Δ x r) [ ] f = k spring (Δ x r) + k damp v The resulting force equations for a spring between two particles become: * f 1 = k spring Δ x $ Δ v ( r) Δ x - + k damp & % Δ x Δ x, )/ +, (./ Δ x f 2 = " x 1 % p f 1 = $ 1 # v 1 & Δ x = x r = rest length 1 " x 2 % p 2 = $ # & v 2 x 2 University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 15

deriveval Clear forces Loop over particles, zero force accumulators Calculate forces Sum all forces into accumulators Return derivatives Loop over particles, return v and f/m " v 1 %" v $ 2 % " v $ n $ # f 1 m 1 &# f 2 m 2 & # f n m n % & Return derivatives to solver 1 Apply forces to particles 3 Clear force accumulators University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 16 2 " $ $ $ f 1 $ # F 1 " $ $ $ f 1 $ # x 1 v 1 x 1 v 1 m 1 m 1 F 2 F 3 F nf % & % & " $ $ $ $ # " $ $ $ $ # x 2 v 2 f 2 x 2 v 2 f 2 m 2 m 2 % " x n % $ v $ n $ f n $ & # & m n % " x n % $ v n $ $ f n $ & # & m n

Bouncing off the walls P N Add-on for a particle simulator For now, just simple point-plane collisions A plane is fully specified by any point P on the plane and its normal N. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 17

Collision Detection How do you decide when you ve crossed a plane? v P N x University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 18

Normal and tangential velocity To compute the collision response, we need to consider the normal and tangential components of a particle s velocity. v N v P N v vt v N = ( N v ) N v T = v v N University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 19

Collision Response v N k restitution v N v v T v T " v before v " = v T k restitution v N after Without backtracking, the response may not be enough to bring a particle to the other side of a wall. In that case, detection should include a velocity check: University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell 20