## 2 Materials and Methods
### Kinematical Analysis Based on the Constraints  
Since the time evolutions of the \(n_{dof}\) system's degrees of freedom are known, a kinematical analysis can be immediately performed. The analysis is based on the idea that the system has to satisfy during the time \(t\) the set of constraint equations coming from the joints' kinematical behaviour, through the right set of the bodies' Lagrangian coordinates \(\mathbf{q}\)[24; 25], obtained by concatenating the individual ones \(\mathbf{q}_{i}\) along the column direction. A multibody system made of \(n_{B}\) bodies (including the ground) which move in a known way, is subjected to the constraint equations composed by:  
* \(n_{dof}\) rheonomic constraints which drive the degrees of freedom to move with the known trajectories (\(\mathbf{C}_{r}\));
* \(n_{c}\) scleronomic constraints due to the relative motions blocked by the joints kinematical behaviour (\(\mathbf{C}_{s}\));
* \((n_{B}-1)\) constraints which guarantee that the bodies' quaternions keep the unitary norm (\(\mathbf{C}_{b}\)). From the mobility Equation (3),  
\[n_{dof}=6(n_{B}-1)-n_{c}, \tag{3}\]  
the \(7(n_{B}-1)\) constraint equations needed to find the same number of unknown \(\mathbf{q}\) are included in the constraint vector \(\mathbf{C}\) in (4). \[\mathbf{C}(\mathbf{q},t)=\left[ \begin{array}{c}\mathbf{C}_{r}(\mathbf{q},t)\\ \mathbf{C}_{s}(\mathbf{q})\\ \mathbf{C}_{b}(\mathbf{q})\end{array} \right]=0 \tag{4}\]  
The kinematical analysis, in (5), can be performed by solving the closed non-linear system of equations \(\mathbf{C}\) through the Newton iterative method for the position problem and by differentiating the constraints with respect to time \(t\), obtaining two linear systems to solve the velocity and acceleration, which provide the Lagrangian velocities \(\dot{\mathbf{q}}\) and accelerations \(\ddot{\mathbf{q}}\). \[ \begin{array}{c}\mathbf{q}^{(k+1)}=\mathbf{q}^{(k)}-\mathbf{C}_{q}^{-1}\Big{(}\mathbf{q}^{(k )},t\Big{)}\mathbf{C}\Big{(}\mathbf{q}^{(k)},t\Big{)}\\ \mathbf{C}_{\mathbf{q}}\dot{\mathbf{q}}=-\mathbf{C}_{t}\\ \mathbf{C}_{\mathbf{q}}\ddot{\mathbf{q}}=-\mathbf{\Big{(}\dot{\mathbf{C}}_{t}+\dot{\mathbf{C}}_{\mathbf{q} }\dot{\mathbf{q}}\Big{)}}\end{array}  \tag{5}\]The constraint Jacobian \(C_{q}\) and the other matrices and vectors involved in the kinematical analysis in (5) (\(C\), \(C_{t}\), \(\hat{C}_{q}\), \(\hat{C}_{t}\)), are obtained by analysing the joints kinematical behaviour. In this application the shoulder and the elbow are modelled as revolute joints, so only this joint type is discussed. A revolute joint \(J\) allows only a relative rotation \(\theta\) between the linked bodies \(i\) and \(j\) around an axis defined by the unit vector \(\hat{v}\) fixed to the parent body \(i\), as showed in the Figure 2.  
The rheonomic constraint \(C_{r,J}\) associated to the revolute joint \(J\) is generally modelled considering that the scalar product between two particular vectors fixed to the related bodies has to be equal to the cosine of the relative rotation \(\theta\)[18; 25]: the periodicity of the trigonometric functions does not allow to reaching a unique solution numerically solving the position analysis. In this work this particular constraint is modelled considering that the difference between the bodies' absolute angular coordinates \(\mathbf{\varphi}\) projected on the rotation axis \(\hat{v}\) has to be equal to the relative rotation \(\theta\), as written in (6).