Download presentation

Presentation is loading. Please wait.

Published byBryan Mitchell Modified over 3 years ago

1

2
Numerical Integration Jim Van Verth Insomniac Games

3
Talk Summary Going to talk about: Eulers method subject to errors Implicit methods help, but complicated Verlet methods help, but velocity out of step Symplectic methods can be good for both

4
Our Test Case

5

6
x t =? x0x0

7
Constant velocity v x t =? x0x0

8
Constant velocity v x t = x 0 +vt x0x0

9
Constant acceleration v0v0 x0x0 x t = ? a

10
Constant acceleration v0v0 x0x0 x t = ? a

11
Constant acceleration v0v0 x0x0 x t = x 0 + v 0 t + 1/2at 2 a

12
Variable acceleration x0x0 x t = ?

13
Eulers method x0x0 v0v0

14
x0x0 v0v0 x1x1

15
x0x0 v0v0 x1x1 v0v0 a

16
x0x0 v0v0 x1x1 v0v0 a v1v1

17
x0x0 v0v0 x1x1 v1v1

18
x0x0 v0v0 x1x1 v1v1 x2x2

19
x0x0 v0v0 x1x1 v1v1 a v1v1 x2x2

20
x0x0 v0v0 x1x1 v1v1 a v1v1 v2v2 x2x2

21
x0x0 v0v0 x1x1 v1v1 v2v2 x2x2

22
x0x0 v0v0 x1x1 v1v1 v2v2 x2x2

23
x0x0 v0v0 a0a0

24
x1x1 x0x0 v0v0 a0a0

25
x0x0 x1x1 a0a0 v0v0 v0v0

26
v1v1 x0x0 x1x1 v0v0 v0v0 a0a0

27
x0x0 x1x1 v0v0 v1v1

28
x2x2 v2v2 x0x0 x1x1 v0v0 v1v1

29
x0x0 x1x1 v1v1 v0v0

30
Euler Okay for non-oscillating systems Explodes with oscillating systems Adds energy! Very bad!

31
Runge-Kutta methods x0x0 v0v0

32
x0x0 v0v0 v 0.5

33
Runge-Kutta methods x0x0 v 0.5

34
Runge-Kutta methods x0x0 v 0.5 x1x1

35
Runge-Kutta methods x0x0 v0v0

36
Runge-Kutta 4 Very stable and accurate Conserves energy well But expensive: four evaluations of derivative

37
Implicit methods x0x0 v0v0

38
x0x0 v0v0 x1x1

39
x0x0 v0v0 x1x1 v1v1

40
x0x0 v0v0 v1v1

41
x0x0 v0v0 x1x1 v1v1

42
x0x0 v0v0 x1x1 v1v1

43
x0x0 v0v0 x1x1 v1v1

44
x0x0 v0v0 x1x1 v1v1

45
Backward Euler Not easy to get implicit values More expensive than Euler But tends to converge: better but not ideal

46
Verlet x0x0 x -1

47
Verlet x0x0 x -1

48
Verlet x0x0 at2at2 x -1

49
Verlet x0x0 x1x1 x -1 at2at2

50
Verlet x0x0 x1x1 x -1 at2at2

51
Verlet Leapfrog Verlet Velocity Verlet

52
Verlet Very stable Cheap Not too bad, but have estimated velocity

53
Symplectic Euler x0x0 v0v0 a0a0

54
x0x0 v0v0 v1v1 v0v0 a0a0

55
x0x0 v1v1

56
x0x0 v1v1

57

58
Cheap and stable! Not as accurate as RK4

59
Symplectic Euler Cheap and stable! Not as accurate as RK4 - but hey, its a game

60
Demo Time

61
Which To Use? With simple forces, standard Euler might be okay But constraints, springs, etc. require stability Recommendation: Symplectic Euler Generally stable Simple to compute (just swap velocity and position terms) More complex integrators available if you need them -- see references

62
References Burden, Richard L. and J. Douglas Faires, Numerical Analysis, PWS Publishing Company, Boston, MA, Witken, Andrew, David Baraff, Michael Kass, SIGGRAPH Course Notes, Physically Based Modelling, SIGGRAPH Eberly, David, Game Physics, Morgan Kaufmann, 2003.

63
References Hairer, et al, Geometric Numerical Integration Illustrated by the St ö rmer/Verlet method, Acta Numerica (2003), pp Robert Bridson, Notes from CPSC 533d: Animation Physics, University of BC.

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google