DOC PREVIEW
UT CS 384G - Particle Systems

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1112. Particle Systems2ReadingRequired: 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 Graphics22:169-178, 1988.23What 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:4Particle in a flow fieldWe begin with a single particle with: Position,  Velocity, Suppose the velocity is actually dictated by some driving function g:(,)t=xgx&//dx dtddy dtdt⎡⎤≡= =⎢⎥⎣⎦xvx&xg(x,t)xyxy⎡⎤=⎢⎥⎣⎦x35Vector fieldsAt any moment in time, the function g defines a vector field over x:How does our particle move through the vector field?6Diff eqs and integral curvesThe equation 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:This is called an intial value problem and the solution is called an integral curve.Start Here(,)t=xgx&47Euler’s methodOne simple approach is to choose a time step, ∆t, and take linear steps along the flow:Writing as a time iteration:This approach is called Euler’s method and looks like:Properties: Simplest numerical method Bigger steps, bigger errors. Error ~ O(∆t2).Need to take pretty small steps, so not very efficient. Better (more complicated) methods exist, e.g., “Runge-Kutta” and “implicit integration.”( ) () ()() ( ,)tt t tttt t+∆ = +∆ ⋅=+∆⋅xxxxgx&1ii it+=+∆⋅xx v8Particle in a force fieldNow consider a particle in a force field f.In this case, the particle has: Mass, m Acceleration, The particle obeys Newton’s law: 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:(,,)tm=fxxx&&&mm==fax&&22dddt dt≡= =vaxx&&59This equation:is a second order differential equation.Our solution method, though, worked on first order differential equations.We can rewrite this as:where we have added a new variable v to get a pair of coupled first order equations.Second order equations(,,)tm=⎡⎤⎢⎥⎢⎥=⎣⎦xvfxvv&&(,,)tm=fxvx&&10Phase spaceConcatenate x and v to make a 6-vector: position in phase space.Taking the time derivative: another 6-vector.A vanilla 1st-order differential equation.⎡⎤⎢⎥⎣⎦xv/m⎡⎤⎡ ⎤=⎢⎥⎢ ⎥⎣⎦⎣ ⎦xvvf&&⎡⎤⎢⎥⎣⎦xv&&611Differential equation solverApplying Euler’s method:( ) () ()( ) () ()tt t tttt t tt+∆ = +∆ ⋅+∆ = +∆ ⋅xxxxxx&&&&&Again, performs poorly for large ∆t./ m⎡⎤ ⎡ ⎤=⎢⎥ ⎢ ⎥⎣⎦ ⎣ ⎦xvvf&&++=+∆⋅=+∆⋅11ii iiiittmxx vfvv()() ()(,,)()()tt t ttttt t tm+∆ = +∆ ⋅+∆ = +∆ ⋅xxvfxxxx&&&And making substitutions:Writing this as an iteration, we have:Starting with:12Particle structurem⎡⎤⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦xvfpositionvelocityforce accumulatormassPosition in phase spaceHow do we represent a particle?713Single particle solver interfacem⎡⎤⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦xvf⎡⎤⎢⎥⎣⎦xv/m⎡⎤⎢⎥⎣⎦vf[]6getDimderivEvalgetStatesetState14Particle systemsparticlesn timeIn general, we have a particle system consisting of n particles to be managed over time:⎡⎤⎡ ⎤ ⎡ ⎤⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎣⎦⎣ ⎦ ⎣ ⎦L12121212nnnnmm mxx xvv vff f815Particle system solver interfaceparticlesn timeLL112 21212126nnnnnnmm mxvxv xvff fvv vderivEvalget/setStategetDimFor n particles, the solver interface now looks like:16Particle system diff. eq. solverWe can solve the evolution of a particle system again using the Euler method:111 1111 1111//ii iii iii inn nii inn nnmtm++++⎡⎤⎡⎤ ⎡ ⎤⎢⎥⎢⎥ ⎢ ⎥⎢⎥⎢⎥ ⎢ ⎥⎢⎥⎢⎥ ⎢ ⎥=+∆⎢⎥⎢⎥ ⎢ ⎥⎢⎥⎢⎥ ⎢ ⎥⎢⎥⎢⎥ ⎢ ⎥⎣⎦⎣⎦ ⎣ ⎦xx vvv fxx vvv fMM M917ForcesEach 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?18Particle systems with forcesparticlesn timeforcesF2Fnfnf⎡⎤⎡ ⎤ ⎡ ⎤⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎣⎦⎣ ⎦ ⎣ ⎦L12121212nnnnmm mxx xvv vff fForce objects are black boxes that point to the particles they influence and add in their contributions. We can now visualize the particle system with force objects:F11019Gravity and viscous draggravm=fGp->f += p->m * F->Gdrag dragk=−fvp->f -= F->k * p->vThe force due to gravity is simply:Often, we want to slow things down with viscous drag:20Recall the equation for the force due to a spring:We can augment this with damping:The resulting force equations for a spring between two particles become:Damped spring=−−()spri ngfk xrr = rest length12∆=−xx x111p⎡⎤=⎢⎥⎣⎦xv222p⎡⎤=⎢⎥⎣⎦xv=−−+[() ]spring dampfkxrkv121()spring dampkk⎡⎤⎛⎞∆•∆ ∆=− ∆ − +⎢⎥⎜⎟∆∆⎢⎥⎝⎠⎣⎦=−vx xfxrxxff1121⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥== =⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦⎣⎦⎣⎦L1212121200 0nnnnmm mxx xvv vff fderivEval1. Clear forces• Loop over particles, zero force accumulators2. Calculate forces• Sum all forces into accumulators3. Return derivatives• Loop over particles, return v and f/m121212nnnmm m⎡⎤⎡⎤⎡⎤⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎢⎥⎣⎦⎣⎦⎣⎦vv vff fLApply forcesto particlesClear force accumulators123Return derivativesto solver12121212nnnnmm m⎡⎤⎡ ⎤ ⎡ ⎤⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎢⎥⎢ ⎥ ⎢ ⎥⎣⎦⎣ ⎦ ⎣ ⎦xx xvv vff fLF2F3FnfF122Bouncing off the walls Add-on for a particle simulator For now, just simple point-plane collisionsNPA plane is fully specified by any point P on the plane and its normal N.1223Collision DetectionNvPxHow do you decide when you’ve crossed a plane?24Normal and


View Full Document

UT CS 384G - Particle Systems

Documents in this Course
Shading

Shading

27 pages

Shading

Shading

27 pages

Load more
Download Particle Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Particle Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Particle Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?