Particle Dynamics Particles are objects that have mass, position, - - PowerPoint PPT Presentation

particle dynamics
SMART_READER_LITE
LIVE PREVIEW

Particle Dynamics Particles are objects that have mass, position, - - PowerPoint PPT Presentation

Particle system Particle Dynamics Particles are objects that have mass, position, and velocity, but without spatial extent Particles are the easiest objects to simulate but they can be made to exhibit a wide range of objects Applications


slide-1
SLIDE 1

Particle Dynamics

Particle system

Particles are objects that have mass, position, and velocity, but without spatial extent Particles are the easiest objects to simulate but they can be made to exhibit a wide range of objects

Applications

One particle Particle system Forces Collisions

Overview

slide-2
SLIDE 2

A Newtonian Particle

f = ma

What is the differential equation that describes the behavior of a mass point? What does f depend on?

¨ x(t) = f(x(t), ˙ x(t)) m

Second order equations

Add a new variable, v(t), to get a pair of coupled first

  • rder equations

This is not in our standard form because it has second derivatives

¨ x(t) = f(x(t), ˙ x(t)) m

{ ˙

x = v ˙ v = f/m

Phase space

x v

  • =

        x1 x2 x3 v1 v2 v3         Concatenate position and velocity to form a 6-vector: position in phase space First order differential equation: velocity in the phase space ˙ x ˙ v

  • =

v

f m

  • Particle structure

x v f m

Particle

position velocity force accumulator mass

a point in the phase space

slide-3
SLIDE 3

Solver interface

system solver solver interface

x v f m

particle GetDim

6

Get/Set State

x v

Deriv Eval

v

f m

One particle Particle system Forces Collisions

Overview

system

Particle system structure

n time ... x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn particles system

Particle system structure

solver solver interface

GetDim

6n

Get/Set State

x1 v1 x2 v2 xn vn . . .

Deriv Eval

vn

fn mn

v1

f1 m1

v2

f2 m2

. . .

particles time n

slide-4
SLIDE 4

Deriv Eval

Clear forces: loop over particles, zero force accumulator Calculate forces: sum all forces into accumulator Gather: loop over particles, copy v and f/m into destination array

One particle Particle system Forces Collisions

Overview Forces

Constant

gravity

Position/time dependent

force fields, springs

Velocity dependent

drag

system particles n time

Particle systems with forces

... x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn F1 F2 Fm ... forces

slide-5
SLIDE 5

Force structure

Unlike particles, forces are heterogeneous (type- independent) Each force object “knows”

which particles it influences how much contribution it adds to the force accumulator

system particles n time

Particle systems with forces

... x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn forces F1 F2 Fm ... F

Gravity

p sys apply_fun G particle system

. . .

x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn

p->f += p->m*F->G

Unary force: f = mG Exerting a constant force

  • n each particle

F

Viscous drag

k sys particle system p

. . .

x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn

apply_fun p->f += p->v*F->k

At very low speeds for small particles, air resistance is approximately: fdrag = −kdragv

slide-6
SLIDE 6

Attraction

Act on any or all pairs of particles, depending on their positions xp xq l fq = −fp fp = −k mpmq |l|2 l |l| l = xp − xq

Attraction

p sys apply_fun k particle system

F

xp vp fp mp xq vq fq mq

fp = −k mpmq |l|2 l |l|

Damped spring

fp = −

  • ks(|l| − r) + kd

˙ l · l |l|

  • l

|l| r | l | xp xq l = xp − xq fq = −fp

Damped spring

p sys apply_fun ks particle system

F

xp vp fp mp xq vq fq mq

kd r

fp = −

  • ks(|l| − r) + kd

˙ l · l |l|

  • l

|l|

slide-7
SLIDE 7

Deriv Eval

... x1 v1 f1 m1 x2 v2 f2 m2 xn vn fn mn

  • 1. Clear force accumulators

F1 F2 Fn ...

  • 2. Invoke apply_force

functions

  • 3. Return derivatives to solver

˙ x ˙ v

  • =

v

f m

  • ODE solver

Equation of motion for a particle: ˙ x ˙ v

  • =

v

f m

  • Canonical differential equation:

˙ x = f(x, t) Euler’s method: x(t0 + h) = x(t0) + hf(x, t) xt+1 = xt + h ˙ xt vt+1 = vt + h ˙ vt

Euler step

Evaluate derivatives

update forces and evaluate new derivatives

Get States Update states Set States Advance time

Euler step

system

GetDim Deriv Eval

Get/Set State

solver solver interface xt+1 = xt + h ˙ xt vt+1 = vt + h ˙ vt 3. time

  • 5. Advance

time Deriv Eval

1.

. . . vn

fn mn

v1

f1 m1

v2

f2 m2

2.

x1 v1 x2 v2 xn vn . . .

Get State Set State

particles 4.

slide-8
SLIDE 8

One particle Particle system Forces Collisions

Overview Particle Interaction

We will revisit collision when we talk about rigid body simulation For now, just simple point-plane collisions

Collision detection

vT vN v x N

Normal and tangential components vN = (N · v)N vT = v − vN

Collision detection

vT vN v p x N

Particle is on the legal side if Particle is heading in if Particle is within of the wall if

slide-9
SLIDE 9

Collision response

v vT vN Before collision v vT −krvN After collision coefficient of restitution: 0 ≤ kr < 1

v = vT − krvN

Contact

p N

Conditions for contact:

f fN fT

If a particle is pushed into the contact plane a contact force fc is exerted to cancel the normal component of f

x

  • 1. particle is on the collision surface

v

  • 2. zero normal velocity

What’s next?

How do we impose constraints on the particles?

Project 1 grading session

It’s due on next Tuesday (01/31) before the class This means that your executable needs to be created before 11:00 01/31/06 Sumit will run a grading session with each group

  • n Tuesday and Wednesday

You need to sign up for a time slot TODAY!

slide-10
SLIDE 10

Animation artifact

If your artifact is smaller then 5M, mail it to csci520@usc.edu Otherwise, burn it onto a CD and bring it to the class on Thursday (2/2) We will show them in the class and you will vote for your favorite artifact