Derivation of the equations of motion of the triple pendulum

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.

Positions, velocities and generalized basis vectors

Figure 1: Diagram of the triple pendulum.

Pendulum bob 1

x1b=l1cosθ1,y1b=l1sinθ1,x˙1b=l1θ˙1sinθ1,y˙1b=l1θ˙1cosθ1v1b=l1θ˙1v1b=l1θ˙1[sinθ1cosθ1],e^1b,θ1=l1[sinθ1cosθ1],e^1b,θ2=e^1b,θ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}

Pendulum rod 1

x1r=l1cosθ12,y1r=l1sinθ12,x˙1r=l1θ˙1cosθ12,y˙1r=l1θ˙1cosθ12v1r=l1θ˙12v1r=l1θ˙12[sinθ1cosθ1],e^1r,θ1=l12[sinθ1cosθ1],e^1r,θ2=e^1r,θ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}

Pendulum bob 2

Defining Δij=θiθj\Delta_{ij} = \theta_i - \theta_j, we get

x2b=l1cosθ1+l2cosθ2,y2b=l1sinθ1+l2sinθ2x˙2b=l1θ1˙sinθ1l2θ2˙sinθ2,y˙2b=l1θ1˙cosθ1+l2θ2˙cosθ2v2b=l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22v2b=[l1θ1˙sinθ1l2θ2˙sinθ2l1θ1˙cosθ1+l2θ2˙cosθ2],e^2b,θ1=l1[sinθ1cosθ1],e^2b,θ2=l2[sinθ2cosθ2],e^2b,θ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}

Pendulum rod 2

x2r=l1cosθ1+l2cosθ22,y2r=l1sinθ1+l2sinθ22x˙2r=l1θ1˙sinθ1l2θ2˙sinθ22,y˙2r=l1θ1˙cosθ1+l2θ2˙cosθ22v2r=l12θ˙12+l1l2θ˙1θ˙2cosΔ21+l22θ˙224v2r=[l1θ1˙sinθ1l2θ2˙sinθ22l1θ1˙cosθ1+l2θ2˙cosθ22],e^2r,θ1=l1[sinθ1cosθ1],e^2r,θ2=l22[sinθ2cosθ2],e^2r,θ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}

Pendulum bob 3

x3b=l1cosθ1+l2cosθ2+l3cosθ3,y3b=l1sinθ1+l2sinθ2+l3sinθ3x˙3b=l1θ1˙sinθ1l2θ˙2sinθ2l3θ3˙sinθ3,y˙3b=l1θ1˙cosθ1+l2θ˙2cosθ2+l3θ3˙cosθ3v3b=l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22+2l2l3θ˙2θ˙3cosΔ32+2l1l3θ˙1θ˙3cosΔ31+l32θ˙32v3b=[l1θ1˙sinθ1l2θ2˙sinθ2l3θ3˙sinθ3l1θ1˙cosθ1+l2θ2˙cosθ2+l3θ3˙cosθ3],e^3b,θ1=l1[sinθ1cosθ1],e^3b,θ2=l2[sinθ2cosθ2],e^3b,θ3=l3[sinθ3cosθ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}

Pendulum rod 3

x3r=l1cosθ1+l2cosθ2+l3cosθ32,y3r=l1sinθ1+l2sinθ2+l3sinθ32x˙3r=l1θ1˙sinθ1l2θ˙2sinθ2l3θ3˙sinθ32,y˙3r=l1θ1˙cosθ1+l2θ˙2cosθ2+l3θ3˙cosθ32v3r=l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22+l1l3θ˙1θ˙3cosΔ31+l2l3θ˙2θ˙3cosΔ32+l32θ˙324v3r=[l1θ1˙sinθ1l2θ2˙sinθ22l3θ3˙sinθ32l1θ1˙cosθ1+l2θ2˙cosθ22+l3θ3˙cosθ32],e^3r,θ1=l1[sinθ1cosθ1],e^3r,θ2=l2[sinθ2cosθ2],e^3r,θ3=l32[sinθ3cosθ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}

Kinetic energy

