# Computational Dynamics of Multi-Rigid-Body System in Screw Coordinate
## 3 Dynamics of a Multi-Rigid-Body System  
The dynamics of a rigid body was described by the Newton-Euler equations in classical mechanics. [PERSON]'s two laws of motion for a rigid body are grouped together into a single equation by the Newton-Euler equation. When the external loads, constraint forces, and self-weights of all bodies are taken into account in the calculation of wrenches, the balance conditions for a single-rigid-body will be  
\[\begin{bmatrix}\mathbf{T}\\ \mathbf{F}\end{bmatrix}=\begin{bmatrix}\mathbf{I}_{n}&0\\ 0&m_{n}\mathbf{I}\end{bmatrix}\begin{bmatrix}\mathbf{\beta}\\ \mathbf{a}\end{bmatrix}+\begin{bmatrix}\mathbf{\omega}\times\mathbf{J}_{n}\mathbf{\omega}\\ m_{n}\mathbf{g}\end{bmatrix} \tag{22}\]  
where \(\mathbf{T}=\mathbf{T}^{n}-\mathbf{T}^{n-1}\) is the resultant torque of a single-rigid-body, in which \(\mathbf{T}^{n}\) is the constraint torque vector at joint \(j_{n}\), \(\mathbf{F}=\mathbf{F}^{n}-\mathbf{F}^{n-1}\) is the resultant force of a single-rigid-body, in which \(\mathbf{F}^{n}\) is the constraint force vector at joint \(j_{n}\), \(\mathbf{I}\) is an identity matrix of \(3\times 3\), \(m_{n}\) is the mass of a single-rigid-body, \(\mathbf{a}\) is the absolute linear acceleration at the mass center, \(\mathbf{\beta}\) is the absolute angular acceleration, and \(\mathbf{\omega}\) is the absolute angular velocity. Figure 3 demonstrates the Newton-Euler parameters of two adjacent bodies in a multi-rigid-body system.  
\[\mathbf{J}_{0}=\mathbf{R}_{0n}\mathbf{J}_{n}\mathbf{R}_{0n}^{T} \tag{23}\]  
where \(\mathbf{J}_{0}\) is the matrix of mass moment of inertia of a single-rigid-body at its mass center in the absolute coordinate frame (coordinate frame \(0\)), \(\mathbf{J}_{n}\) is the matrix of mass moment of inertia of a single-rigid-body at its principal coordinate frame of the mass center (coordinate frame \(n\)), and \(\mathbf{R}_{0n}\) is the rotation matrix from the coordinate frame \(n\) to the coordinate frame \(0\).  
The Newton-Euler equations of dynamics of the multi-rigid-body system can be therefore be written as:  
\[\mathbf{C}\mathbf{W}^{\mathcal{S}}=\mathbf{M}\mathbf{A}^{M}+\mathbf{W}^{\mathcal{C}}+\mathbf{W}^{ \mathcal{E}} \tag{24}\]  
where \(\mathbf{W}^{\mathcal{S}}=\begin{bmatrix}\begin{bmatrix}\mathbf{T}_{1}\\ \mathbf{F}_{1}\end{bmatrix}^{T}&\begin{bmatrix}\mathbf{T}_{2}\\ \mathbf{F}_{2}\end{bmatrix}^{T}&\cdots&\begin{bmatrix}\mathbf{T}_{n}\\ \mathbf{F}_{n}\end{bmatrix}^{T}\end{bmatrix}^{T}\) is the constraint wrench matrix of a multi-rigid-body system including all constraint forces and constraint torques, \(\mathbf{W}^{\mathcal{C}}\) is the Coriolis wrench matrix of the multi-rigid-body system, \(\mathbf{W}^{\mathcal{E}}\) is the external wrench matrix exerted at the multi-rigid-body system which also includes the gravity, \(\mathbf{C}\) is the displacement matrix, \(\mathbf{M}\) is the mass matrix, and \(\mathbf{A}^{M}\) is the acceleration matrix composed by the absolute accelerations of the mass centers in the multi-rigid-body system.  
Figure 2: The procedure for the kinematics on multi-rigid-body system.  
When the number of constraint wrenches equals the number of equations in Equation (24), the supporting wrench can be calculated by  
\[\mathbf{W}^{S}=\left(\mathbf{C}\mathbf{C}^{T}\right)^{-1}\left(\mathbf{M}\mathbf{A}^{M}+\mathbf{W}^{C}+ \mathbf{W}^{E}\right) \tag{25}\]