simulation deformable objects
play

Simulation Deformable Objects High-quality deformable simulation is - PowerPoint PPT Presentation

Accelerated Complex-Step RAN LUO, The University of New Mexico, Finite Difference for WEIWEI XU, Zhejiang University TIANJIA SHAO, University of Leeds Expedient Deformable HONGYI XU, Google AI YIN YANG, Clemson University Simulation


  1. Accelerated Complex-Step RAN LUO, The University of New Mexico, Finite Difference for WEIWEI XU, Zhejiang University TIANJIA SHAO, University of Leeds Expedient Deformable HONGYI XU, Google AI YIN YANG, Clemson University Simulation

  2. Deformable Objects ❑ High-quality deformable simulation is important ❑ Well-known problem but computational expensive  Nonlinearity: repeated evaluation of internal force and its gradient … [Xu et al, 2014] [Teng et al, 2015] [Zheng & James, 2012] [Zhao & Barbič , 2013]

  3. Nonlinearity ❑ A key challenge is the nonlinearity  Largely come from the strain energy  Define strain-stress relation just based on the strain energy 𝐆 = 𝐉 + 𝜖𝐯 , , where 𝜖𝐲 ❑ More complicated energies are not uncommon [Martin et al, 2011] [Xu et al, 2015]

  4. Will a Numerical Derivative Work? ❑ The best-known method is finite difference  + = +  + 2 ( ) ( ) ( ) ( ) O f x h f x f x h h 0 0 0 + − ( ) ( ) f x h f x   + O 0 0 ( ) ( ) f x h 0 h ❑ Does not work in general due to the subtractive cancellation  In theory, the smaller perturbation is, the better approximation we obtain  In practice, smaller perturbation does not converge, explode at certain

  5. Will a Numerical Derivative Work? Newton method

  6. Will a Numerical Derivative Work? Forward difference

  7. Rounding Error ❑ We have limited digits to represent a real number ❑ Precision depends on how many digits we could allocate a = −  − 3 1999.99, 1999.99 1. 999 1 0 a a − = =   4 4.95 1 0 E round a =  3 | | 1 999 .9 9 a 1.99 9 10 ❑ Known as machine epsilon ( for double precision) 1.1 10 −  16  However, it is NOT the evil of finite difference  True problem appears when we have a subtraction between two similar values

  8. Subtractive Cancellation ❑ Another example and b = a = b =  a =  3 3 1998.88, 1999.99, 1.99 8 10 1.99 9 10 − − − ( ) ( ) a b a b = E − subtraction | | a b −  − − 3 (199 9.99 1.998) 10 (19 99.99 1998.88) = − 19 9.99 1998.8 9 8 = 0 . 1 ❑ Subtraction eliminates the first three significant digits  Rounding eliminates the least important digit ❑ Bigger perturbation has bigger approximation error but smaller perturbation leads to subtractive cancellation

  9. Complex Step Finite Difference (CSFD) ❑ Apply the perturbation with complex Tayler expansion  + = +  + O * * * 2 ( ) ( ) ( ) ( ) ( ) f x hi f x f x hi h 0 0 0 ( ) ( )  + = +  + * * * 3 I m ( ) Im ( ) ( ) ( ) ( ) f x hi f x f x hi O h 0 0 0 ( ) + * I m ( ) f x hi  0 = + 2 ( ) ( ) O f x h 0 h

  10. Complex Step Finite Difference (CSFD) ❑ We can have very small perturbation ( ) to fully 10 − 40 approach to the target  The approximate error can be reduced to the same order of machine epsilon  As accurate as analytic derivative x e = ( ) f x + + 4 2 1 x x − + − + 4 3 2 4 2 1 x x x x  = x ( ) f x e + + 4 2 1 x x

  11. Too Good to Be True? ❑ Promoting the original real function to a complex function  Can be easily implemented especially given a good complex library  It could also be expensive (orders of magnitude in some cases) ❑ CSFD can be accelerated  A full complex promotion is a waste (only imaginary part is needed)  Perturbation is a very small value, can be treated as an infinitesimal  Higher order h term can be discarded

  12. An Example ❑ Full promotion  +   +    2 2 k k i = → + = + 1/ * 1/ m m ( ) ( )  cos s in  f x x f x hi r 0 0 0   m m ❑ Imaginary only Full promotion 13.1 sec ( ) + *  I m ( )   f x hi Imaginary only 9.49 sec 1 0 =  1/ m  si n  r Infinitesimal trick 0.056 sec (233X)   h h m Analytic 0.064 sec ❑ By treating h as an infinitesimal         1/ m 1 1 1 h r  =  =  = 1/ 1/ 1/ m m m  sin      r r r       h m h m h rm rm

  13. Composite Functions ❑ Functions in real-world applications are complicated involving =  A chain of binary operators ( ) ( ) ( ) ( ) f x f x f x f x 1 2 k =  Nested operators ( ) ( ( ( ))) f x f f f 1 2 3 ❑ The key idea: isolate the propagation of imaginary perturbation ❑ Let etc., we have  = + + + = + ( ) ( ) ( ) ( ) ( ) f x f x a b a a b b f x a b 1 2 1 1 2 1 1 2 1 1 1  Each time a new comes, number of addends doubles with an and a a b f k k k appended

  14. Complicated Functions (cont.) ❑ The path to leaf determines the shape of an addend ❑ An is the real part value and is the perturbation (imaginary) a b k k  We do not need any leaves with more than two b k  We could pre-compute product of all a A =   = k A a a a a a b b 1 2 3 1 2 3 2 a 3

  15. Higher-order Derivative & Tensor ❑ Multi-complex number, recursively defined   − = +  1 n n , , z z i z z 1 2 1 2 n ❑ We can have MC Tayler expansion, and MSCFD becomes ( ) + + + + Im ( ) f x hi hi hi 0 1 2 = n + ( ) 2 n ( ) ( ) O f x h n h ❑ Cauchy-Riemann formulation extends CSFD/MSCFD to tensor functions  − −  − 1 1 n n z z − − = + =  1 1 1 2 n n n  z z z i − − 1 2 n 1 1 n n   z z 2 1

  16. Derivative of Matrix Inverse

  17. Highly Accurate in Simulation

  18. Intuitive Hyperelastic Simulation ❑ Hyperelastic models with minor implementation efforts ❑ CSFD/MSCFD further enables us to design customized energy  ( ) − =  − + − − 2/3 2 ( 3 ) log 1 4( 1) E J I J volume C 2

  19. Intuitive Hyperelastic Simulation

  20. More Customized Energy

  21. Model Derivative for All

  22. Convenient Inverse Design

  23. Thank You We are hiring ☺ https://github.com/lrquad/MCSFD

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