1cs533d-winter-2005 Notes  Assignment 1 is not out yet :-)  courses/533d-winter-2005.

Slides:



Advertisements
Similar presentations
Numeric Integration Methods Jim Van Verth Red Storm Entertainment
Advertisements

Formal Computational Skills
Chapter 4: Basic Properties of Feedback
1 Computer Graphics Physical simulation for animation Case study: The jello cube The Jello Cube Mass-Spring System Collision Detection Integrators.
Integration Techniques
Ordinary Differential Equations
Notes Assignment questions… cs533d-winter-2005.
1cs533d-term Notes  Assignment 2 is up. 2cs533d-term Modern FEM  Galerkin framework (the most common)  Find vector space of functions that.
1cs533d-term Notes  Braino in this lecture’s notes about last lectures bending energy…
1cs542g-term Notes. 2 Solving Nonlinear Systems  Most thoroughly explored in the context of optimization  For systems arising in implicit time.
1cs542g-term Notes  Notes for last part of Oct 11 and all of Oct 12 lecture online now  Another extra class this Friday 1-2pm.
1cs533d-winter-2005 Shallow water equations  From last time, using eta for depth=h+H:  We’ll discretize this using “splitting” Handle the material derivative.
1Notes. 2Heightfields  Especially good for terrain - just need a 2d array of heights (maybe stored as an image)  Displacement map from a plane  Split.
1cs533d-winter-2005 Notes  Read “Physically Based Modelling” SIGGRAPH course notes by Witkin and Baraff (at least, rigid body sections) An alternative.
1cs542g-term Notes  Final exam: December 10, 10am-1pm X736 (CS Boardroom)  Another extra class this Friday 1-2pm.
1cs533d-term Notes  For using Pixie (the renderer) make sure you type “use pixie” first  Assignment 1 questions?
1cs542g-term Notes  Extra class this Friday 1-2pm  Assignment 2 is out  Error in last lecture: quasi-Newton methods based on the secant condition:
1Notes. 2 Building implicit surfaces  Simplest examples: a plane, a sphere  Can do unions and intersections with min and max  This works great for.
1Notes. 2 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
1Notes  Text:  Motion Blur A.3  Particle systems 4.5 (and 4.4.1, 6.6.2…)  Implicit Surfaces  Classic particle system papers  W. Reeves, “Particle.
1Notes  Reference  Witkin and Baraff, “Physically Based Modelling” course, SIGGRAPH 2001  Link on the course website.
1cs533d-winter D: Animation Physics  533d-winter-2005  Course schedule Slides online, but you need to.
1cs533d-winter-2005 Notes  Please read Fedkiw, Stam, Jensen, “Visual simulation of smoke”, SIGGRAPH ‘01.
MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro.
Linear dynamic systems
1cs533d-winter-2005 Notes  More optional reading on web for collision detection.
Interactive Animation of Structured Deformable Objects Mathieu Desbrun Peter Schroder Alan Barr.
example: four masses on springs
1cs426-winter-2008 Notes  If you’re interested, read Bridson, Hourihan, Nordenstam, “Curl noise for procedural fluid flow”, SIGGRAPH ‘07.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
1cs533d-winter-2005 Notes  Assignment 2 going okay? Make sure you understand what needs to be done before the weekend  Read Guendelman et al, “Nonconvex.
CS533D - Animation Physics
1cs426-winter-2008 Notes  Course project: Will be due at the end of the term You can do it in pairs Create an animation that combines an algorithm for.
1cs533d-winter-2005 Notes  More reading on web site Baraff & Witkin’s classic cloth paper Grinspun et al. on bending Optional: Teran et al. on FVM in.
1cs533d-term Notes  list Even if you’re just auditing!
1cs533d-winter-2005 Notes  Finish up time integration methods today  Assignment 1 is mostly out Later today will make it compile etc.
1cs533d-winter-2005 Notes  Some example values for common materials: (VERY approximate) Aluminum: E=70 GPa =0.34 Concrete:E=23 GPa =0.2 Diamond:E=950.
1cs533d-term Notes. 2 Poisson Ratio  Real materials are essentially incompressible (for large deformation - neglecting foams and other weird composites…)
1cs533d-term Notes  Typo in test.rib --- fixed on the web now (PointsPolygon --> PointsPolygons)
1cs426-winter-2008 Notes  Sorry about missed classes  Assignment 2: matchmove and particles  Final project.
Ordinary Differential Equations (ODEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / Implicit ODE Solvers Daniel Baur ETH Zurich, Institut.
1cs533d-winter-2005 Notes  Assignment 2 instability - don’t worry about it right now  Please read D. Baraff, “Fast contact force computation for nonpenetrating.
1Notes. 2 Time integration for particles  Back to the ODE problem, either  Accuracy, stability, and ease-of- implementation are main issues  Obviously.
1cs426-winter-2008 Notes. 2 Velocity fields  Velocity field could be a combination of pre-designed velocity elements E.g. explosions, vortices, …  Or.
Ordinary Differential Equations (ODEs)
Dynamics 101 Jim Van Verth Red Storm Entertainment
3.7. O THER G AME P HYSICS A PPROACHES Overview of other game engine physics approaches.
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
Erin Catto Blizzard Entertainment Numerical Integration.
ME451 Kinematics and Dynamics of Machine Systems
Lecture 13: Stability and Control I We are learning how to analyze mechanisms but what we’d like to do is make them do our bidding We want to be able to.
Lecture 14: Stability and Control II Reprise of stability from last time The idea of feedback control Remember that our analysis is limited to linear systems.
Large Steps in Cloth Simulation - SIGGRAPH 98 박 강 수박 강 수.
Progress in identification of damping: Energy-based method with incomplete and noisy data Marco Prandina University of Liverpool.
 d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu.
Programming assignment #2 Solving a parabolic PDE using finite differences Numerical Methods for PDEs Spring 2007 Jim E. Jones.
Canonical Correlation Psy 524 Andrew Ainsworth. Matrices Summaries and reconfiguration.
Large Timestep Issues Lecture 12 Alessandra Nardi Thanks to Prof. Sangiovanni, Prof. Newton, Prof. White, Deepak Ramaswamy, Michal Rewienski, and Karen.
Particle Systems. Applications Particle systems are broadly defined for: Explosion Cloth Fluid And more… It is integrated into many animation software,
Modeling Transient Response So far our analysis has been purely kinematic: The transient response has been ignored The inertia, damping, and elasticity.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Lecture 4: Numerical Stability
Mechanical Engineering at Virginia Tech
Autonomous Cyber-Physical Systems: Dynamical Systems
Physics 319 Classical Mechanics
Chapter 2 A Survey of Simple Methods and Tools
GPAT – Chapter 7 Physics.
Presentation transcript:

1cs533d-winter-2005 Notes  Assignment 1 is not out yet :-)  courses/533d-winter-2005