T=m1b2v1b2+m1r2v1r2+m1rIcm,1rω1r22+m2b2v2b2+m2r2v2r2+m2rIcm,2rω2r22+m3b2v3b2+m3r2v3r2+m3rIcm,3rω3r22=m1bl12θ˙122+m1rl12θ˙128+m1rl12θ˙1224+m2b2(l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22)+m2r2(l12θ˙12+l1l2θ˙1θ˙2cosΔ21+l22θ˙224)+m2rl22θ˙2224+m3b2(l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22+2l2l3θ˙2θ˙3cosΔ32+2l1l3θ˙1θ˙3cosΔ31+l32θ˙32)+m3r2(l12θ˙12+2l1l2θ˙1θ˙2cosΔ21+l22θ˙22+l1l3θ˙1θ˙3cosΔ31+l2l3θ˙2θ˙3cosΔ32+l32θ˙324)+m3rl32θ˙3224=12(m1b+m1r3+m2b+m2r+m3b+m3r)l12θ˙12+12(m2b+m2r3+m3b+m3r)l22θ˙22+12(m3b+m3r3)l32θ˙32+(m2b+m2r2+m3b+m3r)l1l2θ˙1θ˙2cosΔ21+(m3b+m3r2)l3(l2θ˙2θ˙3cosΔ32+l1θ˙1θ˙3cosΔ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_{3r}}{2}\right)l_3(l_2\dot{\theta}_2\dot{\theta}_3\cos{\Delta_{32}}+l_1\dot{\theta}_1\dot{\theta}_3\cos{\Delta_{31}}) \end{aligned}

Defining M1=m1b+m1r3+m2b+m2r+m3b+m3rM_1 = m_{1b}+\dfrac{m_{1r}}{3} + m_{2b} + m_{2r} + m_{3b} + m_{3r}, M2=m2b+m2r3+m3b+m3rM_2 = m_{2b} + \dfrac{m_{2r}}{3} + m_{3b} + m_{3r}, M3=m3b+m3r3M_3 = m_{3b} + \dfrac{m_{3r}}{3}, μ1=m1b+m1r2+m2b+m2r+m3b+m3r\mu_1 = m_{1b}+\dfrac{m_{1r}}{2} + m_{2b} + m_{2r} + m_{3b} + m_{3r}, μ2=m2b+m2r2+m3b+m3r\mu_2 = m_{2b} + \dfrac{m_{2r}}{2} + m_{3b} + m_{3r} and μ3=m3b+m3r2\mu_3 = m_{3b} + \dfrac{m_{3r}}{2}.

T=M1l12θ˙122+M2l22θ˙222+M3l32θ˙322+μ2l1l2θ˙1θ˙2cosΔ21+μ3l3θ˙3(l2θ˙2cosΔ32+l1θ˙1cosΔ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}

Potential energy

V=m1bgy1b+m1rgy1r+m2bgy2b+m2rgy2r+m3bgy3b+m3rgy3r=m1bgl1sinθ1+m1rgl1sinθ12+m2bg(l1sinθ1+l2sinθ2)+m2rg(l1sinθ1+l2sinθ22)+m3bg(l1sinθ1+l2sinθ2+l3sinθ3)+m3rg(l1sinθ1+l2sinθ2+l3sinθ32)=μ1gl1sinθ1+μ2gl2sinθ2+μ3gl3sinθ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}

Lagrangian

L=TV=M1l12θ˙122+M2l22θ˙222+M3l32θ˙322+μ2l1l2θ˙1θ˙2cosΔ21+μ3l3θ˙3(l2θ˙2cosΔ32+l1θ˙1cosΔ31)μ1gl1sinθ1μ2gl2sinθ2μ3gl3sinθ3=M1l12θ˙122+M2l22θ˙222+M3l32θ˙322+μ2l2(l1θ˙1θ˙2cosΔ21gsinθ2)+μ3l3(θ˙3(l2θ˙2cosΔ32+l1θ˙1cosΔ31)gsinθ3)μ1gl1sinθ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}

Generalized dissipative force

θ1\theta_1

