Modeling Dynamic Deformation with Mass Points and Springs

Modeling Dynamic Deformation with Mass Points and Springs

Deformable Objects ETH Zurich ETH Zurich 1. Discretization of an object into Modeling Dynamic Deformation mass points with Mass Points and Springs 2. Representation of forces between mass points with springs 3. Computation of the dynamics deformable mass-spring system Movie Movie Movie Matthias Teschner Teschner M Teschner - Deformable Modeling Seminar – Wintersemester 02/031 M Teschner - Deformable Modeling 2 Outline Virtual Clothing ETH Zurich ETH Zurich Motivation • Simulation of cloth based on Model Components deformable surfaces Mass Points (polygonal mesh) Springs • Realistic simulation of cloth with Forces different fabrics such as wool, Computation of the Dynamic Behavior cotton or silk for garment design Explicit Numerical Integration Implicit Numerical Integration Higher-Order Numerical Integration Stability and Performance Aspects Performance Thalmann Time and Space Adaptive Sampling Damping Force-Deformation Relationship Model Topology Strasser Baraff M Teschner - Deformable Modeling 3 M Teschner - Deformable Modeling 4 1 Virtual Clothing Facial Animation ETH Zurich ETH Zurich • Simulation of facial expressions based on • deformable surfaces • deformable volumes •muscles • Animation of face models from speech and mimic parameters Thalmann Choi Seoul National University Terzopoulos M Teschner - Deformable Modeling 6 M Teschner - Deformable Modeling 7 Medical Simulation Artificial Life ETH Zurich ETH Zurich • Simulation of deformable soft tissue • Simulation of systems consisting of • Surgical planning • sensors for perception • Medical training • behavioral rules • Swiss NCCR Co-Me www.co-me.ch • physically-based representation of motor functions Teschner Prediction of the surgical outcome in craniofacial surgery Virtual endoscopy Terzopoulos Szekely Kuehnapfel Laparoscopic (endoscopic) simulation M Teschner - Deformable Modeling 8 M Teschner - Deformable Modeling 9 2 Games Outline ETH Zurich ETH Zurich • Deformable structures are challenging for computer games Motivation Model Components Mass Points Springs Forces Computation of the Dynamic Behavior Explicit Numerical Integration Implicit Numerical Integration Higher-Order Numerical Integration Stability and Performance Aspects Performance Time and Space Adaptive Sampling Damping Niederberger Mueller Gross Novodex Force-Deformation Relationship Model Topology M Teschner - Deformable Modeling 10 M Teschner - Deformable Modeling 11 Mass Points Elastic Springs ETH Zurich ETH Zurich Spring stiffness is characterized by k Initial spring length L class POINT Current spring length l { public: float mass; L F Deformation linear proportional to force: float position[3]; l F = k()L − l Hooke’s law . } Elasticity: Ability of a spring to return to its initial form when the deforming force is removed. M Teschner - Deformable Modeling 12 M Teschner - Deformable Modeling 13 3 Forces at Mass Points Model - Summary ETH Zurich ETH Zurich ext Internal forces Fint External forces F x •Gravity • Discretization of an object into mass points x3 1 • All forces, which are • Definition of the connectivity L1,k1 not caused by springs L3,k3 (topology, adjacencies of mass points) x0 • Model parameters: • Points: mass, initial position, velocity L ,k 2 2 • Springs: stiffness, initial length Resulting force at point i x2 • Definition of external forces (gravity) = int + ext x − x Fi Fi Fi Fint = k ()x − x − L i 0 0 ∑ i i 0 i − i|i∈{}1,2,3 xi x0 M Teschner - Deformable Modeling 15 M Teschner - Deformable Modeling 17 Outline Static Equilibrium ETH Zurich ETH Zurich T System of mass points X = ()x ,x 0 1 x Motivation 1 Model Components Mass Points ()x − x − L L Fint = k 1 0 ()x − x Springs 0 x − x 1 0 Forces 1 0 Computation of the Dynamic Behavior x0 ()x − x − L ()x − x − L Explicit Numerical Integration k 1 0 − k 1 0 Implicit Numerical Integration x − x x − x x Higher-Order Numerical Integration − KX = − 1 0 1 0 0 ()x − x − L ()x − x − L x Stability and Performance Aspects − k 1 0 k 1 0 1 Time and Space Adaptive Sampling − − x1 x0 x1 x0 Damping Force-Deformation Relationship Model Topology Static Equilibrium: Fint = −KX = Fext M Teschner - Deformable Modeling 18 M Teschner - Deformable Modeling 19 4 From Statics to Dynamics Mass-Point Dynamics ETH Zurich ETH Zurich Consideration of dynamics Motion equation for mass point i at time point t − = ext = + ext () KX F 0 KX(t) F t damping mass position force at mass point coefficient Motion equation for a system of mass points 2 () () d xi t dxi t 2 m +γ = F d X()t i 2 i M = KX(t) + Fext ()t dt dt dt 2 acceleration damping force force linear proportional to velocity Incorporation of damping (Stokes friction) • second-order differential equation 2 () () • Newton’s equation or motion equation in Langrange form d X t + dX t = + ext () M 2 D KX(t) F t •force F is used for acceleration and damping dt dt • simplified form ma = F if damping is neglected M Teschner - Deformable Modeling 20 M Teschner - Deformable Modeling 21 Rewriting the Problem Problem ETH Zurich ETH Zurich Reduction of an second-order differential equation to two coupled first-order differential equations. We have: Initial position x Initial velocity v d 2x ()t dx ()t m i +γ i = F Derivative of position x with respect to time. i dt 2 dt i Derivative of velocity v with respect to time. dx ()t dv ()t F ()t −γv ()t i = v ()t i = i i dt i dt m () dv ()t F ()t −γv ()t i dxi t = () i = i i vi t dt dt mi Goal: Computation of position x over time. velocity acceleration M Teschner - Deformable Modeling 22 M Teschner - Deformable Modeling 24 5 Explicit Numerical Integration Euler Method ETH Zurich ETH Zurich Euler Method ()−γ () ()= () ()= F t v t Leonard Euler: x' t v t v' t 1707 (Basel) – 1783 (Petersburg) f(t) Error O(h2) m ()= ()= Start with initial values x t0 x0 v t0 v0 () () Compute v' t0 x' t0 t ()= ( ) ()= ( ) ≤ ≤ + t0 t0 +h Assume v' t v' t0 x' t x' t0 t0 t t0 h (+ )= ()+ ()= ()+ () Compute x t0 h x t0 hx' t0 x t0 hv t0 •Initial value f(t0) ()−γ () F t0 v t0 • Compute the derivative at t Compute v(t + h )= v ()t + hv' ()t = v ()t + h 0 0 0 0 0 m • Move from t0 to t0 +h using the derivative at t0 ( F(t) is computed from x(t) and external forces! ) M Teschner - Deformable Modeling 25 M Teschner - Deformable Modeling 26 Problems Avoiding Instability ? ETH Zurich ETH Zurich Numerical integration is inaccurate. f (t + h )= f ()t + f ' ()t h + O(h2 ) (Taylor series) • No general solution to avoid instability Euler step Error for complex mass-spring systems. • A smaller time step increases the chance for stability. Inaccuracy can cause instability. • A larger time step speeds up h2 the simulation. 0 ≤ e < ⋅ f "(t + h) f(t) 2 • Parameters and topology of the Error mass-spring system, and external forces influence the stability of a system. h t M Teschner - Deformable Modeling 29 M Teschner - Deformable Modeling 30 6 Improving the Accuracy 1 – Leap-Frog Improving the Accuracy 2 ETH Zurich ETH Zurich Euler Method Runge-Kutta Method v(t + h / 2) = v(t − h / 2) + h⋅a(t) Error O(h3) f(t) Error O(h2) f(t) Error O(h3) time step h is significantly 2a x(t + h) = x(t) + h⋅ v(t + h / 2) larger compared to expl. Euler 1 Euler Leap-Frog 2b t t t0 t0 +h t0 t0 +h/2 t0 +h initV() // v(0) = v(0) – h/2a(0) • Compute the derivative at t0 ... ... •Move to t +h/2 addForces(); //F(t) addForces(h); //F(t) 0 • Compute the derivative at t • Compute the derivative at t +h/2 positionEuler(h); //x=x(t+h)=x(t)+hv(t) velocityEuler(h); //v=v(t+h)=v(t)+ha(t) 0 0 velocityEuler(h); //v=v(t+h)=v(t)+ha(t) positionEuler(h); //x=x(t+h)=x(t)+hv(t+h) • Move from t0 to t0 +h • Move from t0 to t0 +h ... ... using the derivative at t0 using the derivative at t0 +h/2 M Teschner - Deformable Modeling 32 M Teschner - Deformable Modeling 33 Second-Order Runge-Kutta Method Comparison (Midpoint Method) ETH Zurich ETH Zurich Carl Runge: F()t −γv ()t 1856 (Bremen) – 1927 (Goettingen) x'()t = v ()t a()x(t),v(t) = Wilhelm Kutta: m 1867 (Pitschen) – 1944 (Fuerstenfeldbruck) Euler Method Runge-Kutta Method = Compute v at t k 1 v(t) • One computation of the • Two computations of the derivative per time step derivative per time step = ()() () 2 3 Compute a at t l1 a x t , v t • Error O(h ) • Error O(h ) h Compute v at t+h/2 (the midpoint) k = v(t) + l • Allows larger time steps 2 1 2 = ()+ h Compute a at t+h/2 with x and v at t+h/2 l 2 ax t k1 ,k 2 • Accuracy of Runge-Kutta per time step is higher. 2 • Computational complexity similar if time step Compute x at t+h with its velocity at t+h/2 x()t + h = x(t) + hk for Runge-Kutta is twice the time step for Euler. 2 hn 0 ≤ e < ⋅ f (n) (x) • Does Runge-Kutta really allow faster ()+ = + Compute v at t+h with the acceleration at t+h/2 v t h v(t) hl 2 n simulations of mass-spring systems? M Teschner - Deformable Modeling 34 M Teschner - Deformable Modeling 35 7 Fourth-Order Runge-Kutta Method Implementation ETH Zurich ETH Zurich Euler Method • Straightforward • Compute the derivative at t0 (1) • Compute spring forces • Move from t0 to t0 +h/2 • Add external forces using the derivative at t0 (1) f(t) 5 • Update positions 2 Error O(h ) • Compute the derivative at t0 +h/2 (2) •Update velocities • Move from t to t +h/2 0 0 4 using the derivative at t0 +h/2 (2) 3 Runge-Kutta Method • Compute spring forces • Compute the derivative at t +h/2 (3) 1 0 • Add external forces • Move from t to t +h 0 0 t •Compute auxiliary positions and velocities using the derivative at t +h/2 (3) t0 t0 +h/2 t0 +h 0 • requires additional copies of data • Compute the derivative at t +h (4) 0 • once for second-order

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    17 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us