430 likes | 579 Views
Simulation and Animation. Rigid Body Simulation. The next few lectures …. Comming up …. Dynamic simulation . Movement of point masses, rigid bodies, systems of point masses etc. with respect to Forces Body charcteristics (mass, shape)
E N D
Simulation and Animation Rigid Body Simulation
Dynamic simulation • Movement of point masses, rigid bodies, systems of point masses etc. with respect to • Forces • Body charcteristics (mass, shape) • Derivation of accelerations from properties and physical laws • Dynamic of point masses • Dynamic of rigid bodies
Dynamic simulation • Newtons Axioms • Withoutexternalforces, a bodymovesuniformly (Inertia) • An externalforceFappliedto amassmresults in an accelerationa:F = ma • Actio= reactio
Point dynamics • Dynamic simulationofparticles • Position r, massm, velocityv,accelerationa, but noextend • ForcesF acton particles F,a,v,rare 3D vectors!!!
Point dynamics • Dynamic simulationofparticles • Multiple forcesmayacton particles • Forcesareaddedbyvectoraddition • F isusually a functionof time • Massmightchangeas well • Change ofmomentum(Impuls) withchangeof time
Point dynamics • Particleshavenointernalstructure • 3 DOF = degreesoffreedom (positiononly) • Directkinematic: froma v r • Indirectkinematic: fromrandboundaryconditions v a
Point dynamics • Relation betweenforceFandaccelerationa • Directdynamics Point mass
Point dynamics • ImportantForces • Gravity • Hooke's Law • Friction
Point dynamics • Linear momentum(Impuls) • Force F act on centerofmass • Force • Conservationofmomentum • Example: elastic push
Point dynamics • Angular momentum (Drall) • Torque(Drehmoment) • Conservationof angular momentum p r Moment of inertia: I = mr2
Point dynamics • Angular velocityof a point (rate atwhichthepointisrotating): magnitudeofchange • Notation:
Point dynamics • Analog forrotationmatrixR - itchangesunder angular velocity • Aggregate movementof a bodypoint • (r0/r(t): position in local/worldspacecoordinatesystem)
Point dynamics • Relation between angular momentumandangular velocity • InertiatensorI (Trägheitstensor) Example:Skater Symmetrictensor
Point dynamics Summary
Rigid body simulation • Idea • Combinationofmanysmallparticlesto a rigid body • Bodiesthat do not deform – theyarestiff • They do not penetrate • Theybounce back iftheycollide • Rigid convexpolyhedraofconstantdensity • 6 DOF insteadof 3n DOF (fornparticles) • Distinguishbetween • Movement ofcenterofmass(CM) • Rotation around(CM)
Volume integral overentire body Massdensity (= specificweight = Mass/Volume) Rigid body simulation • MassMin continuouscase small, discrete mass points
Rigid body simulation • CM (centerofmass)in continuouscase
Rigid bodysimulation • Dynamic simulationof rigid bodies • Motion consistoftranslationaland angular component • Velocity v(t) is rate ofchangeofpositionr(t) over time • v(t) = r´(t) • v(t) is linear velocityatcenterofmass • Bodies also have a spin • About an axis (vector) throughthecenterofmass • Magnitude ofthevectordefineshow fast thebodyisspinning
Rigid body simulation • Translation and Rotation: • Rotation R: • 3*3 Matrix • Redundancies • only 3 DOF local/fixedcoordinate system CM
Rigid body simulation Rotation Translation
Rigid body simulation • Momentum • Movement of CM • Force Fextissumof all externalforces Fext,i Fext R
Rigid body simulation • Angular momentum • InertiatensorI
Rigid body simulation • Angular momentum • InertiatensorI in continuouscase x,y,z coordinates Kronecker-symbol
Rigid bodysimulation • Translation vs. Rotation MassInertiaMoment (Trägheitsmoment) m Velocity Angular Velocity v =dr/dt = d/dt Momentum Angular Momentum p = mv L = I = r x p Force Torque F = dp/dt T = r x F = dL/dt KinetcEnergyKineticEnergy E = ½ mv2 E = ½ I2
Rigid body simulation • Properties oftheInertiatensor • Diagonal elementsaremomentsofinertiawithrespecttocoordinateaxes • Itissymmetricand real • Hasthreeprincipalaxis (eigenvectors) • Eigenvectorsare orthogonal: directionsofinertia (Hauptträgheitsachsen) • Eigenvalues are real: momentsofinertia (Hauptträgheitsmomente)
Rigid body simulation • Inertiatensor • In this (directionsofinertia) coordinatesystem, I canbediagonalizedby RIRT, where R is a rotationmatrix: • Inertiamoment (scalar) forrotationaroundaxisn (normalized)
Rigid body simulation • Torqueofsingle „bodyelement“ • Total torque • Important: startingpointofforce • Equationsofmotionforrotation(Euler equationsforfixedcoordinatesystem)
Rigid body simulation • State vectorof a rigid body • Constants: • InertiatensorIKS • MassM Position Orientation (rotation matrix) Impuls Angular momentum
Rigid body simulation • Derived variables
Rigid body simulation • Equations of motion
Rigid body simulation • System ofordinary partial differential equations • Initial boundaryproblem • Structure • In general, numericsolution (Integration) • Explicit solve: Euler, Runge-Kutta • Implicitsolver
Numerical Integration • Initial value problem: • Simple approach: Euler • Derivation: Taylor expansion • First order scheme • Higher accuracy with smaller step size
Numerical Integration • Problems of Euler-Scheme • Inaccurate • Unstable • Example: Divergenz für t> 2/k
Numerical Integration • Midpoint method:1. Euler-Step2. Evaluation of f at midpoint3. Step with value at midpoint • Second order scheme
Numerical Integration • Fourth order Runge-Kutta • Adaptive step size control
Numerical Integration • So far: Explicit techniques • Stableintegrationbymeansofimplicitintegrationschemes • Implicit Euler-Step • „rewind“ the explicit Euler-Step • Taylor-expansionaroundt + tinsteadoft • Solvingthe non-linear systemofequationsforx(t + t)
Rigid body simulation • Demo
Rigid body simulation • Summary Translation Rotation Position rCM Orientation R Velocity vCM Angular velocity Impuls pCM Angular moment L Forces Fext Torque T Mass M Inertia tensor