# Dynamic Balance of the Head in a Flexible Legged Robot for Efficient Biped Locomotion
## Appendix B Time Domain Simulations Theory  
The equation of motion of the robot is represented by:  
\[\mathbf{M}\ddot{\mathbf{x}}+\big{(}\mathbf{C}_{np}+\mathbf{C}\big{)}\dot{\mathbf{ x}}+\mathbf{K}\mathbf{x}=\mathbf{f},\quad\mathbf{x}(t=0)=\mathbf{x}_{0},\quad\dot{ \mathbf{x}}(t=0)=\mathbf{v}_{0} \tag{1}\]  
where \(\mathbf{M}\) and \(\mathbf{K}\) are respectively the mass and stiffness matrices, defined above. Proportional viscous damping is assumed for the distributed dissipation of the system, modeled through the damping matrix \(\mathbf{C}=\mathbf{T}^{T}\big{(}\alpha\mathbf{M}_{g}+\beta\mathbf{K}_{g} \big{)}\mathbf{T}\in\mathbb{R}^{n,n}\), where \(\mathbf{M}_{g}\), \(\mathbf{K}_{g}\) and \(\mathbf{T}\) are defined above and \(\alpha=3.31\) rad/s and \(\beta=0.0005\) s/rad are respectively the mass and stiffness proportional viscous damping coefficients fitting the experimental damping ratios in Table 1 via the damping ratio definition for viscous damped systems \(\zeta_{i}=\frac{1}{2}\left(\frac{\alpha}{\omega_{i}}+\beta\omega_{i}\right)\). A non-proportional viscous damping matrix \(\mathbf{C}_{np}\in\mathbb{R}^{n,n}\) is also introduced to model the effect of the localized dissipation at the wheel-floor contact. \(\mathbf{f}\in\mathbb{R}^{n,1}\) is the vector of the external forces acting of the system, i.e., the input to the system. \(\mathbf{x}_{0}\in\mathbb{R}^{n,1}\) and \(\mathbf{v}_{0}\in\mathbb{R}^{n,1}\) are respectively the displacement and velocity initial conditions, and \(\mathbf{x}\), \(\hat{\mathbf{x}}\), \(\tilde{\mathbf{x}}\in\mathbb{R}^{n,1}\) are respectively the displacements, velocity, and acceleration vectors. The second order ordinary differential equation in Equation (1) is written in first order form using the so called Duncan approach [56]:  
\[ \begin{bmatrix}\mathbf{C}_{np}+\mathbf{C}&\mathbf{M}\\ \mathbf{M}&\mathbf{0}\end{bmatrix} \begin{Bmatrix}\hat{\mathbf{x}}\\ \hat{\mathbf{x}}\end{bmatrix}+ \begin{bmatrix}\mathbf{K}&\mathbf{0}\\ \mathbf{0}&-\mathbf{M}\end{bmatrix}\begin{Bmatrix}\mathbf{x}\\ \hat{\mathbf{x}}\end{Bmatrix} =\begin{Bmatrix}\mathbf{f}\\ \mathbf{  
The human-like locomotion of the Robot is simulated imposing alternately the traction longitudinal force to [PERSON]'s feet, i.e., a time dependent input forces \(\mathbf{f}\) according to the robot steps. The first order ordinary differential equation Equation (A2) is efficiently solved using the superimposition principle in modal coordinates [42; 57], i.e., solving \(2n\) uncoupled equations in modal coordinates \(\boldsymbol{\eta}\) and then applying direct modal transformation \(\mathbf{y}=\boldsymbol{\psi}\boldsymbol{\eta}\) to obtain the system evolution if the physical coordinates \(\mathbf{x}\). However, the locomotion simulation is a non-classically damped problem, because of the localized dampers presence at the wheel floor contact. Therefore the exact modal base \(\boldsymbol{\psi}\) representing the system has to be obtained solving the eigenvalue problem related to Equation (A3):  
\[(s_{r}\mathbf{A}+\mathbf{B})\boldsymbol{\psi}_{\mathbf{r}}=\mathbf{0}\] (A4)  
where \(s_{r}\in\mathbb{C}\) and \(\boldsymbol{\psi}_{\mathbf{r}}\in\mathbb{C}^{2n,1}\) are respectively the \(r\)th pole and mode-shape of the system. The system modal matrix to be used in the modal transformation is \(\boldsymbol{\psi}=[\boldsymbol{\psi}_{1},\ldots,\boldsymbol{\psi}_{2n}]\). Performing the direct modal transformation, i.e., \(\mathbf{y}=\boldsymbol{\psi}\boldsymbol{\eta}\), and pre-multiplying Equation (A3) with \(\boldsymbol{\psi}^{\mathrm{T}}\), it follows:  
\[\boldsymbol{\psi}^{\mathrm{T}}\mathbf{A}\boldsymbol{\psi}\dot{\boldsymbol{ \eta}}+\boldsymbol{\psi}^{\mathrm{T}}\mathbf{B}\boldsymbol{\psi}\boldsymbol{ \eta}=\boldsymbol{\psi}^{\mathrm{T}}\mathbf{F}\] (A5)  
The \(\mathbf{A}\), \(\mathbf{B}\)-orthogonality theorem [41] guarantees the coefficients matrices in Equation (A5) to be diagonal:  
\[\boldsymbol{\psi}^{\mathrm{T}}\mathbf{A}\boldsymbol{\psi}= \begin{bmatrix} \kappa\\ &a_{r}\\ &&\searrow\end{bmatrix}