# Forward dynamics

Forward dynamics (FD) refers to the computation of motions from forces. Given the configuration $$\bfq$$, generalized velocity $$\qd$$, joint torques $$\bftau$$ and contact forces $$\bff$$ acting on our robot, forward dynamics computes the joint accelerations $$\qdd$$ such that the constrained equations of motion are satisfied:

\begin{equation*} \begin{array}{rcl} \bfM(\bfq) \qdd + \qd^\top \bfC(\bfq) \qd & = & \bfS^\top \bftau + \bftau_g(\bfq) + \bftau_\mathit{ext} + \bfJ^\top \bff \\ \bfJ(\bfq) \qdd + \qd^\top \bfH(\bfq) \qd & = & \boldsymbol{0} \end{array} \end{equation*}

Mathematically, we can write forward dynamics as a function $$\mathrm{FD}$$ such that:

\begin{equation*} \qdd = \mathrm{FD}(\bfq, \qd, \tau, \bff) \end{equation*}

Note that this function implicitly depends on our robot model. Different robots will have e.g. different inertias, thus different inertia matrices $$\bfM(\bfq)$$, thus different $$\mathrm{FD}$$ functions in a given configuration $$\bfq$$.

## Articulated body algorithm

The articulated body algorithm (ABA) computes the unconstrained forward dynamics:

\begin{equation*} \qdd = \mathrm{ABA}(\bfq, \qd, \bftau, \bff) \end{equation*}

Its output $$\qdd$$ satisfies the equation of motion $$\bfM(\bfq) \qdd + \ldots = \ldots + \bfJ^\top \bff$$, but it doesn't take into account the contact constraint $$\bfJ(\bfq) \qdd + \qd^\top \bfH(\bfq) \qd = \boldsymbol{0}$$.

The composite rigid body algorithm (CRBA) computes the joint inertia matrix $$\bfM(\bfq)$$ from the joint configuration $$\bfq$$.