particle dynamics
play

Particle dynamics Second-order motion Particle system Forces - PowerPoint PPT Presentation

Particle dynamics Second-order motion Particle system Forces Constraints Second order motion analysis (advanced) Particle system Particles are objects that have mass, position, and velocity, but without spatial extent


  1. Particle dynamics

  2. • Second-order motion • Particle system • Forces • Constraints • Second order motion analysis (advanced)

  3. 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

  4. A Newtonian particle • First order motion is sufficient, if • a particle state only contains position • no inertia • particles are extremely light • Most likely particles have inertia and are affected by gravity and other forces • This puts us in the realm of second order motion

  5. Second-order ODE What is the differential equation that describes the behavior of a mass point? f = m a What does f depend on? x ( t ) = f ( x ( t ) , ˙ x ( t )) ¨ m

  6. Second-order ODE x ( t ) = f ( x ( t ) , ˙ x ( t )) ¨ = f ( x , ˙ x ) m This is not a first oder ODE because it has second derivatives Add a new variable, v ( t ), to get a pair of coupled first order equations { ˙ x = v v = f /m ˙

  7. Phase space ⎡ ⎤ x 1 x 2 Concatenate position and ⎢ ⎥ � x ⎢ ⎥ � x 3 ⎢ ⎥ velocity to form a 6-vector: = ⎢ ⎥ v v 1 ⎢ ⎥ position in phase space ⎢ ⎥ v 2 ⎣ ⎦ v 3 First order differential  ˙  v �  � � x x = f ( ) = equation: velocity in f ˙ v v m the phase space

  8. Quiz A mass point attached to a spring obeys Hooke’s Law: f = − K ( x − ¯ x ) What is the ODE that describes this motion?

  9. Integrate second-order ODE Express a second-order motion in two first-order ODEs, ✓ ˙ ◆ ✓ x ◆ ✓ ◆ ✓ ◆ x 0 1 0 = + ˙ ( K /m )¯ − K /m v 0 v x Integrate both position and velocity via explicit Euler ✓ ˙ ✓ x 1 ✓ x 0 ◆ ◆ ◆ x 0 = + h ˙ v 1 v 0 v 0 ✓ x 0 ◆ ✓ ◆ v 0 = + h K /m (¯ x − x 0 ) v 0

  10. Quiz • Integrate the same ODE using midpoint method. ✓ ˙ ◆ ✓ x ◆ ✓ ◆ ✓ ◆ x 0 1 0 = + ˙ ( K /m )¯ − K /m v 0 v x

  11. • Second-order motion • Particle system • Forces • Constraints • Second order motion analysis (advanced)

  12. Particle structure Particle position x a point in the phase space v velocity f force accumulator mass m

  13. Solver interface solver interface system solver 6 GetDim particle x x v Get/Set State v f v m Deriv Eval f m

  14. Particle system structure system x 1 x 2 x n v n v 1 v 2 particles ... f n f 1 f 2 m n m 1 m 2 n time

  15. Particle system structure solver system solver interface 6n GetDim particles x 1 x 2 x n n time Get/Set State . . . v 1 v 2 v n v 1 v 2 v n Deriv Eval f 1 f 2 f n . . . m 1 m 2 m n

  16. 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

  17. • Second-order motion • Particle system • Forces • Constraints • Second order motion analysis (advanced)

  18. Forces • Constant gravity • Position dependent force fields, springs • Velocity dependent drag

  19. Particle systems with forces system x 1 x 2 x n v n v 1 v 2 particles ... f n f 1 f 2 m n m 1 m 2 n time ... forces F 1 F 2 F m

  20. Force structure • Unlike particles, forces are heterogeneous (type-dependent) • Each force object “knows” • which particles it influences • how much contribution it adds to the force accumulator

  21. Particle systems with forces system x 1 x 2 x n v n v 1 v 2 particles ... f n f 1 f 2 m n m 1 m 2 n time ... forces F 1 F 2 F m

  22. Gravity x 1 x 2 x n Unary force: f = m G v 1 v 2 v n f 1 f 2 f n m 1 m 2 m n F Exerting a constant p force on each particle . . . sys apply_fun particle system G p->f += p->m*F->G

  23. Viscous drag At very low speeds for small x 1 x 2 x n v 1 v 2 v n particles, air resistance is f 1 f 2 f n m 1 m 2 m n approximately: F p f drag = − k drag v . . . sys apply_fun particle system k p->f += p->v*F->k

  24. Attraction Act on any or all pairs of particles, depending on their positions l f p = − k m p m q l x p | l | 2 | l | x q f q = − f p l = x p − x q

  25. Attraction x p x q v p v q l f p = − k m p m q f p f q m p m q | l | 2 | l | F p sys apply_fun particle system k

  26. Damped spring x p � � ˙ l · l l f p = − k s ( | l | − r ) + k d | l | | l | r f q = − f p | l | l = x p − x q x q

  27. Damped spring x p x q v p v q � � ˙ l · l l f p f q f p = − k s ( | l | − r ) + k d | l | | l | m p m q F r p k d sys apply_fun particle system k s

  28. Quiz For an ideal spring, what is the force it applies to two particles, p and q, attached to it. Write down the pseudo code for its “apply_fun”. x p x q v p v q f p f q m p m q F r p sys apply_fun particle system k s

  29. Deriv Eval 1. Clear force accumulators x 1 x 2 x n v n v 1 v 2 2. Invoke apply_force ... f n f 1 f 2 functions m n m 1 m 2 ... F 1 F 2 F m 3. Return derivatives to solver � ˙ � v � � x = f ˙ v m

  30. ODE solver Euler’s method: x ( t 0 + h ) = x ( t 0 ) + hf ( x , t ) x t +1 = x t + h ˙ x t v t +1 = v t + h ˙ v t

  31. Euler step solver interface system solver x t +1 = x t + h ˙ x t GetDim 3. particles v t +1 = v t + h ˙ v t 4. 2. x 1 x 2 x n 5. Advance time Get/Set State . . . v 1 v 2 v n time 1. v 1 v 2 v n Deriv Eval Deriv Eval f 1 f 2 f n . . . m 1 m 2 m n

  32. Quiz solver interface system solver GetDim Get/Set State Deriv Eval How to modify the algorithm to use midpoint method?

  33. Example: freefall motion • Solution is v ( t ) = v 0 + a 0 t x ( t ) = x 0 + v 0 t + 1 2 a 0 t 2 • v ( t ) only needs 1st order accuracy, but x ( t ) demands 2nd order accuracy

  34. Quiz • Let particle p start at position x 0 with velocity v 0 , what is the state of p after two time steps ( h ) using the midpoint method? Assume that gravity is the only force present in the scene.

  35. • Second-order motion • Particle system • Forces • Constraints • Second order motion analysis (advanced)

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

  37. Collision detection Particle is on the legal side if ( x − p ) · N ≥ 0 Particle is within of the wall if � x N ( x − p ) · N < � v Particle is heading in if p v · N < 0

  38. Collision response Normal and tangential components x v T v N = ( N · v ) N N v N v T = v − v N v

  39. Collision response Before After collision collision v ′ − k r v N v T v T v N v v ′ = v T − k r v N coefficient of restitution: 0 ≤ k r < 1

  40. Contact Conditions for resting contact: 1. particle is on the collision surface 2. zero normal velocity If a particle is pushed into the contact plane a contact force f c is exerted to cancel the normal component of f N x v p f f N f T

  41. • Second-order motion • Particle system • Forces • Constraints • Second order motion analysis (advanced)

  42. Linear analysis • Linearly approximate acceleration  �  �  � d x x x = f ( , t ) = A + a 0 v v v dt • Split up analysis into different cases • constant acceleration • linear acceleration  �  �  � d x 0 I x + a 0 = v − K − D v dt

  43. Constant acceleration • Solution is v ( t ) = v 0 + a 0 t x ( t ) = x 0 + v 0 t + 1 2 a 0 t 2 • v ( t ) only needs 1st order accuracy, but x ( t ) demands 2nd order accuracy

  44. Linear acceleration • When K (or D) dominates ODE, what type of motion does it correspond to? � � � � � � � � d x 0 I x x = A = v − K − D v v dt • Need to compute the eigenvalues of A

  45. Linear acceleration � � u 1 Assume is an eigenvalue of A , is the α u 2 corresponding eigenvector � � � � � � 0 I u 1 u 1 = α − K − D u 2 u 2 � � u The eigenvector of A has the form α u Assuming D is linear combination of K and I (Rayleigh damping) That means K and D have the same eigenvectors

  46. Linear acceleration � � u For any u , if is an eigenvector of A, the following α u must be true � � � � � � 0 I u u = α − K − D α u α u Now assume u is an eigenvector for both K and D − λ k u − αλ d u = α 2 u � α = − 1 (1 2 λ d ) 2 − λ k 2 λ d ±

  47. Eigenvalue approximation • If D dominates α ≈ − λ d , 0 • exponential decay • If K dominates √ � α ≈ ± λ k − 1 • oscillation

  48. Analysis • Constant acceleration (e.g. gravity) • demands 2nd order accuracy for position • Position dependence (e.g. spring force) • demands stability, oscillatory motion • looks at imaginary axis • Velocity dependence (e.g. damping) • demands stability, exponential decay • looks at negative real axis

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend