東工大長谷川(晶)研 PHYSICS SIMULATION Rigid body simulator introduction Continuum simulation The Documents http://haselab.net/class/vr user:basic passwd:prog asela aselab
Introduction for Multi-rigid body physics simulator
Taxonomy of physics simulator asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Computation Methods for constraint forces are not limited to Spring and Damper. Multi Body Dynamics simulator Analytical method Impulse penalty method method Full coordinate method Reduced Moore & coordinate Hahn 88 Williams 89 Jean method LCP based formularization Jacques Mirtich 96 Springhead1 Moreau Velocity base Acceleration method base Armstrong 79 Stewart 96 ODE Featherstone 83 Springhead2 Baraff 89 OpenTissue  Velocity based LCP is widely used. Havok Novodex ODE …  reference : Kenny Erleben: Multibody Dynamics Animation Lecture 12 Department of Computer Science Copenhagen University 3
Rigid body motion equation asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Two objects + Restraint + External Force Constraint Other external Velocity and Inertia force m j I j force, gravity Angular velocity M u f c f e v j  j r j r i m i I i v i  i  Many rigid bodies + constraints + external forces 4
Constraint Examples asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Joint(Hinge) (Contacts are mentioned later) :relative velocity/angular velocity at the joint point w j :constraint forces and torques on the joint point w 1   1  e 1 i w 4   4 e 2 w 2,   2 w 6   6 w 5   5 w 3   3 e 3 velocity Constraint coordinate system  Only rotate the hinge axis e 3 : force velocity  Rotate hinge axis e 3 freely = torque not work : force 5
Embed constraints into equation of motion asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Express equation of motion on the constraint coordinate. → use w ,  v i ,  i : velocity or angular velocity of object i in world coordinate. w : relative velocity and angular velocity of j from i in constraint coordinate v j ,  j r j w r i J row1 v i ,  i u Matrix expression of cross product J row4 u express w 2 w 3, w 5 w 6, with the same way 6
Embed constraints into equation of motion asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研 v i ,  i : velocity, angular velocity of object i v j ,  j : velocity, angular velocity of object j v j ,  j r j w r i w velocity/angular u velocity/angular v i ,  i velocity in constraint of rigid body coordinate coordinate f j ,  j : constraint forces given from i to j in world coordinate  j : constraint forces given from i to j in constraint coordinate f j ,  j r j  r i f i ,  i  force/torque in constraint coordinate f c force/torque in world coordinate 7
Embed constraints asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Transform equation of motion to consider constraint easily  Ally with constraint condition (hinge’s case) Constraint : Substitute to equation of motion : Solve the simultaneous equations 8
Simulation Procedure asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Calculate constraint force   Update rigid body velocity  Update rigid body position posture of all position rigid bodies orientation quaternion A matrix transforming velocity into Quaternion differential 9
Contact Constraint asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Contact relative velocity at joint point contact force on contact point  Do not penetrate each other = velocity  is not zero when w is zero or  is zero when w is not zero: force  Static friction or kinetic friction : velocity force  Torque is 0 : velocity force 10
Embed Constraint (for contact) asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Transform motion equation to consider restraint easily  Ally with constraint condition velocity force velocity force At first, solve this case and find  i . If  i does not satisfy w i = 0 then fix  i to a constant and solve w i There are two variables in an equation at a glance, but actually solve one variable with consider the other variable as a constant. 11
Summary asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Velocity based LCP is widely used.  Formulate constraints into velocity based LCP and find constraint force. Then do the stepping of the simulation  Transform equation of motion of solids with Jacobian J → Equation of motion by  and  .  Formulate constraints by equations of  and  and substitute it into equation of motion. → The equations come to LCP  Solve LCP and find  update velocity and position.  Constraints  Joints are lines, contacts are polylines.  It looks there are two variables. But one of the variables comes to constant. 12
Computation asel aselab 東工大長谷川(晶)研  Simultaneous equations solution  Approximate solution for LCP  Error-correction method 13
How to Solve Simultaneous Equation asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Restraint included motion equation two variable in one equation +complementary condition of  i and  i (one is a variable and the other is a constant ) LCP : Linear Complementary Problem  Solve LCP  Pivoting method ・・・ strict slow speed  Iterative method ・・・ high speed, precision depends on iteration number of times  Matrix-splitting method  Jacobi method  Gauss–Seidel method, SOR method  Newton's method 14
Gauss‒Seidel method / SOR method asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Matrix-splitting method  A method to solve large simultaneous equations approximately with small computation amount. If recurrence relation is converged, So This recurrence relation converge if A is positive symmetry matrix. Long narrow objects or objects with small inertia converge slow.  Choose D as a simple matrix such as diagonal matrix  Jacobi method choose D as diagonal entries of A and choose F as the rest. Gauss-Seidel method is improved version of Jacobi method. 15
Gauss‒Seidel method / SOR method asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Gauss–Seidel method Gauss–Seidel method : update  one row at one time Jacobi method : update  at once renewed under renewing not-renewed  SOR method  Just accelerate Gauss–Seidel method slightly Gauss–Seidel method 1.6times acceleration  Converge quickly 16
LCP and Gauss‒Seidel method asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Gauss–Seidel method renew  one row at one time renewed under renewing not-renewed  Can Calculate Contact force perfectly  Do not invade each other =  is not zero when ω is zero or  is zero when ω is not zero: if  1 is renewed to a negative number, then let  1   Static friction or kinetic friction : Use renewed  1 to check “  1  2  1 ”,if protrude, clip with  1  1 17
Simulation examples asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研 18
Continuum simulation
Continuum simulation asel asel aselab 東工大長谷川(晶)研 aselab 東工大長谷川(晶)研  Coil voltage v V  Mass point ( ) ( ) di t dv t   ( ) ( ) V t L f t m dt dt t t  Continuum Simulation is needed not only in time but also in space dimension.  wave  2  2 ( , ) ( , ) h x t h x t  2 c   2 2 x x t  solid t     ( , , , , , ) E i j k l x y z Discretize Hooke‘s law ij ijkl kl and equation of motion f  Ku       M u Ku B u  fluid                 x y z
Continuum simulation asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Continuum simulation  continuous → deal with limited representative points not infinity  many methods for taking representative points  Grid points in Euler coordinate system are representative points  Common for fluid and wave surface simulation  Grid do not move  Mass come from surroundings and go out  Grid points in Lagrange coordinate system are representative points  Finite element method  Grids move with mass  Grids collapse or turn over under large deformation  Particle method : representative points are particles  Express mass with freely moving particles  Large deformation is ok because of no assumption at beginnings  Collision detection is important
Finite Element Method asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Soft objects(meat, jelly, human body)
Soft objects asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  cloth  Mass point+ Spring-damper model  Omit parts of stress
Fluid asel aselab 東工大長谷川(晶)研 asel aselab 東工大長谷川(晶)研  Liquid  Gas
Recommend
More recommend