## 7 Flexible Body Dynamics Based on Finite Element Approximation  
Using a 2D Euler-Bernoulli beam model as in the Rayleigh-Ritz approximation previously discussed, let's discretize each of the four bodies in the manipulator into four elements with equal lengths, that is,  
\[l^{\rm{i1}}=l^{\rm{i2}}=l^{\rm{3}}=l^{\rm{i4}}=\frac{L^{i}}{4}. \tag{136}\]  
As a result, there are five nodes in each body. All the nodes along with the nodal coordinates in each body \(i\), before the application of any boundary condition, is depicted in Figure 7. The nodes 2-4 are the nodes of connectivity at which two adjacent elements are connected. As the manipulator at hand has four bodies (links), the nodal coordinates in the system are given by:  
\[q_{n}=\Big{[} \begin{array}{cc}q_{n}{}^{1}&q_{n}{}^{2}&q_{n}{}^{3}&q_{n}{}^{4 }\end{array} \Big{]}^{T}. \tag{137}\]  
The sub-vector \(q_{n}{}^{i}\) in Equation (142) has a dimension of \(5\times 3=15\) as there are 5 nodes in each body \(i\) with 3 DOFs in each node, that is,  
\[q_{n}{}^{1}=\left[ \begin{array}{c}e_{1}{}^{1}\\ e_{2}{}^{1}\\ e_{3}{}^{1}\\ \vdots\\ e_{14}{}^{1}\\ e_{15}{}^{1}\end{array} \right];\qquad q_{n}{}^{2}=\left[ \begin{array}{c}e_{ 1}{}^{2}\\ e_{2}{}^{2}\\ e_{3}{}^{2}\\ \vdots\\ e_{14}{}^{2}\\ e_{15}{}^{2}\end{array} \right];\qquad q_{n}{}^{3}=\left[ \begin{array}{c}e_{ 1}{}^{3}\\ e_{2}{}^{3}\\ e_{3}{}^{3}\\ \vdots\\ e_{14}{}^{3}\\ e_{15}{}^{3}\end{array} \right];\qquad q_{n}{}^{4}=\left[ \begin{array}{c}e_{ 1}{}^{4}\\ e_{2}{}^{4}\\ e_{3}{}^{4}\\ \vdots\\ e_{14}{}^{4}\\ e_{15}{}^{4}\end{array} \right] \tag{138}\]  
The dynamics of the manipulator at hand is constrained by nine position constraint equations. Three of them are position constraints corresponding to the three rigid sliders as given in Equations (64)-(66). The rest of the position constraints are as follow:  
\[\Gamma_{4},\Gamma_{5}:r_{\rm{o}_{4}}=r_{\rm{o}_{2}}+R^{2}{u_{\rm{D}}}^{2} \tag{139}\]  
\[\Gamma_{6},\Gamma_{7}:r_{\rm{o}_{4}}+R^{4}u_{E}{}^{4}=r_{\rm{o}_{1}}+R^{1}u_{E }{}^{1} \tag{140}\]  
\[\Gamma_{8},\Gamma_{9}:r_{\rm{o}_{4}}+R^{4}u_{F}{}^{4}=r_{\rm{o}_{3}}+R^{3}u_{ F}{}^{3}, \tag{141}\]  
where:  
\[u_{E}{}^{1}=N^{1}\Big{(}q_{0}{}^{1}+B_{2}{}^{1}q_{f}{}^{1}\Big{)} \tag{142}\]  
\[u_{D}{}^{2}=N^{2}\Big{(}q_{0}{}^{2}+B_{2}{}^{2}q_{f}{}^{2}\Big{)} \tag{143}\]  
\[u_{F}{}^{3}=N^{3}\Big{(}q_{0}{}^{3}+B_{2}{}^{3}q_{f}{}^{3}\Big{)} \tag{144}\]  
\[u_{E}{}^{4}=N_{E}\Big{(}q_{0}{}^{4}+B_{2}{}^{4}q_{f}{}^{4}\Big{)} \tag{145}\]  
Figure 7: Elements, nodes and nodal coordinates in the body \(i\) of the manipulator. \[N^{1} =C^{1}S^{1}(\xi=1)\overline{C}^{1}{B_{1}}^{1} \tag{147}\] \[N^{2} =C^{2}S^{2}(\xi=1)\overline{C}^{2}{B_{1}}^{2}\] (148) \[\Gamma_{6},\Gamma_{7}:r_{\rm{o}_{4}}+R^{4}u_{E}{}^{4}=r_{\rm{o}_{1}}+R^{1}u_{E }{}^{1} \tag{140}\]0 (149) \[\Gamma_{6},\Gamma_{7}:r_{\rm{o}_{4}}+R^{4}u_{E}{}^{4}=r_{\rm{o}_{1}}+R^{1}u_{E }{}^{1} \tag{140}\]1 (150) \[\Gamma_{6},\Gamma_{7}:r_{\rm{o}_{4}}+R^{4}u_{E}{}^{4}=r_{\rm{o}_{1}}+R^{1}u_{E }{}^{1} \tag{140}\]2 (151) \[{q_{0}}^{1} =\Big{[} \begin{array}{cccccccccccc}0&0&0&l^{11}&0&0&l^{12}&0&0& l^{13}&0&0&l^{14}&0&0\\ \end{array} \Big{]}^{T}\] (152) \[{q_{0}}^{2} =\Big{[} \begin{array}{cccccccccccc}0&0&0&l^{21}&0&0&l^{22}&0&0& l^{23}&0&0&l^{24}&0&0\\ \end{array} \Big{]}^{T}\] (153) \[{q_{0}}^{3} =\Big{[} \begin{array}{cccccccccccc}0&0&0&l^{31}&0&0&l^{32}&0&0& l^{33}&0&0&l^{34}&0&0\\ \end{array} \Big{]}^{T}\] (154) \[{q_{0}}^{4} =\Big{[} \begin{array}{cccccccccccc}0&0&0&l^{41}&0&0&l^{42}&0&0& l^{43}&0&0&l^{44}&0&0\\ \end{array} \Big{]}^{T} \tag{155}\]  
The fixed-free elastic boundary conditions, identical to that in the Rayleigh-Ritz approximation, are used. These boundary conditions constrain all the elastic DOFs in the first nodes of each body and let the remaining elastic DOFs free. As a consequence, all the matrices and vectors for each body should be reduced by suppressing the rows (for the case of vectors) and rows and columns (for the case of matrices) corresponding to the constrained elastic DOFs.