Class TimeIntegration

Class Documentation

class TimeIntegration

Public Static Functions

static void semiImplicitEuler(const Real h, const Real mass, Vector3r &position, Vector3r &velocity, const Vector3r &acceleration)

Perform an integration step for a particle using the semi-implicit Euler (symplectic Euler) method:

\[\begin{split}\begin{align*} \mathbf{v}(t+h) &= \mathbf{v}(t) + \mathbf{a}(t) h\\ \mathbf{x}(t+h) &= \mathbf{x}(t) + \mathbf{v}(t+h) h \end{align*}\end{split}\]

Parameters
  • h – time step size

  • mass – mass of the particle

  • position – position of the particle

  • velocity – velocity of the particle

  • acceleration – acceleration of the particle

static void semiImplicitEulerRotation(const Real h, const Real mass, const Matrix3r &invertiaW, const Matrix3r &invInertiaW, Quaternionr &rotation, Vector3r &angularVelocity, const Vector3r &torque)
static void velocityUpdateFirstOrder(const Real h, const Real mass, const Vector3r &position, const Vector3r &oldPosition, Vector3r &velocity)

Perform a velocity update (first order) for the linear velocity:

\[\begin{equation*} \mathbf{v}(t+h) = \frac{1}{h} (\mathbf{p}(t+h) - \mathbf{p}(t) \end{equation*}\]

Parameters
  • h – time step size

  • mass – mass of the particle

  • position – new position \(\mathbf{p}(t+h)\) of the particle

  • oldPosition – position \(\mathbf{p}(t)\) of the particle before the time step

  • velocity – resulting velocity of the particle

static void angularVelocityUpdateFirstOrder(const Real h, const Real mass, const Quaternionr &rotation, const Quaternionr &oldRotation, Vector3r &angularVelocity)
static void velocityUpdateSecondOrder(const Real h, const Real mass, const Vector3r &position, const Vector3r &oldPosition, const Vector3r &positionOfLastStep, Vector3r &velocity)
static void angularVelocityUpdateSecondOrder(const Real h, const Real mass, const Quaternionr &rotation, const Quaternionr &oldRotation, const Quaternionr &rotationOfLastStep, Vector3r &angularVelocity)