2cs533d-winter-2005 Monotonicity  Test equation with real, negative True solution is x(t)=x 0 e t, which smoothly decays to zero, doesn’t change sign (monotone)  Forward Euler at stability limit: x=x 0, -x 0, x 0, -x 0, …  Not smooth, oscillating sign: garbage!  So monotonicity limit stricter than stability  RK3 has the same problem But the even order RK are fine for linear problems TVD-RK3 designed so that it’s fine when F.E. is, even for nonlinear problems!

3cs533d-winter-2005 Monotonicity and Implicit Methods  Backward Euler is unconditionally monotone No problems with oscillation, just too much damping  Trapezoidal Rule suffers though, because of that half-step of F.E. Beware: could get ugly oscillation instead of smooth damping For nonlinear problems, quite possibly hit instability

4cs533d-winter-2005 Summary 1  Particle Systems: useful for lots of stuff  Need to move particles in velocity field  Forward Euler Simple, first choice unless problem has oscillation/rotation  Runge-Kutta if happy to obey stability limit Modified Euler may be cheapest method RK4 general purpose workhorse TVD-RK3 for more robustness with nonlinearity (more on this later in the course!)

5cs533d-winter-2005 Summary 2  If stability limit is a problem, look at implicit methods e.g. need to guarantee a frame-rate, or explicit time steps are way too small  Trapezoidal Rule If monotonicity isn’t a problem  Backward Euler Almost always works, but may over-damp!

6cs533d-winter-2005 Second Order Motion

7cs533d-winter-2005 Second Order Motion  If particle state is just position (and colour, size, …) then 1st order motion No inertia Good for very light particles that stay suspended : smoke, dust… Good for some special cases (hacks)  But most often, want inertia State includes velocity, specify acceleration Can then do parabolic arcs due to gravity, etc.  This puts us in the realm of standard Newtonian physics F=ma  Alternatively put: dx/dt=v dv/dt=F(x,v,t)/m (i.e. a(x,v,t) )  For systems (with many masses) say dv/dt=M -1 F(x,v,t) where M is the “mass matrix” - masses on the diagonal

8cs533d-winter-2005 What’s New?  If x=(x,v) this is just a special form of 1st order: dx/dt=v(x,t)  But since we know the special structure, can we take advantage of it? (i.e. better time integration algorithms) More stability for less cost? Handle position and velocity differently to better control error?

9cs533d-winter-2005 Linear Analysis  Approximate acceleration:  Split up analysis into different cases  Begin with first term dominating: constant acceleration e.g. gravity is most important

10cs533d-winter-2005 Constant Acceleration  Solution is  No problem to get v(t) right: just need 1st order accuracy  But x(t) demands 2nd order accuracy  So we can look at mixed methods: 1st order in v 2nd order in x