Qθ1=(b1b+c1bv1b)v1be^1b,θ1(b1r+c1rv1r)v1re^1r,θ1(b2b+c2bv2b)v2be^2b,θ1(b2r+c2rv2r)v2re^2r,θ1(b3b+c3bv3b)v3be^3b,θ1(b3r+c3rv3r)v3re^3r,θ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}

We will not substitute our values of v2bv_{2b} to v3rv_{3r} as they will only complicate our equation

Qθ1=(b1b+c1bl1θ˙1)l12θ˙1(b1r+c1rl1θ˙12)l12θ˙14(b2b+c2bv2b)(l12θ˙1+l1l2θ˙2cosΔ21)(b2r+c2rv2r)(l12θ˙1+l1l2θ˙2cosΔ212)(b3b+c3bv3b)(l12θ˙1+l1l2θ˙2cosΔ21+l1l3θ˙3cosΔ31)(b3r+c3rv3r)(l12θ˙1+l1l2θ˙2cosΔ21+l1l3θ˙3cosΔ312).\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}

θ2\theta_2

The generalized dissipative force for θ2\theta_2 is (pendulum 1 terms are ignored because their generalized basis vectors are zero)

Qθ2=(b2b+c2bv2b)v2be^2b,θ2(b2r+c2rv2r)v2re^2r,θ2(b3b+c3bv3b)v3be^3b,θ2(b3r+c3rv3r)v3re^3r,θ2=(b2b+c2bv2b)(l22θ˙2+l1l2θ˙1cosΔ21)(b2r+c2rv2r)(l22θ˙24+l1l2θ˙1cosΔ212)(b3b+c3bv3b)(l22θ˙2+l1l2θ˙1cosΔ21+l2l3θ˙3cosΔ32)(b3r+c3rv3r)(l22θ˙2+l1l2θ˙1cosΔ21+l2l3θ˙3cosΔ322).\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}

θ3\theta_3

Qθ3=(b3b+c3bv3b)v3be^3b,θ3(b3r+c3rv3r)v3re^3r,θ3=(b3b+c3bv3b)(l32θ˙3+l1l3θ˙1cosΔ31+l2l3θ˙2cosΔ32)(b3r+c3rv3r)(l32θ˙34+l1l3θ˙1cosΔ312+l2l3θ˙3cosΔ322).\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}

Left-hand side of the Euler-Lagrange equations

θ1\theta_1

pθ1=Lθ˙1=M1l12θ˙1+μ2l1l2θ˙2cosΔ21+μ3l1l3θ˙3cosΔ31p˙θ1=M1l12θ¨1+μ2l1l2(θ¨2cosΔ21θ˙2(θ˙2θ1)sinΔ21)+μ3l1l3(θ¨3cosΔ31θ˙3(θ˙3θ1˙)sinΔ31)Fθ1=Lθ1=μ2l1l2θ˙1θ˙2Δ21θ1sinΔ21μ3l1l3θ˙1θ˙3Δ31θ1sinΔ31μ1gl1cosθ1=μ2l1l2θ˙1θ˙2sinΔ21+μ3l1l3θ˙1θ˙3sinΔ31μ1gl1cosθ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}
δθ1L=p˙θ1Fθ1=M1l12θ¨1+μ2l1l2(θ¨2cosΔ21θ˙2(θ˙2θ1)sinΔ21)+μ3l1l3(θ¨3cosΔ31θ˙3(θ˙3θ1˙)sinΔ31)μ2l1l2θ˙1θ˙2sinΔ21+μ3l1l3θ˙1θ˙3sinΔ31+μ1gl1cosθ1=M1l12θ¨1+μ2l1l2(θ¨2cosΔ21[θ˙2(θ˙2θ1)+θ˙1θ˙2]sinΔ21)+μ3l1l3(θ¨3cosΔ31[θ˙3(θ˙3θ1˙)+θ˙1θ˙3]sinΔ31)+μ1gl1cosθ1=M1l12θ¨1+μ2l1l2(θ¨2cosΔ21θ˙2(θ˙2θ1)sinΔ21)+μ3l1l3(θ¨3cosΔ31θ˙3(θ˙3θ1˙)sinΔ31)μ2l1l2θ˙1θ˙2sinΔ21+μ3l1l3θ˙1θ˙3sinΔ31+μ1gl1cosθ1=M1l12θ¨1+μ2l1l2(θ¨2cosΔ21θ˙22sinΔ21)+μ3l1l3(θ¨3cosΔ31θ˙32sinΔ31)+μ1gl1cosθ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}

