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

simulation deformable objects
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Accelerated Complex-Step Finite Difference for Expedient Deformable Simulation

RAN LUO, The University of New Mexico, WEIWEI XU, Zhejiang University TIANJIA SHAO, University of Leeds HONGYI XU, Google AI YIN YANG, Clemson University

slide-2
SLIDE 2

Deformable Objects

❑High-quality deformable simulation is important ❑Well-known problem but computational expensive

 Nonlinearity: repeated evaluation of internal force and its gradient

[Zheng & James, 2012] [Zhao & Barbič, 2013] [Xu et al, 2014]

[Teng et al, 2015]

slide-3
SLIDE 3

Nonlinearity

❑A key challenge is the nonlinearity

 Largely come from the strain energy  Define strain-stress relation just based on the strain energy

❑More complicated energies are not uncommon , 𝐆 = 𝐉 + 𝜖𝐯 𝜖𝐲 ,

where

[Martin et al, 2011] [Xu et al, 2015]

slide-4
SLIDE 4

Will a Numerical Derivative Work?

❑The best-known method is finite difference ❑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

2

( ) ( ) ( ) ( ) f h x h f x f x h   + + + = O ) ( ) ( ( ) ( ) f x h f h h x f x + −   + O

slide-5
SLIDE 5

Will a Numerical Derivative Work?

Newton method

slide-6
SLIDE 6

Will a Numerical Derivative Work?

Forward difference

slide-7
SLIDE 7

Rounding Error

❑We have limited digits to represent a real number ❑Precision depends on how many digits we could allocate ❑Known as machine epsilon ( for double precision)

 However, it is NOT the evil of finite difference  True problem appears when we have a subtraction between two similar values

1999.99, a =

3

1.99 10 9 a = 

3 4

1999.99 1. 999 | | 1 9 1 4.95 1 .9 999

round

a a E a

 =   − − =

16

1.1 10− 

slide-8
SLIDE 8

Subtractive Cancellation

❑Another example

1999.99, a =

3

1.99 10 9 a = 

3

( ) ( ) | | (199 1 9.99 1.998) (19 9 10 99.99 1998.88) 19 9.99 1998.8 . 8

subtraction

a b a b E a b − − −  − = − − − − = = 1998.88, b =

3

1.99 10 8 b = 

and

❑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

slide-9
SLIDE 9

Complex Step Finite Difference (CSFD)

❑Apply the perturbation with complex Tayler expansion

* * * 2

( ) ) ( ) ( ( ( ) ) f f hi x hi f x h x  + = +  + O

( )

( )

* * * 3

I ) m ( ) Im ( ) ( ( ( ) ) f x hi f x x h f hi  + +  + = O

( )

2 *

I ) m ( ) ( ) ( f x h hi f x h  + + = O

slide-10
SLIDE 10

Complex Step Finite Difference (CSFD)

❑We can have very small perturbation ( ) to fully approach to the target

 The approximate error can be reduced to the same order of machine epsilon  As accurate as analytic derivative

40

10−

4 2

( ) 1

x

f e x x x = + +

4 3 2 4 2

4 2 1 ( ) 1

x

x x x f x x x e x − + − +  = + +

slide-11
SLIDE 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

slide-12
SLIDE 12

An Example

❑Full promotion

1/ * 1/

2 2 s ( ) ( ) cos in

m m

f x x f x hi r m k k i m       = → + =    + +  +

❑Imaginary only

( )

* 1/

I ) 1 si m ( n

m

f x hi r m h h  +   =     

❑By treating h as an infinitesimal

1/ 1/ 1/ 1/

1 1 1 sin

m m m m

h h h h rm r r r r m m rm       = =             =     

Full promotion 13.1 sec Imaginary only 9.49 sec Infinitesimal trick 0.056 sec (233X) Analytic 0.064 sec

slide-13
SLIDE 13

Composite Functions

❑Functions in real-world applications are complicated involving

 A chain of binary operators  Nested operators

❑The key idea: isolate the propagation of imaginary perturbation ❑Let etc., we have

 Each time a new comes, number of addends doubles with an and a appended

2 1

( ) ( ) ( ) ( )

k

f x f x f x f x =

1 2 3

( ) ( ( ( ))) f x f f f =

1 1 1

( ) f x a b = +

1 2 1 1 2 1 1 2

( ) ( ) ( ) ( ) f f x x a b a a b b = +  + +

k

f

k

a

k

b

slide-14
SLIDE 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)

 We do not need any leaves with more than two  We could pre-compute product of all

k

a

k

b

k

b

k

a

1 2 3

a A a a  = 

1 2 3 2 3

a b A a a b =

slide-15
SLIDE 15

Higher-order Derivative & Tensor

❑Multi-complex number, recursively defined ❑We can have MC Tayler expansion, and MSCFD becomes ❑Cauchy-Riemann formulation extends CSFD/MSCFD to tensor functions

 

1 1 2 1 2

, ,

n n n

z z i z z

= + 

( )

1 2 ( ) 2

( ( ) Im ) ( )

n n n

f x hi hi f x h hi h + + + + + = O

1 1 2 1 2 2 1 1 1 1 1 1 n n n n n n n n

z z z z z i z z

− − − − − −

  − = + =    

slide-16
SLIDE 16

Derivative of Matrix Inverse

slide-17
SLIDE 17

Highly Accurate in Simulation

slide-18
SLIDE 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( 2 1)

volume C

E J J I  

+ − − = −

slide-19
SLIDE 19

Intuitive Hyperelastic Simulation

slide-20
SLIDE 20

More Customized Energy

slide-21
SLIDE 21

Model Derivative for All

slide-22
SLIDE 22

Convenient Inverse Design

slide-23
SLIDE 23

Thank You

https://github.com/lrquad/MCSFD

We are hiring ☺