11cs533d-winter-2005  Dependence on x and v dominates: a(x,v)=-Kx-Dv  Do the analysis as before:  Eigenvalues of this matrix? Linear Acceleration

12cs533d-winter-2005 More Approximations…  Typically K and D are symmetric semi-definite (there are good reasons) What does this mean about their eigenvalues?  Often, D is a linear combination of K and I (“Rayleigh damping”), or at least close to it Then K and D have the same eigenvectors (but different eigenvalues) Then the eigenvectors of the Jacobian are of the form (u,  u) T [work out what  is in terms of K and D ]

13cs533d-winter-2005 Simplification   is the eigenvalue of the Jacobian, and  Same as eigenvalues of  Can replace K and D (matrices) with corresponding eigenvalues (scalars) Just have to analyze 2x2 system

14cs533d-winter-2005 Split Into More Cases  Still messy! Simplify further  If D dominates (e.g. air drag, damping) Exponential decay and constant  If K dominates (e.g. spring force)

15cs533d-winter-2005 Three Test Equations  Constant acceleration (e.g. gravity) a(x,v,t)=g Want exact (2nd order accurate) position  Position dependence (e.g. spring force) a(x,v,t)=-Kx Want stability but low damping Look at imaginary axis  Velocity dependence (e.g. damping) a(x,v,t)=-Dv Want stability, smooth decay Look at negative real axis

16cs533d-winter-2005 Explicit methods from before  Forward Euler Constant acceleration: bad (1st order) Position dependence: very bad (unstable) Velocity dependence: ok (conditionally monotone/stable)  RK3 and RK4 Constant acceleration: great (high order) Position dependence: ok (conditionally stable, but damps out oscillation) Velocity dependence: ok (conditionally monotone/stable)

17cs533d-winter-2005 Implicit methods from before  Backward Euler Constant acceleration: bad (1st order) Position dependence: ok (stable, but damps) Velocity dependence: great (monotone)  Trapezoidal Rule Constant acceleration: great (2nd order) Position dependence: great (stable, no damping) Velocity dependence: good (stable but only conditionally monotone)

18cs533d-winter-2005 Setting Up Implicit Solves  Let’s take a look at actually using Backwards Euler, for example  Eliminate position, solve for velocity:  Linearize at guess v k, solving for v n+1 ≈ v k +∆v  Collect terms, multiply by M

19cs533d-winter-2005 Symmetry  Why multiply by M?  Physics often demands that and are symmetric And M is symmetric, so this means matrix is symmetric, hence easier to solve (Actually, physics generally says matrix is SPD - even better) If the masses are not equal, the acceleration form of the equations results in an unsymmetric matrix - bad.  Unfortunately the matrix is usually unsymmetric Makes solving with it considerably less efficient See Baraff & Witkin, “Large steps in cloth simulation”, SIGGRAPH ‘98 for one solution: throw out bad part

20cs533d-winter-2005 Specialized 2nd Order Methods  This is again a big subject  Again look at explicit methods, implicit methods  Also can treat position and velocity dependence differently: mixed implicit-explicit methods

21cs533d-winter-2005 Symplectic Euler  Like Forward Euler, but updated velocity used for position  Some people flip the steps (= relabel v n )  (Symplectic means certain qualities are preserved in discretization; useful in science, not necessarily in graphics)  [work out test cases]

22cs533d-winter-2005  Constant acceleration: bad Velocity right, position off by O(∆t)  Position dependence: good Stability limit No damping!  Velocity dependence: ok Monotone limit Stability limit Symplectic Euler performance

23cs533d-winter-2005 Tweaking Symplectic Euler  [sketch algorithms]  Stagger the velocity to improve x  Start off with  Then proceed with  Finish off with

24cs533d-winter-2005 Staggered Symplectic Euler  Constant acceleration: great! Position is exact now  Other cases not effected Was that magic? Main part of algorithm unchanged (apart from relabeling) yet now it’s more accurate!  Only downside to staggering At intermediate times, position and velocity not known together May need to think a bit more about collisions and other interactions with outside algorithms…

25cs533d-winter-2005 A common explicit method  May see this one pop up:  Constant acceleration: great  Velocity dependence: ok Conditionally stable/monotone  Position dependence: BAD Unconditionally unstable!

26cs533d-winter-2005 An Implicit Compromise  Backward Euler is nice due to unconditional monotonicity Although only 1st order accurate, it has the right characteristics for damping  Trapezoidal Rule is great for everything except damping with large time steps 2nd order accurate, doesn’t damp pure oscillation/rotation  How can we combine the two?

27cs533d-winter-2005 Implicit Compromise  Use Backward Euler for velocity dependence, Trapezoidal Rule for the rest:  Constant acceleration: great (2nd order)  Position dependence: great (2nd order, no damping)  Velocity dependence: great (unconditionally monotone)