reading
play

Reading Required: ! Witkin, Particle System Dynamics , SIGGRAPH 01 - PDF document

Reading Required: ! Witkin, Particle System Dynamics , SIGGRAPH 01 course notes on Physically Based Modeling. ! Witkin and Baraff, Differential Equation Basics , SIGGRAPH 01 course notes on Physically Based Modeling. Particle Systems


  1. Reading Required: ! Witkin, Particle System Dynamics , SIGGRAPH ’01 course notes on Physically Based Modeling. ! Witkin and Baraff, Differential Equation Basics , SIGGRAPH ’01 course notes on Physically Based Modeling. Particle Systems 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. cse457-16-particles 1 cse457-16-particles 2 What are particle systems? Particle in a flow field A particle system is a collection of point masses We begin with a single particle with: that obeys some physical laws (e.g, gravity, heat convection, spring behaviors, …).   x =   ! Position, x Particle systems can be used to simulate all sorts   y of physical phenomena:   dx dt / d x ≡ = =  ! Velocity, & v x  dt  dy dt /  Suppose the velocity is actually dictated by some driving function g : = & x g x ( , ) t y g ( x ,t) x x cse457-16-particles 3 cse457-16-particles 4

  2. Diff eqs and integral Vector fields curves At any moment in time, the function g defines a The equation vector field over x : = & 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 How does our particle move through the vector field? This is called an intial value problem and the solution is called an integral curve . cse457-16-particles 5 cse457-16-particles 6 Euler’s method Particle in a force field One simple approach is to choose a time step, ∆ t , Now consider a particle in a force field f . and take linear steps along the flow: + ∆ ≈ + ∆ ⋅ & x ( t t ) x ( ) t t x ( ) t In this case, the particle has: ≈ + ∆ ⋅ x ( ) t t g x ( , ) t ! Mass, m 2 d v d x Writing as a time iteration: ≡ = = ! Acceleration, && a x 2 dt dt + = + ∆ ⋅ i 1 i i x x t v The particle obeys Newton’s law: This approach is called Euler’s method and looks = = && like: f m a m x 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 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.” cse457-16-particles 7 cse457-16-particles 8

  3. Second order equations Phase space This equation: = f x v ( , , ) t   x Concatenate x and v to make a 6- && x   m vector: position in phase space .   v is a second order differential equation .   & x Taking the time derivative: another Our solution method, though, worked on first order   &   v 6-vector. differential equations. We can rewrite this as:   &   x v = A vanilla 1 st -order differential     =   & x v &   v  f / m  equation.   f x v ( , , ) t   = & v   m where we have added a new variable v to get a pair of coupled first order equations. cse457-16-particles 9 cse457-16-particles 10 Differential equation solver Particle structure Starting with:   &   How do we represent a particle? x v =     &   v  f / m  Applying Euler’s method: Position in phase space + ∆ = + ∆ ⋅ & x ( t t ) x ( ) t t x ( ) t   x position   + ∆ = + ∆ ⋅ & & && x ( t t ) x ( ) t t x ( ) t v   velocity   f force accumulator And making substitutions:    m  mass + ∆ = + ∆ ⋅ x ( t t ) x ( ) t t v ( ) t & f x x ( , , ) t + ∆ = + ∆ ⋅ & & x ( t t ) x ( ) t t m Writing this as an iteration, we have: + = + ∆ ⋅ i 1 i i x x t v i f + = + ∆ ⋅ i 1 i v v t m Again, performs poorly for large ∆ t. cse457-16-particles 11 cse457-16-particles 12

  4. Single particle solver interface Particle systems In general, we have a particle system consisting of n particles to be managed over time: [ ] getDim 6   x   v     particles n time getState x   f       v setState  m    v derivEval     f / m      x x x 1 2 n      v v v      1 2 n L      f f f 1 2 n       m  m   m  1 2 n cse457-16-particles 13 cse457-16-particles 14 Particle system solver interface Particle system diff. eq. solver We can solve the evolution of a particle system For n particles, the solver interface now looks like: again using the Euler method:  +      i 1 i i x x v 1 1 1       particles n time + i 1 i i v v f / m       1 1 1 1       = + ∆ M M t M       + i 1 i i x x v       get/setState n n n getDim       + i 1 i i  v   v   f / m  n n n n derivEval 6 n x v x v L x v 1 1 2 2 n n f f f 1 2 L n v v v 1 2 n m m m 1 2 n cse457-16-particles 15 cse457-16-particles 16

  5. Forces Particle systems with forces Each particle can experience a force which sends Force objects are black boxes that point to the it on its merry way. particles they influence and add in their contributions. Where do these forces come from? Some examples: We can now visualize the particle system with force objects: ! Constant (gravity) ! Position/time dependent (force fields) nf particles n time forces ! Velocity-dependent (drag) ! N-ary (springs) How do we compute the net force on a particle? F 1 F 2 F nf      x x x 1 2 n      v v v      1 2 n L      f f f 1 2 n       m  m   m  1 2 n cse457-16-particles 17 cse457-16-particles 18 Gravity and viscous drag Damped spring A spring is a simple examples of an “N-ary” force. The force due to gravity is simply: Recall the equation for the force due to a spring: = f m G = − − grav f k ( x r ) spring p->f += p->m * F->G We can augment this with damping: = − − + f [ k ( x r ) k v ] spring damp The resulting force equations become: Often, we want to slow things down with viscous drag :     ∆ ⋅∆ ∆ v x x = − ∆ − +     f k ( x r ) k = − f k v ∆ ∆ 1 spring damp  x  x     drag drag = − f f 2 1   x =  1 p->f -= F->k * p->v p  1   v 1 ∆ = − x x x 1 2 r = rest length   x =  2 p  2  v  2 cse457-16-particles 19 cse457-16-particles 20

  6. derivEval Bouncing off the walls 1. Clear forces • Loop over particles, zero force accumulators ! Add-on for a particle 2. Calculate forces simulator • Sum all forces into accumulators ! For now, just simple 3. Return derivatives point-plane collisions • Loop over particles, return v and f /m      x x x Clear force 1 2 n      1 v v v accumulators      N 1 2 n L P  =  =   =  f 0 f 0 f 0 1 2 n       m  m   m  1 2 n F F F F nf 1 2 3 Apply forces 2      x x x to particles 1 2 n      v v v      A plane is fully specified by any point P on the 1 2 n L      f f f plane and its normal N . 1 2 n       m  m   m  1 2 n      v v v 1 2 n      L f f f      1 2 n Return derivatives 3       m  m   m  1 2 n to solver cse457-16-particles 21 cse457-16-particles 22 Collision Detection Normal and tangential velocity To compute the collision response, we need to How do you decide when you’ve crossed a plane? consider the normal and tangential components of a particle’s velocity. v N v x v v v T N P N P = ⋅ v ( N v N ) N = − v v v T N cse457-16-particles 23 cse457-16-particles 24

Recommend


More recommend