θ2\theta_2

pθ2=Lθ˙2=M2l22θ˙2+μ2l1l2θ˙1cosΔ21+μ3l2l3θ˙3cosΔ32p˙θ2=M2l22θ¨2+μ2l1l2(θ¨1cosΔ21θ˙1(θ˙2θ˙1)sinΔ21)+μ3l2l3(θ¨3cosΔ32θ˙3(θ˙3θ˙2)sinΔ32)Fθ2=μ2l2(l1θ˙1θ˙2Δ21θ2sinΔ21+gcosθ2)μ3l2l3θ˙2θ˙3Δ32θ2sinΔ32=μ2l2(l1θ˙1θ˙2sinΔ21+gcosθ2)+μ3l2l3θ˙2θ˙3sinΔ32δθ2L=M2l22θ¨2+μ2l1l2(θ¨1cosΔ21θ˙1(θ˙2θ˙1)sinΔ21)+μ3l2l3(θ¨3cosΔ32θ˙3(θ˙3θ˙2)sinΔ32)+μ2l2(l1θ˙1θ˙2sinΔ21+gcosθ2)μ3l2l3θ˙2θ˙3sinΔ32=M2l22θ¨2+μ2l1l2(θ¨1cosΔ21+θ˙12sinΔ21)+μ3l2l3(θ¨3cosΔ32θ˙32sinΔ32)+μ2l2gcosθ2=M2l22θ¨2+μ2l2(l1(θ¨1cosΔ21+θ˙12sinΔ21)+gcosθ2)+μ3l2l3(θ¨3cosΔ32θ˙32sinΔ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}

θ3\theta_3

pθ3=Lθ˙3=M3l32θ˙3+μ3l3(l2θ˙2cosΔ32+l1θ˙1cosΔ31)p˙θ3=M3l32θ¨3+μ3l3(l2(θ¨2cosΔ32θ˙2(θ˙3θ˙2)sinΔ32)+l1(θ¨1cosΔ31θ˙1(θ˙3θ˙1)sinΔ31))Fθ3=Lθ3=μ3l3[θ˙3(l2θ˙2Δ32θ3sinΔ32+l1θ˙1Δ31θ3sinΔ31)+gcosθ3]=μ3l3[θ˙3(l2θ˙2sinΔ32+l1θ˙1sinΔ31)+gcosθ3]δθ3L=M3l32θ¨3+μ3l3(l2(θ¨2cosΔ32θ˙2(θ˙3θ˙2)sinΔ32)+l1(θ¨1cosΔ31θ˙1(θ˙3θ˙1)sinΔ31))+μ3l3[θ˙3(l2θ˙2sinΔ32+l1θ˙1sinΔ31)+gcosθ3]=M3l32θ¨3+μ3l3[l2(θ¨2cosΔ32+θ˙22sinΔ32)+l1(θ¨1cosΔ31+θ˙12sinΔ31)+gcosθ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}

Final system

Hence given our equations of motion are δθiL=Qθi\delta'_{\theta_i}\mathcal{L} = Q_{\theta_i}, we could write them in matrix form as (given how long QθiQ_{\theta_i} is, we will not expand on it)

[M1l12μ2l1l2cosΔ21μ3l1l3cosΔ31μ2l1l2cosΔ21M2l22μ3l2l3cosΔ32μ3l1l3cosΔ31μ3l2l3cosΔ32M3l32][θ¨1θ¨2θ¨3]=[Qθ1μ1gl1cosθ1+μ2l1l2θ˙22sinΔ21+μ3l1l3θ˙32sinΔ31Qθ2μ2l2(l1θ˙12sinΔ21+gcosθ2)+μ3l2l3θ˙32sinΔ32Qθ3μ3l3(l1θ˙12sinΔ31+l2θ˙22sinΔ32+gcosθ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}