In this article, the equations of motion of the triple pendulum will be derived via the Euler-Lagrange equations with dissipation. See this article for a solver of this system of equations.
Figure 1: Diagram of the triple pendulum. x 1 b = l 1 cos θ 1 , y 1 b = l 1 sin θ 1 , x ˙ 1 b = − l 1 θ ˙ 1 sin θ 1 , y ˙ 1 b = l 1 θ ˙ 1 cos θ 1 ∴ v 1 b = l 1 θ ˙ 1 v ⃗ 1 b = l 1 θ ˙ 1 [ − sin θ 1 cos θ 1 ] , e ^ 1 b , θ 1 = l 1 [ − sin θ 1 cos θ 1 ] , e ^ 1 b , θ 2 = e ^ 1 b , θ 3 = 0 ⃗ \begin{aligned} & x_{1b} &= l_1 \cos{\theta_1}, & y_{1b} &= l_1 \sin{\theta_1}, & \dot{x}_{1b} &= -l_1 \dot{\theta}_1 \sin{\theta_1}, & \dot{y}_{1b} &= l_1 \dot{\theta}_1 \cos{\theta_1}\\ & \therefore v_{1b} &= l_1 \dot{\theta}_1 \\ & \vec{v}_{1b} &= l_1 \dot{\theta}_1\begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{1b, \theta_1} &= l_1 \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{1b, \theta_2} &= \hat{e}_{1b, \theta_3} &= \vec{0} \\ \end{aligned} x 1 b ∴ v 1 b v 1 b = l 1 cos θ 1 , = l 1 θ ˙ 1 = l 1 θ ˙ 1 [ − sin θ 1 cos θ 1 ] , y 1 b e ^ 1 b , θ 1 = l 1 sin θ 1 , = l 1 [ − sin θ 1 cos θ 1 ] , x ˙ 1 b e ^ 1 b , θ 2 = − l 1 θ ˙ 1 sin θ 1 , = e ^ 1 b , θ 3 y ˙ 1 b = 0 = l 1 θ ˙ 1 cos θ 1 x 1 r = l 1 cos θ 1 2 , y 1 r = l 1 sin θ 1 2 , x ˙ 1 r = − l 1 θ ˙ 1 cos θ 1 2 , y ˙ 1 r = l 1 θ ˙ 1 cos θ 1 2 ∴ v 1 r = l 1 θ ˙ 1 2 v ⃗ 1 r = l 1 θ ˙ 1 2 [ − sin θ 1 cos θ 1 ] , e ^ 1 r , θ 1 = l 1 2 [ − sin θ 1 cos θ 1 ] , e ^ 1 r , θ 2 = e ^ 1 r , θ 3 = 0 ⃗ \begin{aligned} & x_{1r} &= \dfrac{l_1 \cos{\theta_1}}{2}, & y_{1r} &= \dfrac{l_1 \sin{\theta_1}}{2}, & \dot{x}_{1r} &= -\dfrac{l_1 \dot{\theta}_1 \cos{\theta_1}}{2}, & \dot{y}_{1r} &= \dfrac{l_1\dot{\theta}_1 \cos{\theta_1}}{2} \\ & \therefore v_{1r} &= \dfrac{l_1 \dot{\theta}_1}{2} \\ & \vec{v}_{1r} &= \dfrac{l_1 \dot{\theta}_1}{2}\begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{1r, \theta_1} &= \dfrac{l_1}{2} \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{1r, \theta_2} &= \hat{e}_{1r, \theta_3} &= \vec{0} \end{aligned} x 1 r ∴ v 1 r v 1 r = 2 l 1 cos θ 1 , = 2 l 1 θ ˙ 1 = 2 l 1 θ ˙ 1 [ − sin θ 1 cos θ 1 ] , y 1 r e ^ 1 r , θ 1 = 2 l 1 sin θ 1 , = 2 l 1 [ − sin θ 1 cos θ 1 ] , x ˙ 1 r e ^ 1 r , θ 2 = − 2 l 1 θ ˙ 1 cos θ 1 , = e ^ 1 r , θ 3 y ˙ 1 r = 0 = 2 l 1 θ ˙ 1 cos θ 1 Defining Δ i j = θ i − θ j \Delta_{ij} = \theta_i - \theta_j Δ i j = θ i − θ j , we get
x 2 b = l 1 cos θ 1 + l 2 cos θ 2 , y 2 b = l 1 sin θ 1 + l 2 sin θ 2 x ˙ 2 b = − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 , y ˙ 2 b = l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 ∴ v 2 b = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + l 2 2 θ ˙ 2 2 v ⃗ 2 b = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 ] , e ^ 2 b , θ 1 = l 1 [ − sin θ 1 cos θ 1 ] , e ^ 2 b , θ 2 = l 2 [ − sin θ 2 cos θ 2 ] , e ^ 2 b , θ 3 = 0 ⃗ \begin{aligned} & x_{2b} &= l_1\cos{\theta_1} + l_2 \cos{\theta_2}, & y_{2b} &= l_1 \sin{\theta_1} + l_2 \sin{\theta_2} & \dot{x}_{2b} &= -l_1 \dot{\theta_1}\sin{\theta_1} - l_2\dot{\theta_2}\sin{\theta_2}, &\dot{y}_{2b} &= l_1 \dot{\theta_1} \cos{\theta_1} + l_2 \dot{\theta_2}\cos{\theta_2} \\ & \therefore v_{2b} &= \sqrt{l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2} \\ & \vec{v}_{2b} &= \begin{bmatrix} -l_1 \dot{\theta_1}\sin{\theta_1} - l_2\dot{\theta_2}\sin{\theta_2} \\ l_1 \dot{\theta_1} \cos{\theta_1} + l_2 \dot{\theta_2}\cos{\theta_2} \end{bmatrix}, \hat{e}_{2b, \theta_1} &= l_1 \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{2b, \theta_2} &= l_2 \begin{bmatrix} -\sin{\theta_2} \\ \cos{\theta_2} \end{bmatrix}, & \hat{e}_{2b, \theta_3} &= \vec{0} \end{aligned} x 2 b ∴ v 2 b v 2 b = l 1 cos θ 1 + l 2 cos θ 2 , = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + l 2 2 θ ˙ 2 2 = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 ] , e ^ 2 b , θ 1 y 2 b = l 1 [ − sin θ 1 cos θ 1 ] , = l 1 sin θ 1 + l 2 sin θ 2 e ^ 2 b , θ 2 x ˙ 2 b = l 2 [ − sin θ 2 cos θ 2 ] , = − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 , e ^ 2 b , θ 3 y ˙ 2 b = 0 = l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 x 2 r = l 1 cos θ 1 + l 2 cos θ 2 2 , y 2 r = l 1 sin θ 1 + l 2 sin θ 2 2 x ˙ 2 r = − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 2 , y ˙ 2 r = l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 2 ∴ v 2 r = l 1 2 θ ˙ 1 2 + l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + l 2 2 θ ˙ 2 2 4 v ⃗ 2 r = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 2 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 2 ] , e ^ 2 r , θ 1 = l 1 [ − sin θ 1 cos θ 1 ] , e ^ 2 r , θ 2 = l 2 2 [ − sin θ 2 cos θ 2 ] , e ^ 2 r , θ 3 = 0 ⃗ \begin{aligned} & x_{2r} &= l_1\cos{\theta_1} + \dfrac{l_2 \cos{\theta_2}}{2}, & y_{2r} &= l_1 \sin{\theta_1} + \dfrac{l_2 \sin{\theta_2}}{2} & \dot{x}_{2r} &= -l_1 \dot{\theta_1}\sin{\theta_1} - \dfrac{l_2\dot{\theta_2}\sin{\theta_2}}{2}, &\dot{y}_{2r} &= l_1 \dot{\theta_1} \cos{\theta_1} + \dfrac{l_2 \dot{\theta_2}\cos{\theta_2}}{2} \\ & \therefore v_{2r} &= \sqrt{l_1^2 \dot{\theta}_1^2 + l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + \dfrac{l_2^2 \dot{\theta}_2^2}{4}} \\ & \vec{v}_{2r} &= \begin{bmatrix} -l_1 \dot{\theta_1}\sin{\theta_1} - \dfrac{l_2\dot{\theta_2}\sin{\theta_2}}{2} \\ l_1 \dot{\theta_1} \cos{\theta_1} + \dfrac{l_2 \dot{\theta_2}\cos{\theta_2}}{2} \end{bmatrix}, \hat{e}_{2r, \theta_1} &= l_1 \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{2r, \theta_2} &= \dfrac{l_2}{2} \begin{bmatrix} -\sin{\theta_2} \\ \cos{\theta_2} \end{bmatrix}, & \hat{e}_{2r, \theta_3} &= \vec{0} \end{aligned} x 2 r ∴ v 2 r v 2 r = l 1 cos θ 1 + 2 l 2 cos θ 2 , = l 1 2 θ ˙ 1 2 + l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + 4 l 2 2 θ ˙ 2 2 = ⎣ ⎢ ⎢ ⎡ − l 1 θ 1 ˙ sin θ 1 − 2 l 2 θ 2 ˙ sin θ 2 l 1 θ 1 ˙ cos θ 1 + 2 l 2 θ 2 ˙ cos θ 2 ⎦ ⎥ ⎥ ⎤ , e ^ 2 r , θ 1 y 2 r = l 1 [ − sin θ 1 cos θ 1 ] , = l 1 sin θ 1 + 2 l 2 sin θ 2 e ^ 2 r , θ 2 x ˙ 2 r = 2 l 2 [ − sin θ 2 cos θ 2 ] , = − l 1 θ 1 ˙ sin θ 1 − 2 l 2 θ 2 ˙ sin θ 2 , e ^ 2 r , θ 3 y ˙ 2 r = 0 = l 1 θ 1 ˙ cos θ 1 + 2 l 2 θ 2 ˙ cos θ 2 x 3 b = l 1 cos θ 1 + l 2 cos θ 2 + l 3 cos θ 3 , y 3 b = l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 x ˙ 3 b = − l 1 θ 1 ˙ sin θ 1 − l 2 θ ˙ 2 sin θ 2 − l 3 θ 3 ˙ sin θ 3 , y ˙ 3 b = l 1 θ 1 ˙ cos θ 1 + l 2 θ ˙ 2 cos θ 2 + l 3 θ 3 ˙ cos θ 3 ∴ v 3 b = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + l 2 2 θ ˙ 2 2 + 2 l 2 l 3 θ ˙ 2 θ ˙ 3 cos Δ 32 + 2 l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 31 + l 3 2 θ ˙ 3 2 v ⃗ 3 b = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 − l 3 θ 3 ˙ sin θ 3 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 + l 3 θ 3 ˙ cos θ 3 ] , e ^ 3 b , θ 1 = l 1 [ − sin θ 1 cos θ 1 ] , e ^ 3 b , θ 2 = l 2 [ − sin θ 2 cos θ 2 ] , e ^ 3 b , θ 3 = l 3 [ − sin θ 3 cos θ 3 ] \begin{aligned} & x_{3b} &= l_1\cos{\theta_1} + l_2 \cos{\theta_2} + l_3 \cos{\theta_3}, & y_{3b} &= l_1 \sin{\theta_1} + l_2\sin{\theta_2} + l_3 \sin{\theta_3} & \dot{x}_{3b} &= -l_1 \dot{\theta_1}\sin{\theta_1} - l_2 \dot{\theta}_2\sin{\theta_2} - l_3\dot{\theta_3}\sin{\theta_3}, &\dot{y}_{3b} &= l_1 \dot{\theta_1} \cos{\theta_1} + l_2 \dot{\theta}_2 \cos{\theta_2} + l_3 \dot{\theta_3}\cos{\theta_3}\\ & \therefore v_{3b} &= \sqrt{l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2 + 2l_2 l_3 \dot{\theta}_2 \dot{\theta}_3 \cos{\Delta_{32}} + 2l_1l_3 \dot{\theta}_1\dot{\theta}_3 \cos{\Delta_{31}} + l_3^2 \dot{\theta}_3^2}\\ & \vec{v}_{3b} &= \begin{bmatrix} -l_1 \dot{\theta_1}\sin{\theta_1} - l_2\dot{\theta_2}\sin{\theta_2} - l_3\dot{\theta_3}\sin{\theta_3} \\ l_1 \dot{\theta_1} \cos{\theta_1} + l_2 \dot{\theta_2}\cos{\theta_2} + l_3 \dot{\theta_3}\cos{\theta_3} \end{bmatrix}, \hat{e}_{3b, \theta_1} &= l_1 \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{3b, \theta_2} &= l_2 \begin{bmatrix} -\sin{\theta_2} \\ \cos{\theta_2} \end{bmatrix}, & \hat{e}_{3b, \theta_3} &= l_3 \begin{bmatrix} -\sin{\theta_3} \cos{\theta_3} \end{bmatrix} \end{aligned} x 3 b ∴ v 3 b v 3 b = l 1 cos θ 1 + l 2 cos θ 2 + l 3 cos θ 3 , = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + l 2 2 θ ˙ 2 2 + 2 l 2 l 3 θ ˙ 2 θ ˙ 3 cos Δ 3 2 + 2 l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 3 1 + l 3 2 θ ˙ 3 2 = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 − l 3 θ 3 ˙ sin θ 3 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 + l 3 θ 3 ˙ cos θ 3 ] , e ^ 3 b , θ 1 y 3 b = l 1 [ − sin θ 1 cos θ 1 ] , = l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 e ^ 3 b , θ 2 x ˙ 3 b = l 2 [ − sin θ 2 cos θ 2 ] , = − l 1 θ 1 ˙ sin θ 1 − l 2 θ ˙ 2 sin θ 2 − l 3 θ 3 ˙ sin θ 3 , e ^ 3 b , θ 3 y ˙ 3 b = l 3 [ − sin θ 3 cos θ 3 ] = l 1 θ 1 ˙ cos θ 1 + l 2 θ ˙ 2 cos θ 2 + l 3 θ 3 ˙ cos θ 3 x 3 r = l 1 cos θ 1 + l 2 cos θ 2 + l 3 cos θ 3 2 , y 3 r = l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 2 x ˙ 3 r = − l 1 θ 1 ˙ sin θ 1 − l 2 θ ˙ 2 sin θ 2 − l 3 θ 3 ˙ sin θ 3 2 , y ˙ 3 r = l 1 θ 1 ˙ cos θ 1 + l 2 θ ˙ 2 cos θ 2 + l 3 θ 3 ˙ cos θ 3 2 ∴ v 3 r = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + l 2 2 θ ˙ 2 2 + l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 31 + l 2 l 3 θ ˙ 2 θ ˙ 3 cos Δ 32 + l 3 2 θ ˙ 3 2 4 v ⃗ 3 r = [ − l 1 θ 1 ˙ sin θ 1 − l 2 θ 2 ˙ sin θ 2 2 − l 3 θ 3 ˙ sin θ 3 2 l 1 θ 1 ˙ cos θ 1 + l 2 θ 2 ˙ cos θ 2 2 + l 3 θ 3 ˙ cos θ 3 2 ] , e ^ 3 r , θ 1 = l 1 [ − sin θ 1 cos θ 1 ] , e ^ 3 r , θ 2 = l 2 [ − sin θ 2 cos θ 2 ] , e ^ 3 r , θ 3 = l 3 2 [ − sin θ 3 cos θ 3 ] \begin{aligned} & x_{3r} &= l_1\cos{\theta_1} + l_2 \cos{\theta_2} + \dfrac{l_3 \cos{\theta_3}}{2}, & y_{3r} &= l_1 \sin{\theta_1} + l_2\sin{\theta_2} + \dfrac{l_3 \sin{\theta_3}}{2} & \dot{x}_{3r} &= -l_1 \dot{\theta_1}\sin{\theta_1} - l_2 \dot{\theta}_2\sin{\theta_2} - \dfrac{l_3\dot{\theta_3}\sin{\theta_3}}{2}, &\dot{y}_{3r} &= l_1 \dot{\theta_1} \cos{\theta_1} + l_2 \dot{\theta}_2 \cos{\theta_2} + \dfrac{l_3 \dot{\theta_3}\cos{\theta_3}}{2}\\ & \therefore v_{3r} &= \sqrt{l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2 + l_1l_3 \dot{\theta}_1\dot{\theta}_3\cos{\Delta_{31}} + l_2l_3\dot{\theta}_2 \dot{\theta}_3 \cos{\Delta_{32}} + \dfrac{l_3^2 \dot{\theta}_3^2}{4}}\\ & \vec{v}_{3r} &= \begin{bmatrix} -l_1 \dot{\theta_1}\sin{\theta_1} - \dfrac{l_2\dot{\theta_2}\sin{\theta_2}}{2} - \dfrac{l_3\dot{\theta_3}\sin{\theta_3}}{2}\\ l_1 \dot{\theta_1} \cos{\theta_1} + \dfrac{l_2 \dot{\theta_2}\cos{\theta_2}}{2} + \dfrac{l_3 \dot{\theta_3}\cos{\theta_3}}{2} \end{bmatrix}, \hat{e}_{3r, \theta_1} &= l_1 \begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix}, & \hat{e}_{3r, \theta_2} &= l_2 \begin{bmatrix} -\sin{\theta_2} \\ \cos{\theta_2} \end{bmatrix}, & \hat{e}_{3r, \theta_3} &= \dfrac{l_3}{2} \begin{bmatrix} -\sin{\theta_3} \\ \cos{\theta_3} \end{bmatrix} \end{aligned} x 3 r ∴ v 3 r v 3 r = l 1 cos θ 1 + l 2 cos θ 2 + 2 l 3 cos θ 3 , = l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + l 2 2 θ ˙ 2 2 + l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 3 1 + l 2 l 3 θ ˙ 2 θ ˙ 3 cos Δ 3 2 + 4 l 3 2 θ ˙ 3 2 = ⎣ ⎢ ⎢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 ˙ 2 θ ˙ 3 cos Δ 32 + 2 l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 31 + l 3 2 θ ˙ 3 2 ) + m 3 r 2 ( l 1 2 θ ˙ 1 2 + 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + l 2 2 θ ˙ 2 2 + l 1 l 3 θ ˙ 1 θ ˙ 3 cos Δ 31 + l 2 l 3 θ ˙ 2 θ ˙ 3 cos Δ 32 + l 3 2 θ ˙ 3 2 4 ) + m 3 r l 3 2 θ ˙ 3 2 24 = 1 2 ( m 1 b + m 1 r 3 + m 2 b + m 2 r + m 3 b + m 3 r ) l 1 2 θ ˙ 1 2 + 1 2 ( m 2 b + m 2 r 3 + m 3 b + m 3 r ) l 2 2 θ ˙ 2 2 + 1 2 ( m 3 b + m 3 r 3 ) l 3 2 θ ˙ 3 2 + ( m 2 b + m 2 r 2 + m 3 b + m 3 r ) l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + ( m 3 b + m 3 r 2 ) l 3 ( l 2 θ ˙ 2 θ ˙ 3 cos Δ 32 + l 1 θ ˙ 1 θ ˙ 3 cos Δ 31 ) \begin{aligned} T &= \dfrac{m_{1b}}{2} v_{1b}^2 + \dfrac{m_{1r}}{2} v_{1r}^2 + \dfrac{m_{1r}I_{\mathrm{cm},1r} \omega_{1r}^2}{2} + \dfrac{m_{2b}}{2} v_{2b}^2 + \dfrac{m_{2r}}{2} v_{2r}^2 + \dfrac{m_{2r}I_{\mathrm{cm},2r} \omega_{2r}^2}{2} + \dfrac{m_{3b}}{2} v_{3b}^2 + \dfrac{m_{3r}}{2} v_{3r}^2 + \dfrac{m_{3r}I_{\mathrm{cm},3r} \omega_{3r}^2}{2} \\ &= \dfrac{m_{1b}l_1^2 \dot{\theta}_1^2}{2} + \dfrac{m_{1r}l_1^2 \dot{\theta}_1^2}{8} + \dfrac{m_{1r}l_1^2 \dot{\theta}_1^2}{24} + \dfrac{m_{2b}}{2}(l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1\dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2) + \dfrac{m_{2r}}{2}\left(l_1^2 \dot{\theta}_1^2 + l_1 l_2 \dot{\theta}_1\dot{\theta}_2 \cos{\Delta_{21}} + \dfrac{l_2^2 \dot{\theta}_2^2}{4}\right) + \dfrac{m_{2r}l_2^2 \dot{\theta}_2^2}{24} + \dfrac{m_{3b}}{2} \left(l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2 + 2l_2 l_3 \dot{\theta}_2 \dot{\theta}_3 \cos{\Delta_{32}} + 2l_1l_3 \dot{\theta}_1\dot{\theta}_3 \cos{\Delta_{31}} + l_3^2 \dot{\theta}_3^2\right)+ \dfrac{m_{3r}}{2}\left(l_1^2 \dot{\theta}_1^2 + 2l_1 l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + l_2^2 \dot{\theta}_2^2 + l_1l_3 \dot{\theta}_1\dot{\theta}_3\cos{\Delta_{31}} + l_2l_3\dot{\theta}_2 \dot{\theta}_3 \cos{\Delta_{32}} + \dfrac{l_3^2 \dot{\theta}_3^2}{4}\right) + \dfrac{m_{3r}l_3^2 \dot{\theta}_3^2}{24} \\ &= \dfrac{1}{2}\left(m_{1b}+\dfrac{m_{1r}}{3} + m_{2b} + m_{2r} + m_{3b} + m_{3r}\right)l_1^2 \dot{\theta}_1^2 + \dfrac{1}{2}\left(m_{2b} + \dfrac{m_{2r}}{3} + m_{3b} + m_{3r}\right)l_2^2 \dot{\theta}_2^2 + \dfrac{1}{2}\left(m_{3b} + \dfrac{m_{3r}}{3}\right)l_3^2 \dot{\theta}_3^2 + \left(m_{2b} + \dfrac{m_{2r}}{2} + m_{3b} + m_{3r}\right)l_1l_2\dot{\theta}_1\dot{\theta}_2\cos{\Delta_{21}} + \left(m_{3b} + \dfrac{m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+ 2 1 ( m 2 b + 3 m 2 r + m 3 b + m 3 r ) l 2 2 θ ˙ 2 2 + 2 1 ( m 3 b + 3 m 3 r ) l 3 2 θ ˙ 3 2 + ( m 2 b + 2 m 2 r + m 3 b + m 3 r ) l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + ( m 3 b + 2 m 3 r ) l 3 ( l 2 θ ˙ 2 θ ˙ 3 cos Δ 3 2 + l 1 θ ˙ 1 θ ˙ 3 cos Δ 3 1 ) Defining M 1 = m 1 b + m 1 r 3 + m 2 b + m 2 r + m 3 b + m 3 r M_1 = m_{1b}+\dfrac{m_{1r}}{3} + m_{2b} + m_{2r} + m_{3b} + m_{3r} M 1 = m 1 b + 3 m 1 r + m 2 b + m 2 r + m 3 b + m 3 r , M 2 = m 2 b + m 2 r 3 + m 3 b + m 3 r M_2 = m_{2b} + \dfrac{m_{2r}}{3} + m_{3b} + m_{3r} M 2 = m 2 b + 3 m 2 r + m 3 b + m 3 r , M 3 = m 3 b + m 3 r 3 M_3 = m_{3b} + \dfrac{m_{3r}}{3} M 3 = m 3 b + 3 m 3 r , μ 1 = m 1 b + m 1 r 2 + m 2 b + m 2 r + m 3 b + m 3 r \mu_1 = m_{1b}+\dfrac{m_{1r}}{2} + m_{2b} + m_{2r} + m_{3b} + m_{3r} μ 1 = m 1 b + 2 m 1 r + m 2 b + m 2 r + m 3 b + m 3 r , μ 2 = m 2 b + m 2 r 2 + m 3 b + m 3 r \mu_2 = m_{2b} + \dfrac{m_{2r}}{2} + m_{3b} + m_{3r} μ 2 = m 2 b + 2 m 2 r + m 3 b + m 3 r and μ 3 = m 3 b + m 3 r 2 \mu_3 = m_{3b} + \dfrac{m_{3r}}{2} μ 3 = m 3 b + 2 m 3 r .
T = M 1 l 1 2 θ ˙ 1 2 2 + M 2 l 2 2 θ ˙ 2 2 2 + M 3 l 3 2 θ ˙ 3 2 2 + μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + μ 3 l 3 θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 32 + l 1 θ ˙ 1 cos Δ 31 ) . \begin{aligned} T &= \dfrac{M_1 l_1^2 \dot{\theta}_1^2}{2} + \dfrac{M_2 l_2^2 \dot{\theta}_2^2}{2} + \dfrac{M_3 l_3^2 \dot{\theta}_3^2}{2} + \mu_2 l_1l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + \mu_3 l_3\dot{\theta}_3(l_2\dot{\theta}_2\cos{\Delta_{32}}+l_1\dot{\theta}_1\cos{\Delta_{31}}). \end{aligned} T = 2 M 1 l 1 2 θ ˙ 1 2 + 2 M 2 l 2 2 θ ˙ 2 2 + 2 M 3 l 3 2 θ ˙ 3 2 + μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + μ 3 l 3 θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 3 2 + l 1 θ ˙ 1 cos Δ 3 1 ) . V = m 1 b g y 1 b + m 1 r g y 1 r + m 2 b g y 2 b + m 2 r g y 2 r + m 3 b g y 3 b + m 3 r g y 3 r = m 1 b g l 1 sin θ 1 + m 1 r g l 1 sin θ 1 2 + m 2 b g ( l 1 sin θ 1 + l 2 sin θ 2 ) + m 2 r g ( l 1 sin θ 1 + l 2 sin θ 2 2 ) + m 3 b g ( l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 ) + m 3 r g ( l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 2 ) = μ 1 g l 1 sin θ 1 + μ 2 g l 2 sin θ 2 + μ 3 g l 3 sin θ 3 . \begin{aligned} V &= m_{1b} gy_{1b} + m_{1r}gy_{1r} + m_{2b}gy_{2b} + m_{2r}gy_{2r} + m_{3b}gy_{3b} + m_{3r}gy_{3r} \\ &= m_{1b}gl_1 \sin{\theta_1} + \dfrac{m_{1r}gl_1\sin{\theta_1}}{2} + m_{2b} g(l_1\sin{\theta_1} + l_2\sin{\theta_2}) + m_{2r}g\left(l_1\sin{\theta_1}+\dfrac{l_2\sin{\theta_2}}{2}\right) + m_{3b} g(l_1\sin{\theta_1} + l_2\sin{\theta_2}+l_3\sin{\theta_3}) + m_{3r}g\left(l_1\sin{\theta_1} + l_2\sin{\theta_2} +\dfrac{l_3\sin{\theta_3}}{2}\right) \\ &= \mu_1 gl_1 \sin{\theta_1} + \mu_2 gl_2\sin{\theta_2} + \mu_3 gl_3\sin{\theta_3}. \end{aligned} V = m 1 b g y 1 b + m 1 r g y 1 r + m 2 b g y 2 b + m 2 r g y 2 r + m 3 b g y 3 b + m 3 r g y 3 r = m 1 b g l 1 sin θ 1 + 2 m 1 r g l 1 sin θ 1 + m 2 b g ( l 1 sin θ 1 + l 2 sin θ 2 ) + m 2 r g ( l 1 sin θ 1 + 2 l 2 sin θ 2 ) + m 3 b g ( l 1 sin θ 1 + l 2 sin θ 2 + l 3 sin θ 3 ) + m 3 r g ( l 1 sin θ 1 + l 2 sin θ 2 + 2 l 3 sin θ 3 ) = μ 1 g l 1 sin θ 1 + μ 2 g l 2 sin θ 2 + μ 3 g l 3 sin θ 3 . L = T − V = M 1 l 1 2 θ ˙ 1 2 2 + M 2 l 2 2 θ ˙ 2 2 2 + M 3 l 3 2 θ ˙ 3 2 2 + μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 21 + μ 3 l 3 θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 32 + l 1 θ ˙ 1 cos Δ 31 ) − μ 1 g l 1 sin θ 1 − μ 2 g l 2 sin θ 2 − μ 3 g l 3 sin θ 3 = M 1 l 1 2 θ ˙ 1 2 2 + M 2 l 2 2 θ ˙ 2 2 2 + M 3 l 3 2 θ ˙ 3 2 2 + μ 2 l 2 ( l 1 θ ˙ 1 θ ˙ 2 cos Δ 21 − g sin θ 2 ) + μ 3 l 3 ( θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 32 + l 1 θ ˙ 1 cos Δ 31 ) − g sin θ 3 ) − μ 1 g l 1 sin θ 1 . \begin{aligned} \mathcal{L} &= T - V\\ &= \dfrac{M_1 l_1^2 \dot{\theta}_1^2}{2} + \dfrac{M_2 l_2^2 \dot{\theta}_2^2}{2} + \dfrac{M_3 l_3^2 \dot{\theta}_3^2}{2} + \mu_2 l_1l_2 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}} + \mu_3 l_3\dot{\theta}_3(l_2\dot{\theta}_2\cos{\Delta_{32}}+l_1\dot{\theta}_1\cos{\Delta_{31}}) - \mu_1 gl_1 \sin{\theta_1} - \mu_2 gl_2\sin{\theta_2} - \mu_3 gl_3\sin{\theta_3} \\ &= \dfrac{M_1 l_1^2 \dot{\theta}_1^2}{2} + \dfrac{M_2 l_2^2 \dot{\theta}_2^2}{2} + \dfrac{M_3 l_3^2 \dot{\theta}_3^2}{2} + \mu_2 l_2(l_1 \dot{\theta}_1 \dot{\theta}_2 \cos{\Delta_{21}}-g\sin{\theta_2}) + \mu_3 l_3(\dot{\theta}_3(l_2\dot{\theta}_2\cos{\Delta_{32}}+l_1\dot{\theta}_1\cos{\Delta_{31}})-g\sin{\theta_3}) - \mu_1 gl_1 \sin{\theta_1}. \end{aligned} L = T − V = 2 M 1 l 1 2 θ ˙ 1 2 + 2 M 2 l 2 2 θ ˙ 2 2 + 2 M 3 l 3 2 θ ˙ 3 2 + μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 cos Δ 2 1 + μ 3 l 3 θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 3 2 + l 1 θ ˙ 1 cos Δ 3 1 ) − μ 1 g l 1 sin θ 1 − μ 2 g l 2 sin θ 2 − μ 3 g l 3 sin θ 3 = 2 M 1 l 1 2 θ ˙ 1 2 + 2 M 2 l 2 2 θ ˙ 2 2 + 2 M 3 l 3 2 θ ˙ 3 2 + μ 2 l 2 ( l 1 θ ˙ 1 θ ˙ 2 cos Δ 2 1 − g sin θ 2 ) + μ 3 l 3 ( θ ˙ 3 ( l 2 θ ˙ 2 cos Δ 3 2 + l 1 θ ˙ 1 cos Δ 3 1 ) − g sin θ 3 ) − μ 1 g l 1 sin θ 1 . Q θ 1 = − ( b 1 b + c 1 b ∣ v 1 b ∣ ) v ⃗ 1 b ⋅ e ^ 1 b , θ 1 − ( b 1 r + c 1 r ∣ v 1 r ∣ ) v ⃗ 1 r ⋅ e ^ 1 r , θ 1 − ( b 2 b + c 2 b ∣ v 2 b ∣ ) v ⃗ 2 b ⋅ e ^ 2 b , θ 1 − ( b 2 r + c 2 r ∣ v 2 r ∣ ) v ⃗ 2 r ⋅ e ^ 2 r , θ 1 − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v ⃗ 3 b ⋅ e ^ 3 b , θ 1 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v ⃗ 3 r ⋅ e ^ 3 r , θ 1 . \begin{aligned} Q_{\theta_1} &= -(b_{1b}+c_{1b}|v_{1b}|)\vec{v}_{1b} \cdot \hat{e}_{1b, \theta_1}-(b_{1r}+c_{1r}|v_{1r}|)\vec{v}_{1r} \cdot \hat{e}_{1r, \theta_1} -(b_{2b}+c_{2b}|v_{2b}|)\vec{v}_{2b} \cdot \hat{e}_{2b, \theta_1}-(b_{2r}+c_{2r}|v_{2r}|)\vec{v}_{2r} \cdot \hat{e}_{2r, \theta_1} -(b_{3b}+c_{3b}|v_{3b}|)\vec{v}_{3b} \cdot \hat{e}_{3b, \theta_1}-(b_{3r}+c_{3r}|v_{3r}|)\vec{v}_{3r} \cdot \hat{e}_{3r, \theta_1}. \end{aligned} Q θ 1 = − ( b 1 b + c 1 b ∣ v 1 b ∣ ) v 1 b ⋅ e ^ 1 b , θ 1 − ( b 1 r + c 1 r ∣ v 1 r ∣ ) v 1 r ⋅ e ^ 1 r , θ 1 − ( b 2 b + c 2 b ∣ v 2 b ∣ ) v 2 b ⋅ e ^ 2 b , θ 1 − ( b 2 r + c 2 r ∣ v 2 r ∣ ) v 2 r ⋅ e ^ 2 r , θ 1 − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v 3 b ⋅ e ^ 3 b , θ 1 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v 3 r ⋅ e ^ 3 r , θ 1 . We will not substitute our values of v 2 b v_{2b} v 2 b to v 3 r v_{3r} v 3 r as they will only complicate our equation
Q θ 1 = − ( b 1 b + c 1 b l 1 ∣ θ ˙ 1 ∣ ) l 1 2 θ ˙ 1 − ( b 1 r + c 1 r l 1 ∣ θ ˙ 1 ∣ 2 ) l 1 2 θ ˙ 1 4 − ( b 2 b + c 2 b ∣ v 2 b ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 21 ) − ( b 2 r + c 2 r ∣ v 2 r ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 21 2 ) − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 21 + l 1 l 3 θ ˙ 3 cos Δ 31 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 21 + l 1 l 3 θ ˙ 3 cos Δ 31 2 ) . \begin{aligned} Q_{\theta_1} &=-(b_{1b}+c_{1b}l_1|\dot{\theta}_1|)l_1^2 \dot{\theta}_1-\left(b_{1r}+c_{1r}\dfrac{l_1|\dot{\theta}_1|}{2}\right)\dfrac{l_1^2 \dot{\theta}_1}{4} -(b_{2b}+c_{2b}|v_{2b}|)(l_1^2\dot{\theta}_1 + l_1l_2\dot{\theta}_2\cos{\Delta_{21}})-(b_{2r}+c_{2r}|v_{2r}|)(l_1^2\dot{\theta}_1 + \dfrac{l_1l_2\dot{\theta}_2\cos{\Delta_{21}}}{2}) -(b_{3b}+c_{3b}|v_{3b}|)(l_1^2\dot{\theta}_1 + l_1l_2\dot{\theta}_2\cos{\Delta_{21}}+l_1l_3\dot{\theta}_3\cos{\Delta_{31}})-(b_{3r}+c_{3r}|v_{3r}|)(l_1^2\dot{\theta}_1 + l_1l_2\dot{\theta}_2\cos{\Delta_{21}}+\dfrac{l_1l_3\dot{\theta}_3\cos{\Delta_{31}}}{2}). \end{aligned} Q θ 1 = − ( b 1 b + c 1 b l 1 ∣ θ ˙ 1 ∣ ) l 1 2 θ ˙ 1 − ( b 1 r + c 1 r 2 l 1 ∣ θ ˙ 1 ∣ ) 4 l 1 2 θ ˙ 1 − ( b 2 b + c 2 b ∣ v 2 b ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 2 1 ) − ( b 2 r + c 2 r ∣ v 2 r ∣ ) ( l 1 2 θ ˙ 1 + 2 l 1 l 2 θ ˙ 2 cos Δ 2 1 ) − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 2 1 + l 1 l 3 θ ˙ 3 cos Δ 3 1 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( l 1 2 θ ˙ 1 + l 1 l 2 θ ˙ 2 cos Δ 2 1 + 2 l 1 l 3 θ ˙ 3 cos Δ 3 1 ) . The generalized dissipative force for θ 2 \theta_2 θ 2 is (pendulum 1 terms are ignored because their generalized basis vectors are zero)
Q θ 2 = − ( b 2 b + c 2 b ∣ v 2 b ∣ ) v ⃗ 2 b ⋅ e ^ 2 b , θ 2 − ( b 2 r + c 2 r ∣ v 2 r ∣ ) v ⃗ 2 r ⋅ e ^ 2 r , θ 2 − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v ⃗ 3 b ⋅ e ^ 3 b , θ 2 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v ⃗ 3 r ⋅ e ^ 3 r , θ 2 = − ( b 2 b + c 2 b ∣ v 2 b ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 21 ) − ( b 2 r + c 2 r ∣ v 2 r ∣ ) ( l 2 2 θ ˙ 2 4 + l 1 l 2 θ ˙ 1 cos Δ 21 2 ) − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 21 + l 2 l 3 θ ˙ 3 cos Δ 32 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 21 + l 2 l 3 θ ˙ 3 cos Δ 32 2 ) . \begin{aligned} Q_{\theta_2} &= -(b_{2b}+c_{2b}|v_{2b}|)\vec{v}_{2b} \cdot \hat{e}_{2b, \theta_2} - (b_{2r}+c_{2r}|v_{2r}|) \vec{v}_{2r} \cdot \hat{e}_{2r, \theta_2} -(b_{3b}+c_{3b}|v_{3b}|)\vec{v}_{3b} \cdot \hat{e}_{3b, \theta_2} - (b_{3r}+c_{3r}|v_{3r}|) \vec{v}_{3r} \cdot \hat{e}_{3r, \theta_2}\\ &= -(b_{2b}+c_{2b}|v_{2b}|)(l_2^2 \dot{\theta}_2 + l_1l_2 \dot{\theta}_1 \cos{\Delta_{21}}) - (b_{2r}+c_{2r}|v_{2r}|) (\dfrac{l_2^2 \dot{\theta}_2}{4} + \dfrac{l_1l_2 \dot{\theta}_1 \cos{\Delta_{21}}}{2}) -(b_{3b}+c_{3b}|v_{3b}|)(l_2^2\dot{\theta}_2 + l_1l_2 \dot{\theta}_1\cos{\Delta_{21}} + l_2l_3\dot{\theta}_3 \cos{\Delta_{32}}) - (b_{3r}+c_{3r}|v_{3r}|) (l_2^2\dot{\theta}_2 + l_1l_2 \dot{\theta}_1\cos{\Delta_{21}} + \dfrac{l_2l_3\dot{\theta}_3 \cos{\Delta_{32}}}{2}). \end{aligned} Q θ 2 = − ( b 2 b + c 2 b ∣ v 2 b ∣ ) v 2 b ⋅ e ^ 2 b , θ 2 − ( b 2 r + c 2 r ∣ v 2 r ∣ ) v 2 r ⋅ e ^ 2 r , θ 2 − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v 3 b ⋅ e ^ 3 b , θ 2 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v 3 r ⋅ e ^ 3 r , θ 2 = − ( b 2 b + c 2 b ∣ v 2 b ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 2 1 ) − ( b 2 r + c 2 r ∣ v 2 r ∣ ) ( 4 l 2 2 θ ˙ 2 + 2 l 1 l 2 θ ˙ 1 cos Δ 2 1 ) − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 2 1 + l 2 l 3 θ ˙ 3 cos Δ 3 2 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( l 2 2 θ ˙ 2 + l 1 l 2 θ ˙ 1 cos Δ 2 1 + 2 l 2 l 3 θ ˙ 3 cos Δ 3 2 ) . Q θ 3 = − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v ⃗ 3 b ⋅ e ^ 3 b , θ 3 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v ⃗ 3 r ⋅ e ^ 3 r , θ 3 = − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 3 2 θ ˙ 3 + l 1 l 3 θ ˙ 1 cos Δ 31 + l 2 l 3 θ ˙ 2 cos Δ 32 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( l 3 2 θ ˙ 3 4 + l 1 l 3 θ ˙ 1 cos Δ 31 2 + l 2 l 3 θ ˙ 3 cos Δ 32 2 ) . \begin{aligned} Q_{\theta_3} &= -(b_{3b}+c_{3b}|v_{3b}|)\vec{v}_{3b} \cdot \hat{e}_{3b, \theta_3} - (b_{3r}+c_{3r}|v_{3r}|) \vec{v}_{3r} \cdot \hat{e}_{3r, \theta_3}\\ &= -(b_{3b}+c_{3b}|v_{3b}|)(l_3^2\dot{\theta}_3 + l_1l_3 \dot{\theta}_1\cos{\Delta_{31}} + l_2l_3\dot{\theta}_2 \cos{\Delta_{32}}) - (b_{3r}+c_{3r}|v_{3r}|) \left(\dfrac{l_3^2\dot{\theta}_3}{4} + \dfrac{l_1l_3 \dot{\theta}_1\cos{\Delta_{31}}}{2} + \dfrac{l_2l_3\dot{\theta}_3 \cos{\Delta_{32}}}{2}\right). \end{aligned} Q θ 3 = − ( b 3 b + c 3 b ∣ v 3 b ∣ ) v 3 b ⋅ e ^ 3 b , θ 3 − ( b 3 r + c 3 r ∣ v 3 r ∣ ) v 3 r ⋅ e ^ 3 r , θ 3 = − ( b 3 b + c 3 b ∣ v 3 b ∣ ) ( l 3 2 θ ˙ 3 + l 1 l 3 θ ˙ 1 cos Δ 3 1 + l 2 l 3 θ ˙ 2 cos Δ 3 2 ) − ( b 3 r + c 3 r ∣ v 3 r ∣ ) ( 4 l 3 2 θ ˙ 3 + 2 l 1 l 3 θ ˙ 1 cos Δ 3 1 + 2 l 2 l 3 θ ˙ 3 cos Δ 3 2 ) . p θ 1 = ∂ L ∂ θ ˙ 1 = M 1 l 1 2 θ ˙ 1 + μ 2 l 1 l 2 θ ˙ 2 cos Δ 21 + μ 3 l 1 l 3 θ ˙ 3 cos Δ 31 p ˙ θ 1 = M 1 l 1 2 θ ¨ 1 + μ 2 l 1 l 2 ( θ ¨ 2 cos Δ 21 − θ ˙ 2 ( θ ˙ 2 − θ 1 ) sin Δ 21 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 31 − θ ˙ 3 ( θ ˙ 3 − θ 1 ˙ ) sin Δ 31 ) F θ 1 = ∂ L ∂ θ 1 = − μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 ∂ Δ 21 ∂ θ 1 sin Δ 21 − μ 3 l 1 l 3 θ ˙ 1 θ ˙ 3 ∂ Δ 31 ∂ θ 1 sin Δ 31 − μ 1 g l 1 cos θ 1 = μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 sin Δ 21 + μ 3 l 1 l 3 θ ˙ 1 θ ˙ 3 sin Δ 31 − μ 1 g l 1 cos θ 1 \begin{aligned} p_{\theta_1} &= \dfrac{\partial \mathcal{L}}{\partial \dot{\theta}_1} \\ &= M_1 l_1^2 \dot{\theta}_1 + \mu_2 l_1l_2 \dot{\theta}_2\cos{\Delta_{21}} + \mu_3 l_1 l_3\dot{\theta}_3\cos{\Delta_{31}} \\ \dot{p}_{\theta_1} &= M_1 l_1^2 \ddot{\theta}_1 + \mu_2 l_1l_2 (\ddot{\theta}_2\cos{\Delta_{21}} - \dot{\theta}_2(\dot{\theta}_2-\theta_1)\sin{\Delta_{21}}) + \mu_3 l_1 l_3(\ddot{\theta}_3\cos{\Delta_{31}} - \dot{\theta}_3(\dot{\theta}_3-\dot{\theta_1})\sin{\Delta_{31}}) \\ F_{\theta_1} &= \dfrac{\partial \mathcal{L}}{\partial \theta_1} \\ &= -\mu_2 l_1 l_2 \dot{\theta}_1\dot{\theta}_2\dfrac{\partial \Delta_{21}}{\partial \theta_1}\sin{\Delta_{21}} - \mu_3l_1 l_3\dot{\theta}_1\dot{\theta}_3\dfrac{\partial \Delta_{31}}{\partial \theta_1}\sin{\Delta_{31}} - \mu_1 gl_1\cos{\theta_1} \\ &= \mu_2 l_1 l_2 \dot{\theta}_1\dot{\theta}_2\sin{\Delta_{21}} + \mu_3l_1 l_3\dot{\theta}_1\dot{\theta}_3\sin{\Delta_{31}} - \mu_1 gl_1\cos{\theta_1} \end{aligned} p θ 1 p ˙ θ 1 F θ 1 = ∂ θ ˙ 1 ∂ L = M 1 l 1 2 θ ˙ 1 + μ 2 l 1 l 2 θ ˙ 2 cos Δ 2 1 + μ 3 l 1 l 3 θ ˙ 3 cos Δ 3 1 = M 1 l 1 2 θ ¨ 1 + μ 2 l 1 l 2 ( θ ¨ 2 cos Δ 2 1 − θ ˙ 2 ( θ ˙ 2 − θ 1 ) sin Δ 2 1 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 3 1 − θ ˙ 3 ( θ ˙ 3 − θ 1 ˙ ) sin Δ 3 1 ) = ∂ θ 1 ∂ L = − μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 ∂ θ 1 ∂ Δ 2 1 sin Δ 2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cos Δ 21 − θ ˙ 2 2 sin Δ 21 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 31 − θ ˙ 3 2 sin Δ 31 ) + μ 1 g l 1 cos θ 1 . \begin{aligned} \delta'_{\theta_1} \mathcal{L} &= \dot{p}_{\theta_1} - F_{\theta_1} \\ &= M_1 l_1^2 \ddot{\theta}_1 + \mu_2 l_1l_2 (\ddot{\theta}_2\cos{\Delta_{21}} - \dot{\theta}_2(\dot{\theta}_2-\theta_1)\sin{\Delta_{21}}) + \mu_3 l_1 l_3(\ddot{\theta}_3\cos{\Delta_{31}} - \dot{\theta}_3(\dot{\theta}_3-\dot{\theta_1})\sin{\Delta_{31}}) - \mu_2 l_1 l_2 \dot{\theta}_1\dot{\theta}_2\sin{\Delta_{21}} + \mu_3l_1 l_3\dot{\theta}_1\dot{\theta}_3\sin{\Delta_{31}} + \mu_1 gl_1\cos{\theta_1}\\ &= M_1 l_1^2 \ddot{\theta}_1 + \mu_2 l_1l_2 (\ddot{\theta}_2\cos{\Delta_{21}} - [\dot{\theta}_2(\dot{\theta}_2-\theta_1)+\dot{\theta}_1\dot{\theta}_2]\sin{\Delta_{21}}) + \mu_3 l_1 l_3(\ddot{\theta}_3\cos{\Delta_{31}} - [\dot{\theta}_3(\dot{\theta}_3-\dot{\theta_1})+\dot{\theta}_1\dot{\theta}_3]\sin{\Delta_{31}}) + \mu_1 gl_1\cos{\theta_1} \\ &= M_1 l_1^2 \ddot{\theta}_1 + \mu_2 l_1l_2 (\ddot{\theta}_2\cos{\Delta_{21}} - \dot{\theta}_2(\dot{\theta}_2-\theta_1)\sin{\Delta_{21}}) + \mu_3 l_1 l_3(\ddot{\theta}_3\cos{\Delta_{31}} - \dot{\theta}_3(\dot{\theta}_3-\dot{\theta_1})\sin{\Delta_{31}}) - \mu_2 l_1 l_2 \dot{\theta}_1\dot{\theta}_2\sin{\Delta_{21}} + \mu_3l_1 l_3\dot{\theta}_1\dot{\theta}_3\sin{\Delta_{31}} + \mu_1 gl_1\cos{\theta_1}\\ &= M_1 l_1^2 \ddot{\theta}_1 + \mu_2 l_1l_2 (\ddot{\theta}_2\cos{\Delta_{21}} - \dot{\theta}_2^2\sin{\Delta_{21}}) + \mu_3 l_1 l_3(\ddot{\theta}_3\cos{\Delta_{31}} - \dot{\theta}_3^2\sin{\Delta_{31}}) + \mu_1 gl_1\cos{\theta_1}. \end{aligned} δ θ 1 ′ L = p ˙ θ 1 − F θ 1 = M 1 l 1 2 θ ¨ 1 + μ 2 l 1 l 2 ( θ ¨ 2 cos Δ 2 1 − θ ˙ 2 ( θ ˙ 2 − θ 1 ) sin Δ 2 1 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 3 1 − θ ˙ 3 ( θ ˙ 3 − θ 1 ˙ ) sin Δ 3 1 ) − μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 sin Δ 2 1 + μ 3 l 1 l 3 θ ˙ 1 θ ˙ 3 sin Δ 3 1 + μ 1 g l 1 cos θ 1 = M 1 l 1 2 θ ¨ 1 + μ 2 l 1 l 2 ( θ ¨ 2 cos Δ 2 1 − [ θ ˙ 2 ( θ ˙ 2 − θ 1 ) + θ ˙ 1 θ ˙ 2 ] sin Δ 2 1 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 3 1 − [ θ ˙ 3 ( θ ˙ 3 − θ 1 ˙ ) + θ ˙ 1 θ ˙ 3 ] sin Δ 3 1 ) + μ 1 g l 1 cos θ 1 = M 1 l 1 2 θ ¨ 1 + μ 2 l 1 l 2 ( θ ¨ 2 cos Δ 2 1 − θ ˙ 2 ( θ ˙ 2 − θ 1 ) sin Δ 2 1 ) + μ 3 l 1 l 3 ( θ ¨ 3 cos Δ 3 1 − θ ˙ 3 ( θ ˙ 3 − θ 1 ˙ ) sin Δ 3 1 ) − μ 2 l 1 l 2 θ ˙ 1 θ ˙ 2 sin Δ 2 1 + μ 3 l 1 l 3 θ ˙ 1 θ ˙ 3 sin Δ 3 1 + μ 1 g l 1 cos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sin Δ 21 ) + μ 3 l 2 l 3 ( θ ¨ 3 cos Δ 32 − θ ˙ 3 2 sin Δ 32 ) + μ 2 l 2 g cos θ 2 = M 2 l 2 2 θ ¨ 2 + μ 2 l 2 ( l 1 ( θ ¨ 1 cos Δ 21 + θ ˙ 1 2 sin Δ 21 ) + g cos θ 2 ) + μ 3 l 2 l 3 ( θ ¨ 3 cos Δ 32 − θ ˙ 3 2 sin Δ 32 ) . \begin{aligned} p_{\theta_2} &= \dfrac{\partial \mathcal{L}}{\partial \dot{\theta}_2} \\ &= M_2 l_2^2 \dot{\theta}_2 + \mu_2 l_1l_2 \dot{\theta}_1\cos{\Delta_{21}} + \mu_3 l_2l_3 \dot{\theta}_3 \cos{\Delta_{32}}\\ \dot{p}_{\theta_2} &= M_2 l_2^2 \ddot{\theta}_2 + \mu_2 l_1l_2 (\ddot{\theta}_1\cos{\Delta_{21}} - \dot{\theta}_1 (\dot{\theta}_2-\dot{\theta}_1)\sin{\Delta_{21}})+ \mu_3 l_2l_3 (\ddot{\theta}_3 \cos{\Delta_{32}} -\dot{\theta}_3 (\dot{\theta}_3-\dot{\theta}_2)\sin{\Delta_{32}})\\ F_{\theta_2} &= -\mu_2 l_2(l_1\dot{\theta}_1\dot{\theta}_2 \dfrac{\partial \Delta_{21}}{\partial \theta_2}\sin{\Delta_{21}}+g\cos{\theta_2}) - \mu_3 l_2l_3\dot{\theta}_2\dot{\theta}_3\dfrac{\partial \Delta_{32}}{\partial \theta_2}\sin{\Delta_{32}}\\ &= -\mu_2 l_2(l_1\dot{\theta}_1\dot{\theta}_2 \sin{\Delta_{21}}+g\cos{\theta_2}) + \mu_3 l_2l_3\dot{\theta}_2\dot{\theta}_3\sin{\Delta_{32}}\\ \delta'_{\theta_2} \mathcal{L} &= M_2 l_2^2 \ddot{\theta}_2 + \mu_2 l_1l_2 (\ddot{\theta}_1\cos{\Delta_{21}} - \dot{\theta}_1 (\dot{\theta}_2-\dot{\theta}_1)\sin{\Delta_{21}})+ \mu_3 l_2l_3 (\ddot{\theta}_3 \cos{\Delta_{32}} -\dot{\theta}_3 (\dot{\theta}_3-\dot{\theta}_2)\sin{\Delta_{32}}) + \mu_2 l_2(l_1\dot{\theta}_1\dot{\theta}_2 \sin{\Delta_{21}}+g\cos{\theta_2}) - \mu_3 l_2l_3\dot{\theta}_2\dot{\theta}_3\sin{\Delta_{32}} \\ &= M_2 l_2^2 \ddot{\theta}_2 + \mu_2 l_1l_2 (\ddot{\theta}_1\cos{\Delta_{21}} + \dot{\theta}_1^2\sin{\Delta_{21}})+ \mu_3 l_2l_3 (\ddot{\theta}_3 \cos{\Delta_{32}} -\dot{\theta}_3^2\sin{\Delta_{32}}) +\mu_2 l_2g\cos{\theta_2} \\ &= M_2 l_2^2 \ddot{\theta}_2 + \mu_2 l_2 (l_1(\ddot{\theta}_1\cos{\Delta_{21}} + \dot{\theta}_1^2\sin{\Delta_{21}})+g\cos{\theta_2})+ \mu_3 l_2l_3 (\ddot{\theta}_3 \cos{\Delta_{32}} -\dot{\theta}_3^2\sin{\Delta_{32}}). \end{aligned} p θ 2 p ˙ θ 2 F θ 2 δ θ 2 ′ L = ∂ θ ˙ 2 ∂ L = M 2 l 2 2 θ ˙ 2 + μ 2 l 1 l 2 θ ˙ 1 cos Δ 2 1 + μ 3 l 2 l 3 θ ˙ 3 cos Δ 3 2 = M 2 l 2 2 θ ¨ 2 + μ 2 l 1 l 2 ( θ ¨ 1 cos Δ 2 1 − θ ˙ 1 ( θ ˙ 2 − θ ˙ 1 ) sin Δ 2 1 ) + μ 3 l 2 l 3 ( θ ¨ 3 cos Δ 3 2 − θ ˙ 3 ( θ ˙ 3 − θ ˙ 2 ) sin Δ 3 2 ) = − μ 2 l 2 ( l 1 θ ˙ 1 θ ˙ 2 ∂ θ 2 ∂ Δ 2 1 sin Δ 2 1 + g cos θ 2 ) − μ 3 l 2 l 3 θ ˙ 2 θ ˙ 3 ∂ θ 2 ∂ Δ 3 2 sin Δ 3 2 = − μ 2 l 2 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 3 sin Δ 32 + l 1 θ ˙ 1 ∂ Δ 31 ∂ θ 3 sin Δ 31 ) + g cos θ 3 ] = − μ 3 l 3 [ θ ˙ 3 ( l 2 θ ˙ 2 sin Δ 32 + l 1 θ ˙ 1 sin Δ 31 ) + g cos θ 3 ] δ θ 3 ′ L = M 3 l 3 2 θ ¨ 3 + μ 3 l 3 ( l 2 ( θ ¨ 2 cos Δ 32 − θ ˙ 2 ( θ ˙ 3 − θ ˙ 2 ) sin Δ 32 ) + l 1 ( θ ¨ 1 cos Δ 31 − θ ˙ 1 ( θ ˙ 3 − θ ˙ 1 ) sin Δ 31 ) ) + μ 3 l 3 [ θ ˙ 3 ( l 2 θ ˙ 2 sin Δ 32 + l 1 θ ˙ 1 sin Δ 31 ) + g cos θ 3 ] = M 3 l 3 2 θ ¨ 3 + μ 3 l 3 [ l 2 ( θ ¨ 2 cos Δ 32 + θ ˙ 2 2 sin Δ 32 ) + l 1 ( θ ¨ 1 cos Δ 31 + θ ˙ 1 2 sin Δ 31 ) + g cos θ 3 ] . \begin{aligned} p_{\theta_3} &= \dfrac{\partial \mathcal{L}}{\partial \dot{\theta}_3} \\ &= M_3 l_3^2 \dot{\theta}_3 + \mu_3 l_3(l_2 \dot{\theta}_2\cos{\Delta_{32}}+l_1\dot{\theta}_1\cos{\Delta_{31}}) \\ \dot{p}_{\theta_3} &= M_3 l_3^2 \ddot{\theta}_3 + \mu_3 l_3(l_2 (\ddot{\theta}_2\cos{\Delta_{32}} - \dot{\theta}_2 (\dot{\theta}_3-\dot{\theta}_2)\sin{\Delta_{32}})+l_1(\ddot{\theta}_1\cos{\Delta_{31}}-\dot{\theta}_1(\dot{\theta}_3-\dot{\theta}_1)\sin{\Delta_{31}})) \\ F_{\theta_3} &= \dfrac{\partial \mathcal{L}}{\partial \theta_3} \\ &= -\mu_3 l_3\left[\dot{\theta}_3 (l_2\dot{\theta}_2 \dfrac{\partial \Delta_{32}}{\partial \theta_3}\sin{\Delta_{32}}+l_1\dot{\theta}_1\dfrac{\partial \Delta_{31}}{\partial \theta_3}\sin{\Delta_{31}}) + g\cos{\theta_3}\right] \\ &= -\mu_3 l_3\left[\dot{\theta}_3 (l_2\dot{\theta}_2 \sin{\Delta_{32}}+l_1\dot{\theta}_1\sin{\Delta_{31}}) + g\cos{\theta_3}\right] \\ \delta'_{\theta_3} \mathcal{L} &= M_3l_3^2 \ddot{\theta}_3 + \mu_3 l_3(l_2 (\ddot{\theta}_2\cos{\Delta_{32}} - \dot{\theta}_2 (\dot{\theta}_3-\dot{\theta}_2)\sin{\Delta_{32}})+l_1(\ddot{\theta}_1\cos{\Delta_{31}}-\dot{\theta}_1(\dot{\theta}_3-\dot{\theta}_1)\sin{\Delta_{31}})) + \mu_3 l_3\left[\dot{\theta}_3 (l_2\dot{\theta}_2 \sin{\Delta_{32}}+l_1\dot{\theta}_1\sin{\Delta_{31}}) + g\cos{\theta_3}\right]\\ &= M_3l_3^2 \ddot{\theta}_3 + \mu_3 l_3\left[l_2 (\ddot{\theta}_2\cos{\Delta_{32}} + \dot{\theta}_2^2\sin{\Delta_{32}})+l_1(\ddot{\theta}_1\cos{\Delta_{31}}+\dot{\theta}_1^2\sin{\Delta_{31}})+g\cos{\theta_3}\right]. \end{aligned} p θ 3 p ˙ θ 3 F θ 3 δ θ 3 ′ L = ∂ θ ˙ 3 ∂ L = M 3 l 3 2 θ ˙ 3 + μ 3 l 3 ( l 2 θ ˙ 2 cos Δ 3 2 + l 1 θ ˙ 1 cos Δ 3 1 ) = M 3 l 3 2 θ ¨ 3 + μ 3 l 3 ( l 2 ( θ ¨ 2 cos Δ 3 2 − θ ˙ 2 ( θ ˙ 3 − θ ˙ 2 ) sin Δ 3 2 ) + l 1 ( θ ¨ 1 cos Δ 3 1 − θ ˙ 1 ( θ ˙ 3 − θ ˙ 1 ) sin Δ 3 1 ) ) = ∂ θ 3 ∂ L = − μ 3 l 3 [ θ ˙ 3 ( l 2 θ ˙ 2 ∂ θ 3 ∂ Δ 3 2 sin Δ 3 2 + l 1 θ ˙ 1 ∂ θ 3 ∂ Δ 3 1 sin Δ 3 1 ) + g cos θ 3 ] = − μ 3 l 3 [ θ ˙ 3 ( l 2 θ ˙ 2 sin Δ 3 2 + l 1 θ ˙ 1 sin Δ 3 1 ) + g cos θ 3 ] = M 3 l 3 2 θ ¨ 3 + μ 3 l 3 ( l 2 ( θ ¨ 2 cos Δ 3 2 − θ ˙ 2 ( θ ˙ 3 − θ ˙ 2 ) sin Δ 3 2 ) + l 1 ( θ ¨ 1 cos Δ 3 1 − θ ˙ 1 ( θ ˙ 3 − θ ˙ 1 ) sin Δ 3 1 ) ) + μ 3 l 3 [ θ ˙ 3 ( l 2 θ ˙ 2 sin Δ 3 2 + l 1 θ ˙ 1 sin Δ 3 1 ) + g cos θ 3 ] = M 3 l 3 2 θ ¨ 3 + μ 3 l 3 [ l 2 ( θ ¨ 2 cos Δ 3 2 + θ ˙ 2 2 sin Δ 3 2 ) + l 1 ( θ ¨ 1 cos Δ 3 1 + θ ˙ 1 2 sin Δ 3 1 ) + g cos θ 3 ] . Hence given our equations of motion are δ θ i ′ L = Q θ i \delta'_{\theta_i}\mathcal{L} = Q_{\theta_i} δ θ i ′ L = Q θ i , we could write them in matrix form as (given how long Q θ i Q_{\theta_i} Q θ i is, we will not expand on it)
[ M 1 l 1 2 μ 2 l 1 l 2 cos Δ 21 μ 3 l 1 l 3 cos Δ 31 μ 2 l 1 l 2 cos Δ 21 M 2 l 2 2 μ 3 l 2 l 3 cos Δ 32 μ 3 l 1 l 3 cos Δ 31 μ 3 l 2 l 3 cos Δ 32 M 3 l 3 2 ] [ θ ¨ 1 θ ¨ 2 θ ¨ 3 ] = [ Q θ 1 − μ 1 g l 1 cos θ 1 + μ 2 l 1 l 2 θ ˙ 2 2 sin Δ 21 + μ 3 l 1 l 3 θ ˙ 3 2 sin Δ 31 Q θ 2 − μ 2 l 2 ( l 1 θ ˙ 1 2 sin Δ 21 + g cos θ 2 ) + μ 3 l 2 l 3 θ ˙ 3 2 sin Δ 32 Q θ 3 − μ 3 l 3 ( l 1 θ ˙ 1 2 sin Δ 31 + l 2 θ ˙ 2 2 sin Δ 32 + g cos θ 3 ) ] . \begin{aligned} \begin{bmatrix} M_1 l_1^2 & \mu_2 l_1l_2 \cos{\Delta_{21}} & \mu_3 l_1l_3 \cos{\Delta_{31}} \\ \mu_2 l_1l_2 \cos{\Delta_{21}} & M_2 l_2^2 & \mu_3 l_2l_3 \cos{\Delta_{32}} \\ \mu_3 l_1l_3 \cos{\Delta_{31}} & \mu_3 l_2 l_3 \cos{\Delta_{32}} & M_3 l_3^2 \end{bmatrix} \begin{bmatrix} \ddot{\theta}_1 \\ \ddot{\theta}_2 \\ \ddot{\theta}_3 \end{bmatrix} &= \begin{bmatrix} Q_{\theta_1} - \mu_1gl_1\cos{\theta_1} + \mu_2 l_1l_2\dot{\theta}_2^2 \sin{\Delta_{21}} + \mu_3l_1l_3 \dot{\theta}_3^2 \sin{\Delta_{31}}\\ Q_{\theta_2} - \mu_2 l_2 (l_1\dot{\theta}_1^2\sin{\Delta_{21}}+g\cos{\theta_2}) + \mu_3 l_2l_3\dot{\theta}_3^2 \sin{\Delta_{32}}\\ Q_{\theta_3} - \mu_3 l_3 (l_1 \dot{\theta}_1^2 \sin{\Delta_{31}} + l_2 \dot{\theta}_2^2 \sin{\Delta_{32}}+g\cos{\theta_3}) \end{bmatrix}. \end{aligned} ⎣ ⎢ ⎡ M 1 l 1 2 μ 2 l 1 l 2 cos Δ 2 1 μ 3 l 1 l 3 cos Δ 3 1 μ 2 l 1 l 2 cos Δ 2 1 M 2 l 2 2 μ 3 l 2 l 3 cos Δ 3 2 μ 3 l 1 l 3 cos Δ 3 1 μ 3 l 2 l 3 cos Δ 3 2 M 3 l 3 2 ⎦ ⎥ ⎤ ⎣ ⎢ ⎡ θ ¨ 1 θ ¨ 2 θ ¨ 3 ⎦ ⎥ ⎤ = ⎣ ⎢ ⎡ Q θ 1 − μ 1 g l 1 cos θ 1 + μ 2 l 1 l 2 θ ˙ 2 2 sin Δ 2 1 + μ 3 l 1 l 3 θ ˙ 3 2 sin Δ 3 1 Q θ 2 − μ 2 l 2 ( l 1 θ ˙ 1 2 sin Δ 2 1 + g cos θ 2 ) + μ 3 l 2 l 3 θ ˙ 3 2 sin Δ 3 2 Q θ 3 − μ 3 l 3 ( l 1 θ ˙ 1 2 sin Δ 3 1 + l 2 θ ˙ 2 2 sin Δ 3 2 + g cos θ 3 ) ⎦ ⎥ ⎤ .