D , j ⋅ ∂ q i ∂ r j . Where
j j j refers to the component of the system we are analysing.
( q i ) (q_i) ( q i ) are the generalized coordinates of the system.
( q ˙ i ) (\dot{q}_i) ( q ˙ i ) are the first time derivatives of the generalized coordinates of the system.
r ⃗ j \vec{r}_j r j is the position vector of component j j j of the system.
L \mathcal{L} L is the Lagrangian — the difference between the kinetic and potential energy — of the system.
p i = ∂ L ∂ q ˙ i p_i = \dfrac{\partial \mathcal{L}}{\partial \dot{q}_i} p i = ∂ q ˙ i ∂ L is the generalized momentum canonical to q i q_i q i .
F i = ∂ L ∂ q i F_i = \dfrac{\partial \mathcal{L}}{\partial q_i} F i = ∂ q i ∂ L is the generalized force canonical to q i q_i q i .
F ⃗ D , j \vec{F}_{D,j} F D , j is the dissipative force vector for component j j j .
e ^ j , i = ∂ r ⃗ j ∂ q i \hat{e}_{j,i} = \dfrac{\partial \vec{r}_j}{\partial q_i} e ^ j , i = ∂ q i ∂ r j is the generalized basis vector canonical to q i q_i q i for component j j j of the system.
The left-hand side of Equation Equation (1 ) can also be represented as − δ L δ q i -\dfrac{\delta \mathcal{L}}{\delta q_i} − δ q i δ L , where δ L δ q i \dfrac{\delta \mathcal{L}}{\delta q_i} δ q i δ L is the functional derivative of the Lagrangian with respect to q i q_i q i . To simplify things, we will call − δ L δ q i = δ ′ L δ ′ q i -\dfrac{\delta \mathcal{L}}{\delta q_i} = \dfrac{\delta' \mathcal{L}}{\delta' q_i} − δ q i δ L = δ ′ q i δ ′ L
The right-hand side of Equation Equation (1 ) is also called the generalized dissipative force and can be represented as Q i Q_i Q i .
The masses of the pendulum rods (or springs) and the friction they experience are ignored as including them into the calculation for rigid double pendulums does not make things more interesting and merely complicates the calculation. I did try deriving the equations of motion while including the rods using SymPy, specifically with the code
from sympy import symbols, Function, diff, cos, sin, simplify, sqrt, Abs, Eq, solve, latex
from sympy.vector import CoordSys3D
from multiprocessing import Pool, cpu_count
N = CoordSys3D('N' );
t = symbols('t' )
m1b = symbols('m1b' );
m2b = symbols('m2b' );
m1r = symbols('m1r' );
m2r = symbols('m2r' );
l1 = symbols('11' );
l2 = symbols('l2' );
k1 = symbols('k1' );
k2 = symbols('k2' );
g = symbols('g' );
b1r = symbols('b1r' );
b2r = symbols('b2r' );
b1b = symbols('b1b' );
b2b = symbols('b2b' );
c1r = symbols("c1r" );
c1b = symbols("c1b" );
c2r = symbols("c2r" );
c2b = symbols("c2b" );
r1 = Function('r1' )(t);
theta1=Function('theta1' )(t);
r2 = Function('r2' )(t);
theta2=Function('theta2' )(t);
x1b = r1*cos(theta1);
y1b = r1*sin(theta1);
x1bdot = diff(x1b, t);
y1bdot = diff(y1b, t);
v1b_mag = simplify(sqrt(x1bdot**2 + y1bdot**2 ));
v1b_sq = simplify(x1bdot**2 + y1bdot**2 );
r1b = x1b * N.i + y1b * N.j;
v1b = x1bdot * N.i + y1bdot * N.j;
e1b_r1 = diff(r1b, r1);
e1b_r2 = diff(r1b, r2);
e1b_th1 = diff(r1b, theta1);
e1b_th2 = diff(r1b, theta2);
x2b = x1b+r2*cos(theta2);
y2b = y1b + r2*sin(theta2);
x2bdot = diff(x2b, t);
y2bdot = diff(y2b, t);
v2b_mag = simplify(sqrt(x2bdot**2 + y2bdot**2 ));
v2b_sq = simplify(x2bdot**2 + y2bdot**2 );
r2b = x2b * N.i + y2b * N.j;
v2b = x2bdot * N.i + y2bdot * N.j;
e2b_r1 = diff(r2b, r1);
e2b_r2 = diff(r2b, r2);
e2b_th1 = diff(r2b, theta1);
e2b_th2 = diff(r2b, theta2);
x1r = x1b/2 ;
x1rdot = diff(x1r, t);
y1r = y1b/2 ;
y1rdot = diff(y1r, t);
v1r_mag = simplify(sqrt(x1rdot**2 + y1rdot**2 ));
v1r_sq = simplify(x1rdot**2 + y1rdot**2 );
v1r = x1rdot * N.i + y1rdot * N.j;
r1r = x1r * N.i + y1r * N.j;
v1r = x1rdot * N.i + y1rdot * N.j;
e1r_r1 = diff(r1r, r1);
e1r_r2 = diff(r1r, r2);
e1r_th1 = diff(r1r, theta1);
e1r_th2 = diff(r1r, theta2);
x2r = x1b +r2*cos(theta2)/2 ;
x2rdot = diff(x2r, t);
y2r = y1b + r2*sin(theta2)/2 ;
y2rdot = diff(y2r, t);
v2r_mag = simplify(sqrt(x2rdot**2 + y2rdot**2 ));
v2r_sq = simplify(x2rdot**2 + y2rdot**2 );
v2r = x2rdot * N.i + y2rdot * N.j;
r2r = x2r * N.i + y2r * N.j;
v2r = x2rdot * N.i + y2rdot * N.j;
e2r_r1 = diff(r2r, r1);
e2r_r2 = diff(r2r, r2);
e2r_th1 = diff(r2r, theta1);
e2r_th2 = diff(r2r, theta2);
Frod1 = -(b1r+c1r*Abs(v1r_mag))*v1r;
Frod2 = -(b2r+c2r*Abs(v2r_mag))*v2r;
Fbob1 = -(b1b+c1b*Abs(v1b_mag))*v1b;
Fbob2 = -(b2b+c2b*Abs(v2b_mag))*v2b;
Qr1 = Frod1.dot(e1r_r1) + Frod2.dot(e2r_r1) + Fbob1.dot(e1b_r1) + Fbob2.dot(e2b_r1);
Qr1 = simplify(Qr1);
Qr2 = Frod1.dot(e1r_r2) + Frod2.dot(e2r_r2) + Fbob1.dot(e1b_r2) + Fbob2.dot(e2b_r2);
Qr2 = simplify(Qr2);
Qth1 = Frod1.dot(e1r_th1) + Frod2.dot(e2r_th1) + Fbob1.dot(e1b_th1) + Fbob2.dot(e2b_th1);
Qth1 = simplify(Qth1);
Qth2 = Frod1.dot(e1r_th2) + Frod2.dot(e2r_th2) + Fbob1.dot(e1b_th2) + Fbob2.dot(e2b_th2);
Qth2 = simplify(Qth2);
T = m1b/2 * v1b_sq + m2b/2 * v2b_sq + m1r/2 * v1r_sq + m2r/2 * v2r_sq + m1r/24 *r1**2 *diff(theta1, t)**2 + m2r/24 * r2**2 *diff(theta2,t)**2
V = m1b * g * y1b + m1r * g * r1 * y1r + m2b * g * y2b + m2r * g * y2r + k1*(r1-l1)**2 /2 + k2*(r2-l2)**2 /2 ;
L = T - V;
def compute_eq_of_motion (args ):
L, Q, coord = args
t = symbols('t' )
lhs = diff(diff(L, diff(coord, t)), t) - diff(L, coord)
return Eq(lhs, Q)
Qs = [symbols("Qr1" ), symbols("Qr2" ), symbols("Qtheta1" ), symbols("Qtheta2" )]
coords = [r1, r2, theta1, theta2]
d2r1 = diff(r1, t, 2 );
d2r2 = diff(r2, t, 2 );
d2th1 = diff(theta1, t, 2 );
d2th2 = diff(theta2, t, 2 );
with Pool(cpu_count()) as pool:
equations = pool.map (compute_eq_of_motion, [(L, Qs[i], coords[i]) for i in range (4 )])
d2 = [d2r1, d2r2, d2th1, d2th2];
sols = solve(equations, d2, simplify=True )
secdernames = ["d2r1" , "d2r2" , "d2theta1" , "d2theta2" ]
for i in range (4 ):
print (secdernames[i] + " = \n" + latex(sols[d2[i]]))
And it caused IPython to crash.
As can be seen, we have four degrees of freedom in this system. The angles the two pendulums make with the positive x x x -axis — θ 1 \theta_1 θ 1 and θ 2 \theta_2 θ 2 , respectively — are among our degrees of freedom. We will also need degrees of freedom corresponding to the lengths of the pendulum rods. These degrees of freedom could either be the extent to which they are extended beyond their rest length or their total length. For the sake of simplicity, we will opt to use their total lengths — r 1 r_1 r 1 and r 2 r_2 r 2 , respectively. Hence
x 1 = r 1 cos θ 1 x ˙ 1 = r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 y 1 = r 1 sin θ 1 y ˙ 1 = r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 x 2 = x 1 + r 2 cos θ 2 x ˙ 2 = x ˙ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 y 2 = y 1 + r 2 sin θ 2 y ˙ 2 = y ˙ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 . \begin{aligned} x_1 &= r_1 \cos{\theta_1} & \dot{x}_1 &= \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1}\\ y_1 &= r_1 \sin{\theta_1} & \dot{y}_1 &= \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} \\ x_2 &= x_1 + r_2\cos{\theta_2} & \dot{x}_2 &= \dot{x}_1 + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ y_2 &= y_1 + r_2\sin{\theta_2} & \dot{y}_2 &= \dot{y}_1 + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2}. \end{aligned} x 1 y 1 x 2 y 2 = r 1 cos θ 1 = r 1 sin θ 1 = x 1 + r 2 cos θ 2 = y 1 + r 2 sin θ 2 x ˙ 1 y ˙ 1 x ˙ 2 y ˙ 2 = r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 = r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 = x ˙ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 = y ˙ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 . This means that the velocity of the first pendulum bob is
v ⃗ 1 = [ x ˙ 1 y ˙ 1 ] = [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 ] . \begin{aligned} \vec{v}_1 &= \begin{bmatrix} \dot{x}_1 \\ \dot{y}_1 \end{bmatrix} \\ &= \begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} \end{bmatrix}. \end{aligned} v 1 = [ x ˙ 1 y ˙ 1 ] = [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 ] . Hence
∣ v ⃗ 1 ∣ 2 = r ˙ 1 2 + r 1 2 θ ˙ 1 2 . \begin{aligned} |\vec{v}_1|^2 &= \dot{r}_1^2 + r_1^2 \dot{\theta}_1^2. \end{aligned} ∣ v 1 ∣ 2 = r ˙ 1 2 + r 1 2 θ ˙ 1 2 . As for the velocity of the second pendulum bob, it is
v ⃗ 2 = [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 ] . \begin{aligned} \vec{v}_2 &= \begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2} \end{bmatrix}. \end{aligned} v 2 = [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 ] . Let Δ = θ 2 − θ 1 \Delta = \theta_2-\theta_1 Δ = θ 2 − θ 1 , then square of the velocity is
∣ v ⃗ 2 ∣ 2 = r ˙ 1 2 cos 2 θ 1 + r 1 2 θ ˙ 1 2 sin 2 θ 1 + r ˙ 2 2 cos 2 θ 2 + r 2 2 θ ˙ 2 2 sin 2 θ 2 − 2 r 1 r ˙ 1 θ ˙ 1 cos θ 1 sin θ 1 + 2 r ˙ 1 r ˙ 2 cos θ 1 cos θ 2 − 2 r ˙ 1 r 2 θ ˙ 2 cos θ 1 sin θ 2 − 2 r 1 r ˙ 2 θ ˙ 1 sin θ 1 cos θ 2 + 2 r 1 r 2 θ ˙ 1 θ ˙ 2 sin θ 1 sin θ 2 − 2 r ˙ 2 r 2 θ ˙ 2 cos θ 2 sin θ 2 + r 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 2 r ˙ 1 r ˙ 2 cos Δ − 2 r ˙ 1 r 2 θ 2 ˙ sin Δ + 2 r 1 r ˙ 2 θ ˙ 1 sin Δ + 2 r 1 r 2 θ ˙ 1 θ ˙ 2 cos Δ = r ˙ 1 2 + r 1 2 θ ˙ 1 2 + r ˙ 2 2 + r 2 2 θ ˙ 2 2 + 2 cos Δ ( r ˙ 1 r ˙ 2 + r 1 r 2 θ ˙ 1 θ ˙ 2 ) + 2 sin Δ ( r 1 r ˙ 2 θ ˙ 1 − r ˙ 1 r 2 θ ˙ 2 ) . \begin{aligned} |\vec{v}_2|^2 &= \dot{r}_1^2 \cos^2{\theta_1} + r_1^2 \dot{\theta}_1^2\sin^2{\theta_1} + \dot{r}_2^2\cos^2{\theta_2} + r_2^2\dot{\theta}_2^2\sin^2{\theta_2} -2r_1\dot{r}_1\dot{\theta}_1 \cos{\theta}_1\sin{\theta_1} + 2\dot{r}_1\dot{r}_2\cos{\theta_1}\cos{\theta_2} - 2\dot{r}_1r_2\dot{\theta}_2\cos{\theta_1}\sin{\theta_2} - 2r_1\dot{r}_2 \dot{\theta}_1 \sin{\theta_1}\cos{\theta_2} + 2r_1r_2 \dot{\theta}_1\dot{\theta}_2\sin{\theta_1}\sin{\theta_2}\\ &-2\dot{r}_2r_2\dot{\theta}_2\cos{\theta_2}\sin{\theta_2} + \dot{r}_1^2\sin^2{\theta_1} + r_1^2\dot{\theta}_1^2\cos^2{\theta_1} + \dot{r}_2^2\sin^2{\theta_2} + r_2^2\dot{\theta}_2^2\cos^2{\theta_2} + 2r_1\dot{r}_1\dot{\theta}_1\sin{\theta_1}\cos{\theta_1} + 2\dot{r}_1\dot{r}_2\sin{\theta_1}\sin{\theta_2} + 2\dot{r}_1r_2\dot{\theta}_2\sin{\theta_1}\cos{\theta_2} + 2r_1\dot{r}_2\dot{\theta}_1 \cos{\theta_1}\sin{\theta_2}\\ &+2r_1r_2\dot{\theta}_1\dot{\theta}_2\cos{\theta_1}\cos{\theta_2} + 2r_2\dot{r}_2\dot{\theta}_2\sin{\theta_2}\cos{\theta_2} \\ &= \dot{r}_1^2 + r_1^2 \dot{\theta}_1^2 + \dot{r}_2^2 + r_2^2\dot{\theta}_2^2 + 2r_1\dot{r}_1\dot{\theta}_1(-\cos{\theta_1}\sin{\theta_1} + \cos{\theta_1}\sin{\theta_1}) + 2\dot{r}_1\dot{r}_2(\cos{\theta_1}\cos{\theta_2}+\sin{\theta_1}\sin{\theta_2})+2\dot{r}_1r_2\dot{\theta}_2(-\cos{\theta_1}\sin{\theta_2} + \sin{\theta_1}\cos{\theta_2}) \\ &+ 2r_1\dot{r}_2\dot{\theta}_1(-\sin{\theta_1}\cos{\theta_2}+\cos{\theta_1}\sin{\theta_2}) + 2r_1r_2\dot{\theta}_1\dot{\theta}_2(\sin{\theta_1}\sin{\theta_2} + \cos{\theta_1}\cos{\theta_2}) + 2r_2\dot{r}_2\dot{\theta}_2 (-\cos{\theta_2}\sin{\theta_2} + \sin{\theta_2}\cos{\theta_2}) \\ &= \dot{r}_1^2 + r_1^2 \dot{\theta}_1^2 + \dot{r}_2^2 + r_2^2\dot{\theta}_2^2 + 2\dot{r}_1\dot{r}_2 \cos{(\theta_2-\theta_1)} - 2\dot{r}_1r_2\dot{\theta_2}\sin{(\theta_2-\theta_1)} + 2r_1\dot{r}_2 \dot{\theta}_1 \sin{(\theta_2-\theta_1)} + 2r_1r_2\dot{\theta}_1\dot{\theta}_2\cos{(\theta_2-\theta_1)} \\ &= \dot{r}_1^2 + r_1^2 \dot{\theta}_1^2 + \dot{r}_2^2 + r_2^2\dot{\theta}_2^2 + 2\dot{r}_1\dot{r}_2 \cos{\Delta} - 2\dot{r}_1r_2\dot{\theta_2}\sin{\Delta} + 2r_1\dot{r}_2 \dot{\theta}_1 \sin{\Delta} + 2r_1r_2\dot{\theta}_1\dot{\theta}_2\cos{\Delta} \\ &= \dot{r}_1^2 + r_1^2 \dot{\theta}_1^2 + \dot{r}_2^2 + r_2^2\dot{\theta}_2^2 + 2\cos{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) + 2\sin{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2). \end{aligned} ∣ v 2 ∣ 2 = r ˙ 1 2 cos 2 θ 1 + r 1 2 θ ˙ 1 2 sin 2 θ 1 + r ˙ 2 2 cos 2 θ 2 + r 2 2 θ ˙ 2 2 sin 2 θ 2 − 2 r 1 r ˙ 1 θ ˙ 1 cos θ 1 sin θ 1 + 2 r ˙ 1 r ˙ 2 cos θ 1 cos θ 2 − 2 r ˙ 1 r 2 θ ˙ 2 cos θ 1 sin θ 2 − 2 r 1 r ˙ 2 θ ˙ 1 sin θ 1 cos θ 2 + 2 r 1 r 2 θ ˙ 1 θ ˙ 2 sin θ 1 sin θ 2 − 2 r ˙ 2 r 2 θ ˙ 2 cos θ 2 sin θ 2 + r ˙ 1 2 sin 2 θ 1 + r 1 2 θ ˙ 1 2 cos 2 θ 1 + r ˙ 2 2 sin 2 θ 2 + r 2 2 θ ˙ 2 2 cos 2 θ 2 + 2 r 1 r ˙ 1 θ ˙ 1 sin θ 1 cos θ 1 + 2 r ˙ 1 r ˙ 2 sin θ 1 sin θ 2 + 2 r ˙ 1 r 2 θ ˙ 2 sin θ 1 cos θ 2 + 2 r 1 r ˙ 2 θ ˙ 1 cos θ 1 sin θ 2 + 2 r 1 r 2 θ ˙ 1 θ ˙ 2 cos θ 1 cos θ 2 + 2 r 2 r ˙ 2 θ ˙ 2 sin θ 2 cos θ 2 = r ˙ 1 2 + r 1 2 θ ˙ 1 2 + r ˙ 2 2 + r 2 2 θ ˙ 2 2 + 2 r 1 r ˙ 1 θ ˙ 1 ( − cos θ 1 sin θ 1 + cos θ 1 sin θ 1 ) + 2 r ˙ 1 r ˙ 2 ( cos θ 1 cos θ 2 + sin θ 1 sin θ 2 ) + 2 r ˙ 1 r 2 θ ˙ 2 ( − cos θ 1 sin θ 2 + sin θ 1 cos θ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 + r 1 r 2 θ ˙ 1 θ ˙ 2 ) + 2 sin Δ ( r 1 r ˙ 2 θ ˙ 1 − r ˙ 1 r 2 θ ˙ 2 ) . \begin{aligned} |\Delta \vec{v}_{21}|^2 &= \dot{r}_2^2 + r_2^2\dot{\theta}_2^2 + 2\cos{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) + 2\sin{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2). \end{aligned} ∣ Δ v 2 1 ∣ 2 = r ˙ 2 2 + r 2 2 θ ˙ 2 2 + 2 cos Δ ( r ˙ 1 r ˙ 2 + r 1 r 2 θ ˙ 1 θ ˙ 2 ) + 2 sin Δ ( r 1 r ˙ 2 θ ˙ 1 − r ˙ 1 r 2 θ ˙ 2 ) . We will assume that the dissipative forces are proportion to the velocity and velocity squared of the pendulum bobs. Meaning they will have the form
F ⃗ D , j = − ( b j + c j ∣ v ⃗ j ∣ ) v ⃗ j . \begin{aligned} \vec{F}_{D,j} &= -(b_j+c_j|\vec{v}_j|)\vec{v}_j. \end{aligned} F D , j = − ( b j + c j ∣ v j ∣ ) v j . Where j j j is the pendulum bob of interest, b j b_j b j and c j c_j c j are constants.
The kinetic energy of the system is given by
T = m 1 2 ∣ v ⃗ 1 ∣ 2 + m 2 2 ∣ v ⃗ 2 ∣ 2 = m 1 + m 2 2 ∣ v ⃗ 1 ∣ 2 + m 2 2 ∣ Δ v ⃗ 21 ∣ 2 . \begin{aligned} T &= \dfrac{m_1}{2}|\vec{v}_1|^2 + \dfrac{m_2}{2}|\vec{v}_2|^2 \\ &= \dfrac{m_1+m_2}{2}|\vec{v}_1|^2 + \dfrac{m_2}{2}|\Delta \vec{v}_{21}|^2. \end{aligned} T = 2 m 1 ∣ v 1 ∣ 2 + 2 m 2 ∣ v 2 ∣ 2 = 2 m 1 + m 2 ∣ v 1 ∣ 2 + 2 m 2 ∣ Δ v 2 1 ∣ 2 . The potential energy of the system is given by
V = m 1 g y 1 + m 2 g y 2 + k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 2 = m 1 g r 1 sin θ 1 + m 2 g ( r 1 sin θ 1 + r 2 sin θ 2 ) + k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 2 = ( m 1 + m 2 ) g r 1 sin θ 1 + m 2 g r 2 sin θ 2 + k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 2 . \begin{aligned} V &= m_1 gy_1 + m_2gy_2 + \dfrac{k_1(r_1-l_1)^2+k_2(r_2-l_2)^2}{2}\\ &= m_1 gr_1\sin{\theta_1} + m_2g(r_1\sin{\theta_1} + r_2\sin{\theta_2}) + \dfrac{k_1(r_1-l_1)^2+k_2(r_2-l_2)^2}{2}\\ &= (m_1+m_2)gr_1\sin{\theta_1} + m_2gr_2\sin{\theta_2} + \dfrac{k_1(r_1-l_1)^2+k_2(r_2-l_2)^2}{2}. \end{aligned} V = m 1 g y 1 + m 2 g y 2 + 2 k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 = m 1 g r 1 sin θ 1 + m 2 g ( r 1 sin θ 1 + r 2 sin θ 2 ) + 2 k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 = ( m 1 + m 2 ) g r 1 sin θ 1 + m 2 g r 2 sin θ 2 + 2 k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 . Hence the Lagrangian of the system is
L = T − V = m 1 + m 2 2 ∣ v ⃗ 1 ∣ 2 + m 2 2 ∣ Δ v ⃗ 21 ∣ 2 − [ ( m 1 + m 2 ) g r 1 sin θ 1 + m 2 g r 2 sin θ 2 ] − k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 2 = ( m 1 + m 2 ) [ ∣ v ⃗ 1 ∣ 2 2 − g r 1 sin θ 1 ] + m 2 [ ∣ Δ v ⃗ 21 ∣ 2 2 − g r 2 sin θ 2 ] − k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 2 . \begin{aligned} \mathcal{L} &= T - V \\ &= \dfrac{m_1+m_2}{2}|\vec{v}_1|^2 + \dfrac{m_2}{2}|\Delta \vec{v}_{21}|^2 - \left[(m_1+m_2)gr_1\sin{\theta_1} + m_2gr_2\sin{\theta_2}\right] - \dfrac{k_1(r_1-l_1)^2+k_2(r_2-l_2)^2}{2} \\ &= (m_1+m_2)\left[\dfrac{|\vec{v}_1|^2}{2} - gr_1\sin{\theta_1}\right] + m_2\left[\dfrac{|\Delta \vec{v}_{21}|^2}{2} - gr_2\sin{\theta_2}\right] - \dfrac{k_1(r_1-l_1)^2+k_2(r_2-l_2)^2}{2}. \end{aligned} L = T − V = 2 m 1 + m 2 ∣ v 1 ∣ 2 + 2 m 2 ∣ Δ v 2 1 ∣ 2 − [ ( m 1 + m 2 ) g r 1 sin θ 1 + m 2 g r 2 sin θ 2 ] − 2 k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 = ( m 1 + m 2 ) [ 2 ∣ v 1 ∣ 2 − g r 1 sin θ 1 ] + m 2 [ 2 ∣ Δ v 2 1 ∣ 2 − g r 2 sin θ 2 ] − 2 k 1 ( r 1 − l 1 ) 2 + k 2 ( r 2 − l 2 ) 2 . We will not expand this Lagrangian, as doing so just adds to its complexity. Instead, we will calculate the derivatives of each of its components.
The relevant partial and standard derivatives are:
∂ ∣ v ⃗ 1 ∣ 2 ∂ r 1 = 2 r 1 θ ˙ 1 2 ∂ ∣ v ⃗ 1 ∣ 2 ∂ r 2 = 0 ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ 1 = 0 ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ 2 = 0 ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 1 = 2 r ˙ 1 ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 2 = 0 ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 1 = 2 r 1 2 θ ˙ 1 ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 2 = 0 d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 1 = 2 r ¨ 1 d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 2 = 0 d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 1 = 2 r 1 2 θ ¨ 1 + 4 r 1 r ˙ 1 θ ˙ 1 d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 2 = 0 \begin{aligned} \dfrac{\partial |\vec{v}_1|^2}{\partial r_1} &= 2r_1\dot{\theta}_1^2 & \dfrac{\partial |\vec{v}_1|^2}{\partial r_2} &= 0 & \dfrac{\partial |\vec{v}_1|^2}{\partial \theta_1} &= 0 & \dfrac{\partial |\vec{v}_1|^2}{\partial \theta_2} &= 0\\ \dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_1} &= 2\dot{r}_1 & \dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_2} &= 0 & \dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_1} &= 2r_1^2\dot{\theta}_1 & \dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_2} &= 0\\ \dfrac{d}{dt} \dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_1} &= 2\ddot{r}_1 & \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_2} &= 0 & \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_1} &= 2r_1^2 \ddot{\theta}_1 + 4r_1\dot{r}_1\dot{\theta}_1 & \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_2} &= 0 \end{aligned} ∂ r 1 ∂ ∣ v 1 ∣ 2 ∂ r ˙ 1 ∂ ∣ v 1 ∣ 2 d t d ∂ r ˙ 1 ∂ ∣ v 1 ∣ 2 = 2 r 1 θ ˙ 1 2 = 2 r ˙ 1 = 2 r ¨ 1 ∂ r 2 ∂ ∣ v 1 ∣ 2 ∂ r ˙ 2 ∂ ∣ v 1 ∣ 2 d t d ∂ r ˙ 2 ∂ ∣ v 1 ∣ 2 = 0 = 0 = 0 ∂ θ 1 ∂ ∣ v 1 ∣ 2 ∂ θ ˙ 1 ∂ ∣ v 1 ∣ 2 d t d ∂ θ ˙ 1 ∂ ∣ v 1 ∣ 2 = 0 = 2 r 1 2 θ ˙ 1 = 2 r 1 2 θ ¨ 1 + 4 r 1 r ˙ 1 θ ˙ 1 ∂ θ 2 ∂ ∣ v 1 ∣ 2 ∂ θ ˙ 2 ∂ ∣ v 1 ∣ 2 d t d ∂ θ ˙ 2 ∂ ∣ v 1 ∣ 2 = 0 = 0 = 0 Hence the negative functional derivatives are
δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ r 1 = d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 1 − ∂ ∣ v ⃗ 1 ∣ 2 ∂ r 1 δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ r 2 = d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ r ˙ 2 − ∂ ∣ v ⃗ 1 ∣ 2 ∂ r 2 δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ θ 1 = d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 1 − ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ 1 δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ θ 2 = d d t ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ ˙ 2 − ∂ ∣ v ⃗ 1 ∣ 2 ∂ θ 2 = 2 r ¨ 1 − 2 r 1 θ ˙ 1 2 = 0 = 2 r 1 2 θ ¨ 1 + 4 r 1 r ˙ 1 θ ˙ 1 = 0. \begin{aligned} \dfrac{\delta' |\vec{v}_1|^2}{\delta' r_1} &= \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_1} - \dfrac{\partial |\vec{v}_1|^2}{\partial r_1} & \dfrac{\delta' |\vec{v}_1|^2}{\delta' r_2} &= \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{r}_2} - \dfrac{\partial |\vec{v}_1|^2}{\partial r_2} & \dfrac{\delta' |\vec{v}_1|^2}{\delta' \theta_1} &= \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_1} - \dfrac{\partial |\vec{v}_1|^2}{\partial \theta_1} & \dfrac{\delta' |\vec{v}_1|^2}{\delta' \theta_2} &= \dfrac{d}{dt}\dfrac{\partial |\vec{v}_1|^2}{\partial \dot{\theta}_2} - \dfrac{\partial |\vec{v}_1|^2}{\partial \theta_2}\\ &= 2\ddot{r}_1 - 2r_1\dot{\theta}_1^2 & &= 0 & &=2r_1^2\ddot{\theta}_1 + 4r_1\dot{r}_1\dot{\theta}_1 & &= 0. \end{aligned} δ ′ r 1 δ ′ ∣ v 1 ∣ 2 = d t d ∂ r ˙ 1 ∂ ∣ v 1 ∣ 2 − ∂ r 1 ∂ ∣ v 1 ∣ 2 = 2 r ¨ 1 − 2 r 1 θ ˙ 1 2 δ ′ r 2 δ ′ ∣ v 1 ∣ 2 = d t d ∂ r ˙ 2 ∂ ∣ v 1 ∣ 2 − ∂ r 2 ∂ ∣ v 1 ∣ 2 = 0 δ ′ θ 1 δ ′ ∣ v 1 ∣ 2 = d t d ∂ θ ˙ 1 ∂ ∣ v 1 ∣ 2 − ∂ θ 1 ∂ ∣ v 1 ∣ 2 = 2 r 1 2 θ ¨ 1 + 4 r 1 r ˙ 1 θ ˙ 1 δ ′ θ 2 δ ′ ∣ v 1 ∣ 2 = d t d ∂ θ ˙ 2 ∂ ∣ v 1 ∣ 2 − ∂ θ 2 ∂ ∣ v 1 ∣ 2 = 0 . Hence the partial and standard derivatives of the difference in the square of each bob's velocity is
∂ ∣ Δ v ⃗ 21 ∣ 2 ∂ r 1 = 2 r 2 θ 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ta} + 2\dot{r}_2\dot{\theta}_1\sin{\Delta} & \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial r_2} &= 2r_2\dot{\theta}_2^2+2r_1\dot{\theta}_1\dot{\theta}_2\cos{\Delta}-2\dot{r}_1\dot{\theta}_2\sin{\Delta} \\ \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \theta_1} &= -2\sin{\Delta}\cdot -1(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) + 2\cos{\Delta}\cdot -1(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2) & \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \theta_2} &= -2\sin{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) + 2\cos{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2) \\ &= 2\sin{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) - 2\cos{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2)\\ \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_1} &= 2\dot{r}_2\cos{\Delta} - 2r_2\dot{\theta}_2\sin{\Delta} & \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_2} &= 2\dot{r}_2 + 2\dot{r}_1\cos{\Delta} + 2r_1\dot{\theta}_1\sin{\Delta} \\ \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{\theta}_1} &= 2r_1r_2\dot{\theta}_2\cos{\Delta} + 2r_1\dot{r}_2\sin{\Delta} & \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{\theta}_2} &=2r_2^2\dot{\theta}_2 + 2r_1r_2\dot{\theta}_1\cos{\Delta} - 2\dot{r}_1r_2\sin{\Delta} \end{aligned} ∂ r 1 ∂ ∣ Δ v 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2 θ ˙ 1 Δ ˙ + r ¨ 1 r 2 + r ˙ 1 r ˙ 2 ) = 4 r 2 r ˙ 2 θ ˙ 2 + 2 r 2 2 θ ¨ 2 + 2 cos Δ ( r ˙ 1 r 2 Δ ˙ 1 + r 1 r ˙ 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) − 2 sin Δ ( r 1 r 2 θ ˙ 1 Δ ˙ + r ¨ 1 r 2 + r ˙ 1 r ˙ 2 ) . \begin{aligned} \dfrac{d}{dt} \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_1} &= 2\ddot{r}_2\cos{\Delta} - 2\dot{r}_2\dot{\Delta}\sin{\Delta} - 2\dot{r}_2\dot{\theta}_2\sin{\Delta} - 2r_2\ddot{\theta}_2\sin{\Delta} - 2r_2\dot{\theta}_2\dot{\Delta}\cos{\Delta} \\ &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2\dot{\Delta}) - 2\sin{\Delta}(\dot{r}_2\dot{\Delta} + \dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2)\\ &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2\dot{\Delta}) - 2\sin{\Delta}(\dot{r}_2(2\dot{\theta}_2-\dot{\theta}_1)+r_2\ddot{\theta}_2)\\ &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2\dot{\Delta}) - 2\sin{\Delta}(\dot{r}_2\dot{\Delta}_2+r_2\ddot{\theta}_2)\\ \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_2} &= 2\ddot{r}_2 + 2\ddot{r}_1 \cos{\Delta} -2\dot{r}_1\dot{\Delta}\sin{\Delta} + 2\dot{r}_1\dot{\theta}_1\sin{\Delta} + 2r_1\ddot{\theta}_1\sin{\Delta} + 2r_1\dot{\theta}_1\dot{\Delta}\cos{\Delta} \\ &= 2\ddot{r}_2 + 2\cos{\Delta}(\ddot{r}_1 + r_1\dot{\theta}_1 \dot{\Delta}) + 2\sin{\Delta}(r_1\ddot{\theta}_1 + \dot{r}_1\dot{\theta}_1 - \dot{r}_1\dot{\Delta})\\ &= 2\ddot{r}_2 + 2\cos{\Delta}(\ddot{r}_1 + r_1\dot{\theta}_1 \dot{\Delta}) + 2\sin{\Delta}(r_1\ddot{\theta}_1 + \dot{r}_1(2\dot{\theta}_1 - \ddot{\theta}_2))\\ &= 2\ddot{r}_2 + 2\cos{\Delta}(\ddot{r}_1 + r_1\dot{\theta}_1 \dot{\Delta}) + 2\sin{\Delta}(r_1\ddot{\theta}_1 + \dot{r}_1\dot{\Delta}_1)\\ \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{\theta}_1} &= 2\dot{r}_1r_2\dot{\theta}_2\cos{\Delta} + 2r_1\dot{r}_2\dot{\theta}_2\cos{\Delta} + 2r_1r_2\ddot{\theta}_2\cos{\Delta} - 2r_1r_2\dot{\theta}_2\dot{\Delta}\sin{\Delta} + 2\dot{r}_1\dot{r}_2\sin{\Delta} + 2r_1\ddot{r}_2\sin{\Delta} + 2r_1\dot{r}_2\dot{\Delta}\cos{\Delta} \\ &= 2\cos{\Delta}(\dot{r}_1r_2\dot{\theta}_2 + r_1\dot{r}_2 (\dot{\theta}_2+\dot{\Delta})+r_1r_2\ddot{\theta}_2) +2\sin{\Delta}(\dot{r}_1\dot{r}_2+r_1\ddot{r}_2-r_1r_2\dot{\theta}_2\dot{\Delta})\\ &= 2\cos{\Delta}(\dot{r}_1r_2\dot{\theta}_2 + r_1\dot{r}_2 \dot{\Delta}_2+r_1r_2\ddot{\theta}_2) +2\sin{\Delta}(\dot{r}_1\dot{r}_2+r_1\ddot{r}_2-r_1r_2\dot{\theta}_2\dot{\Delta})\\ \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{\theta}_2} &= 4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 + 2\dot{r}_1r_2\dot{\theta}_1\cos{\Delta} + 2r_1\dot{r}_2\dot{\theta}_1\cos{\Delta} + 2r_1r_2\ddot{\theta}_1\cos{\Delta} - 2r_1r_2\dot{\theta}_1\dot{\Delta}\sin{\Delta} - 2\ddot{r}_1r_2\sin{\Delta} - 2\dot{r}_1\dot{r}_2\sin{\Delta} - 2\dot{r}_1r_2\dot{\Delta}\cos{\Delta} \\ &=4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(\dot{r}_1r_2(\dot{\theta}_1-\dot{\Delta})+r_1\dot{r}_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)-2\sin{\Delta}(r_1r_2\dot{\theta}_1\dot{\Delta} + \ddot{r}_1r_2 + \dot{r}_1\dot{r}_2) \\ &=4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(\dot{r}_1r_2\dot{\Delta}_1+r_1\dot{r}_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)-2\sin{\Delta}(r_1r_2\dot{\theta}_1\dot{\Delta} + \ddot{r}_1r_2 + \dot{r}_1\dot{r}_2). \end{aligned} d t d ∂ r ˙ 1 ∂ ∣ Δ v 2 1 ∣ 2 d t d ∂ r ˙ 2 ∂ ∣ Δ v 2 1 ∣ 2 d t d ∂ θ ˙ 1 ∂ ∣ Δ v 2 1 ∣ 2 d t d ∂ θ ˙ 2 ∂ ∣ Δ v 2 1 ∣ 2 = 2 r ¨ 2 cos Δ − 2 r ˙ 2 Δ ˙ sin Δ − 2 r ˙ 2 θ ˙ 2 sin Δ − 2 r 2 θ ¨ 2 sin Δ − 2 r 2 θ ˙ 2 Δ ˙ cos Δ = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 Δ ˙ ) − 2 sin Δ ( r ˙ 2 Δ ˙ + r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 Δ ˙ ) − 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˙ 1 ) ) − 2 sin Δ ( r ˙ 2 ( Δ ˙ 2 + θ ˙ 1 ) + r 2 θ ¨ 2 ) . \begin{aligned} \dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_1} &= \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_1} - \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial r_1} \\ &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2\dot{\Delta}) - 2\sin{\Delta}(\dot{r}_2\dot{\Delta}_2+r_2\ddot{\theta}_2) - \left(2r_2\dot{\theta}_1\dot{\theta}_2\cos{\Delta} + 2\dot{r}_2\dot{\theta}_1\sin{\Delta}\right) \\ &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2(\dot{\Delta}+\dot{\theta}_1)) - 2\sin{\Delta} (\dot{r}_2(\dot{\Delta}_2+\dot{\theta}_1)+r_2\ddot{\theta}_2). \end{aligned} δ ′ r 1 δ ′ ∣ Δ v 2 1 ∣ 2 = d t d ∂ r ˙ 1 ∂ ∣ Δ v 2 1 ∣ 2 − ∂ r 1 ∂ ∣ Δ v 2 1 ∣ 2 = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 Δ ˙ ) − 2 sin Δ ( r ˙ 2 Δ ˙ 2 + r 2 θ ¨ 2 ) − ( 2 r 2 θ ˙ 1 θ ˙ 2 cos Δ + 2 r ˙ 2 θ ˙ 1 sin Δ ) = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 ( Δ ˙ + θ ˙ 1 ) ) − 2 sin Δ ( r ˙ 2 ( Δ ˙ 2 + θ ˙ 1 ) + r 2 θ ¨ 2 ) . Where Δ ˙ + θ ˙ 1 = θ ˙ 2 − θ ˙ 1 + θ ˙ 1 = θ ˙ 2 \dot{\Delta} + \dot{\theta}_1 = \dot{\theta}_2 - \dot{\theta}_1 + \dot{\theta}_1 = \dot{\theta}_2 Δ ˙ + θ ˙ 1 = θ ˙ 2 − θ ˙ 1 + θ ˙ 1 = θ ˙ 2 and Δ ˙ 2 + θ ˙ 1 = 2 θ ˙ 2 − θ ˙ 1 + θ ˙ 1 = 2 θ ˙ 2 \dot{\Delta}_2 + \dot{\theta}_1 = 2\dot{\theta}_2 - \dot{\theta}_1 + \dot{\theta}_1 = 2\dot{\theta}_2 Δ ˙ 2 + θ ˙ 1 = 2 θ ˙ 2 − θ ˙ 1 + θ ˙ 1 = 2 θ ˙ 2 .
δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ r 1 = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − 2 sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) . \begin{aligned} \dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_1} &= 2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2) - 2\sin{\Delta} (2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2). \end{aligned} δ ′ r 1 δ ′ ∣ Δ v 2 1 ∣ 2 = 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − 2 sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) . As for r 2 r_2 r 2
δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ r 2 = d d t ∂ ∣ Δ v ⃗ 21 ∣ 2 ∂ r ˙ 2 − ∂ ∣ Δ v ⃗ 21 ∣ 2 ∂ r 2 = 2 r ¨ 2 + 2 cos Δ ( r ¨ 1 + r 1 θ ˙ 1 Δ ˙ ) + 2 sin Δ ( r 1 θ ¨ 1 + r ˙ 1 Δ ˙ 1 ) − [ 2 r 2 θ ˙ 2 2 + 2 r 1 θ ˙ 1 θ ˙ 2 cos Δ − 2 r ˙ 1 θ ˙ 2 sin Δ ] = 2 r ¨ 2 − 2 r 2 θ ˙ 2 2 + 2 cos Δ ( r ¨ 1 + r 1 θ ˙ 1 ( Δ ˙ − θ ˙ 2 ) ) + 2 sin Δ ( r 1 θ ¨ 1 + r ˙ 1 ( Δ ˙ 1 + θ ˙ 2 ) ) . \begin{aligned} \dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_2} &= \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{r}_2} - \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial r_2} \\ &= 2\ddot{r}_2 + 2\cos{\Delta}(\ddot{r}_1 + r_1\dot{\theta}_1 \dot{\Delta}) + 2\sin{\Delta}(r_1\ddot{\theta}_1 + \dot{r}_1\dot{\Delta}_1) - \left[2r_2\dot{\theta}_2^2+2r_1\dot{\theta}_1\dot{\theta}_2\cos{\Delta}-2\dot{r}_1\dot{\theta}_2\sin{\Delta}\right]\\ &= 2\ddot{r}_2 -2r_2\dot{\theta}_2^2 + 2\cos{\Delta}(\ddot{r}_1 + r_1\dot{\theta}_1( \dot{\Delta}-\dot{\theta}_2))+2\sin{\Delta}(r_1\ddot{\theta}_1 + \dot{r}_1(\dot{\Delta}_1+\dot{\theta}_2)). \end{aligned} δ ′ r 2 δ ′ ∣ Δ v 2 1 ∣ 2 = d t d ∂ r ˙ 2 ∂ ∣ Δ v 2 1 ∣ 2 − ∂ r 2 ∂ ∣ Δ v 2 1 ∣ 2 = 2 r ¨ 2 + 2 cos Δ ( r ¨ 1 + r 1 θ ˙ 1 Δ ˙ ) + 2 sin Δ ( r 1 θ ¨ 1 + r ˙ 1 Δ ˙ 1 ) − [ 2 r 2 θ ˙ 2 2 + 2 r 1 θ ˙ 1 θ ˙ 2 cos Δ − 2 r ˙ 1 θ ˙ 2 sin Δ ] = 2 r ¨ 2 − 2 r 2 θ ˙ 2 2 + 2 cos Δ ( r ¨ 1 + r 1 θ ˙ 1 ( Δ ˙ − θ ˙ 2 ) ) + 2 sin Δ ( r 1 θ ¨ 1 + r ˙ 1 ( Δ ˙ 1 + θ ˙ 2 ) ) . Hence Δ ˙ − θ ˙ 2 = θ ˙ 2 − θ ˙ 1 − θ ˙ 2 = − θ ˙ 1 \dot{\Delta}-\dot{\theta}_2 = \dot{\theta}_2-\dot{\theta}_1-\dot{\theta}_2 = -\dot{\theta}_1 Δ ˙ − θ ˙ 2 = θ ˙ 2 − θ ˙ 1 − θ ˙ 2 = − θ ˙ 1 and Δ ˙ 1 + θ ˙ 2 = 2 θ ˙ 1 − θ ˙ 2 + θ ˙ 2 = 2 θ ˙ 1 \dot{\Delta}_1 + \dot{\theta}_2 = 2\dot{\theta}_1 - \dot{\theta}_2 + \dot{\theta}_2 = 2\dot{\theta}_1 Δ ˙ 1 + θ ˙ 2 = 2 θ ˙ 1 − θ ˙ 2 + θ ˙ 2 = 2 θ ˙ 1 .
δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ r 2 = 2 r ¨ 2 − 2 r 2 θ ˙ 2 2 + 2 cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + 2 sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) . \begin{aligned} \dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_2} &= 2\ddot{r}_2 -2r_2\dot{\theta}_2^2 + 2\cos{\Delta}(\ddot{r}_1 - r_1\dot{\theta}_1^2)+2\sin{\Delta}(r_1\ddot{\theta}_1 + 2\dot{r}_1\dot{\theta}_1). \end{aligned} δ ′ r 2 δ ′ ∣ Δ v 2 1 ∣ 2 = 2 r ¨ 2 − 2 r 2 θ ˙ 2 2 + 2 cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + 2 sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) . As for θ 1 \theta_1 θ 1
δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ θ 1 = d d t ∂ ∣ Δ v ⃗ 21 ∣ 2 ∂ θ ˙ 1 − ∂ ∣ Δ v ⃗ 21 ∣ 2 ∂ θ 1 = 2 cos Δ ( r ˙ 1 r 2 θ ˙ 2 + r 1 r ˙ 2 Δ ˙ 2 + r 1 r 2 θ ¨ 2 ) + 2 sin Δ ( r ˙ 1 r ˙ 2 + r 1 r ¨ 2 − r 1 r 2 θ ˙ 2 Δ ˙ ) − [ 2 sin Δ ( r ˙ 1 r ˙ 2 + r 1 r 2 θ ˙ 1 θ ˙ 2 ) − 2 cos Δ ( r 1 r ˙ 2 θ ˙ 1 − r ˙ 1 r 2 θ ˙ 2 ) ] = 2 cos Δ ( r ˙ 1 r 2 ( θ ˙ 2 − θ ˙ 2 ) + r 1 r ˙ 2 ( Δ ˙ 2 + θ ˙ 1 ) + r 1 r 2 θ ¨ 2 ) + 2 sin Δ ( r ˙ 1 r ˙ 2 − r ˙ 1 r ˙ 2 + r 1 r ¨ 2 − r 1 r 2 θ ˙ 2 ( Δ ˙ + θ ˙ 1 ) ) = 2 cos Δ ( 2 r 1 r ˙ 2 θ ˙ 2 + r 1 r 2 θ ¨ 2 ) + 2 sin Δ ( r 1 r ¨ 2 − r 1 r 2 θ ˙ 2 2 ) . \begin{aligned} \dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' \theta_1} &= \dfrac{d}{dt}\dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \dot{\theta}_1} - \dfrac{\partial |\Delta \vec{v}_{21}|^2}{\partial \theta_1} \\ &= 2\cos{\Delta}(\dot{r}_1r_2\dot{\theta}_2 + r_1\dot{r}_2 \dot{\Delta}_2+r_1r_2\ddot{\theta}_2) +2\sin{\Delta}(\dot{r}_1\dot{r}_2+r_1\ddot{r}_2-r_1r_2\dot{\theta}_2\dot{\Delta}) - \left[2\sin{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) - 2\cos{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2)\right] \\ &= 2\cos{\Delta}(\dot{r}_1r_2(\dot{\theta}_2 - \dot{\theta}_2)+ r_1\dot{r}_2 (\dot{\Delta}_2+\dot{\theta}_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_2} \\ &= 4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(\dot{r}_1r_2\dot{\Delta}_1+r_1\dot{r}_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)-2\sin{\Delta}(r_1r_2\dot{\theta}_1\dot{\Delta} + \ddot{r}_1r_2 + \dot{r}_1\dot{r}_2) - \left[-2\sin{\Delta}(\dot{r}_1\dot{r}_2 + r_1r_2\dot{\theta}_1\dot{\theta}_2) + 2\cos{\Delta}(r_1\dot{r}_2\dot{\theta}_1-\dot{r}_1r_2\dot{\theta}_2)\right] \\ &= 4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(\dot{r}_1r_2(\dot{\Delta}_1+\dot{\theta}_2)+r_1\dot{r}_2(\dot{\theta}_1-\dot{\theta}_1)+r_1r_2\ddot{\theta}_1)+2\sin{\Delta}(r_1r_2\dot{\theta}_1(\dot{\theta}_2-\dot{\Delta}) - \ddot{r}_1r_2 + \dot{r}_1\dot{r}_2-\dot{r}_1\dot{r}_2) \\ &= 4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(2\dot{r}_1r_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)+2\sin{\Delta}(r_1r_2\dot{\theta}_1(\dot{\theta}_2-(\dot{\theta}_2-\dot{\theta}_1))-\ddot{r}_1r_2) \\ &= 4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(2\dot{r}_1r_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)+2\sin{\Delta}(r_1r_2\dot{\theta}_1^2-\ddot{r}_1r_2). \end{aligned} δ ′ θ 2 δ ′ ∣ Δ v 2 1 ∣ 2 = d t d ∂ θ ˙ 2 ∂ ∣ Δ v 2 1 ∣ 2 − ∂ θ 2 ∂ ∣ Δ v 2 1 ∣ 2 = 4 r 2 r ˙ 2 θ ˙ 2 + 2 r 2 2 θ ¨ 2 + 2 cos Δ ( r ˙ 1 r 2 Δ ˙ 1 + r 1 r ˙ 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) − 2 sin Δ ( r 1 r 2 θ ˙ 1 Δ ˙ + r ¨ 1 r 2 + r ˙ 1 r ˙ 2 ) − [ − 2 sin Δ ( r ˙ 1 r ˙ 2 + r 1 r 2 θ ˙ 1 θ ˙ 2 ) + 2 cos Δ ( r 1 r ˙ 2 θ ˙ 1 − r ˙ 1 r 2 θ ˙ 2 ) ] = 4 r 2 r ˙ 2 θ ˙ 2 + 2 r 2 2 θ ¨ 2 + 2 cos Δ ( r ˙ 1 r 2 ( Δ ˙ 1 + θ ˙ 2 ) + r 1 r ˙ 2 ( θ ˙ 1 − θ ˙ 1 ) + r 1 r 2 θ ¨ 1 ) + 2 sin Δ ( r 1 r 2 θ ˙ 1 ( θ ˙ 2 − Δ ˙ ) − r ¨ 1 r 2 + r ˙ 1 r ˙ 2 − r ˙ 1 r ˙ 2 ) = 4 r 2 r ˙ 2 θ ˙ 2 + 2 r 2 2 θ ¨ 2 + 2 cos Δ ( 2 r ˙ 1 r 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) + 2 sin Δ ( r 1 r 2 θ ˙ 1 ( θ ˙ 2 − ( θ ˙ 2 − θ ˙ 1 ) ) − r ¨ 1 r 2 ) = 4 r 2 r ˙ 2 θ ˙ 2 + 2 r 2 2 θ ¨ 2 + 2 cos Δ ( 2 r ˙ 1 r 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) + 2 sin Δ ( r 1 r 2 θ ˙ 1 2 − r ¨ 1 r 2 ) . It is important to note that δ ′ f ( q i ) δ ′ q i = − ∂ f ∂ q i \dfrac{\delta' f(q_i)}{\delta' q_i} = -\dfrac{\partial f}{\partial q_i} δ ′ q i δ ′ f ( q i ) = − ∂ q i ∂ f and of course if a term does not depend on q i q_i q i or q ˙ i \dot{q}_i q ˙ i its functional derivative with respect to q i q_i q i is zero. Hence
δ ′ L δ ′ r 1 = ( m 1 + m 2 ) [ δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ r 1 2 − g sin θ 1 δ ′ r 1 δ ′ r 1 ] + m 2 [ δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ r 1 2 ] − k 1 2 δ ′ ( r 1 − l 1 ) 2 δ ′ r 1 . \begin{aligned} \dfrac{\delta' \mathcal{L}}{\delta' r_1} &= (m_1+m_2)\left[\dfrac{\dfrac{\delta' |\vec{v}_1|^2}{\delta' r_1}}{2} -g\sin{\theta_1}\dfrac{\delta' r_1}{\delta' r_1}\right] + m_2\left[\dfrac{\dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_1}}{2}\right] - \dfrac{k_1}{2} \dfrac{\delta' (r_1-l_1)^2}{\delta' r_1}. \end{aligned} δ ′ r 1 δ ′ L = ( m 1 + m 2 ) ⎣ ⎢ ⎢ ⎢ ⎡ 2 δ ′ r 1 δ ′ ∣ v 1 ∣ 2 − g sin θ 1 δ ′ r 1 δ ′ r 1 ⎦ ⎥ ⎥ ⎥ ⎤ + m 2 ⎣ ⎢ ⎢ ⎢ ⎡ 2 δ ′ r 1 δ ′ ∣ Δ v 2 1 ∣ 2 ⎦ ⎥ ⎥ ⎥ ⎤ − 2 k 1 δ ′ r 1 δ ′ ( r 1 − l 1 ) 2 . We have deliberately ignored the m 2 g r 2 sin θ 2 m_2gr_2\sin{\theta_2} m 2 g r 2 sin θ 2 and − k 2 ( r 2 − l 2 ) 2 2 -\dfrac{k_2(r_2-l_2)^2}{2} − 2 k 2 ( r 2 − l 2 ) 2 as they are independent of r 1 r_1 r 1 .
δ ′ L δ ′ r 1 = ( m 1 + m 2 ) [ 2 r ¨ 1 − 2 r 1 θ ˙ 1 2 2 + g sin θ 1 ] + m 2 [ 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − 2 sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) 2 ] + k 1 ( r 1 − l 1 ) = ( m 1 + m 2 ) [ r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 ] + m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 ( r 1 − l 1 ) . \begin{aligned} \dfrac{\delta' \mathcal{L}}{\delta' r_1} &= (m_1+m_2)\left[\dfrac{2\ddot{r}_1-2r_1\dot{\theta}_1^2}{2} + g\sin{\theta_1}\right] + m_2\left[\dfrac{2\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2) - 2\sin{\Delta} (2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2)}{2}\right] + k_1(r_1-l_1)\\ &= (m_1+m_2)\left[\ddot{r}_1-r_1\dot{\theta}_1^2 + g\sin{\theta_1}\right] + m_2\left[\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2) - \sin{\Delta} (2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2)\right] + k_1(r_1-l_1). \end{aligned} δ ′ r 1 δ ′ L = ( m 1 + m 2 ) [ 2 2 r ¨ 1 − 2 r 1 θ ˙ 1 2 + g sin θ 1 ] + m 2 [ 2 2 cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − 2 sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 ( r 1 − l 1 ) = ( m 1 + m 2 ) [ r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 ] + m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 ( r 1 − l 1 ) . The generalized dissipation force canonical to r 1 r_1 r 1 is hence
Q r 1 = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) v ⃗ 1 ⋅ ∂ r ⃗ 1 ∂ r 1 − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) v ⃗ 2 ⋅ ∂ r ⃗ 2 ∂ r 1 = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 ] ⋅ [ cos θ 1 sin θ 1 ] − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 ] ⋅ [ cos θ 1 sin θ 1 ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ r ˙ 1 cos 2 θ 1 − r 1 θ ˙ 1 sin θ 1 cos θ 1 + r ˙ 1 sin 2 θ 1 + r 1 θ ˙ 1 cos θ 1 sin θ 1 ] − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos 2 θ 1 − r 1 θ ˙ 1 sin θ 1 cos θ 1 + r ˙ 2 cos θ 1 cos θ 2 − r 2 θ ˙ 2 cos θ 1 sin θ 2 + r ˙ 1 sin 2 θ 1 + r 1 θ ˙ 1 cos θ 1 sin θ 1 + r ˙ 2 sin θ 1 sin θ 2 + r 2 θ ˙ 2 sin θ 1 cos θ 2 ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ r ˙ 1 ( cos 2 θ 1 + sin 2 θ 1 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 1 + sin θ 1 cos θ 1 ) ] − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 ( cos 2 θ 1 + sin 2 θ 1 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 1 + sin θ 1 cos θ 1 ) + r ˙ 2 ( cos θ 1 cos θ 2 + sin θ 1 sin θ 2 ) + r 2 θ ˙ 2 ( − cos θ 1 sin θ 2 + sin θ 1 cos θ 2 ) ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) r ˙ 1 − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 + r ˙ 2 cos ( θ 2 − θ 1 ) − r 2 θ ˙ 2 sin ( θ 2 − θ 1 ) ] . = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) r ˙ 1 − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 + r ˙ 2 cos Δ − r 2 θ ˙ 2 sin Δ ] . \begin{aligned} Q_{r_1} &= -(b_1+c_1|\vec{v}_1|)\vec{v}_1\cdot \dfrac{\partial \vec{r}_1}{\partial r_1} - (b_2+c_2|\vec{v}_2|)\vec{v}_2\cdot \dfrac{\partial \vec{r}_2}{\partial r_1} \\ &= -(b_1+c_1|\vec{v}_1|)\begin{bmatrix} \dot{r}_1\cos{\theta_1} - r_1\dot{\theta}_1\sin{\theta_1} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1\cos{\theta_1} \end{bmatrix} \cdot \begin{bmatrix} \cos{\theta_1} \\ \sin{\theta_1} \end{bmatrix} - (b_2+c_2|\vec{v}_2|)\begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2} \end{bmatrix} \cdot \begin{bmatrix} \cos{\theta_1} \\ \sin{\theta_1} \end{bmatrix} \\ &= -(b_1+c_1|\vec{v}_1|)\left[\dot{r}_1\cos^2{\theta_1} - r_1\dot{\theta}_1\sin{\theta_1}\cos{\theta_1} + \dot{r}_1\sin^2{\theta_1} + r_1\dot{\theta}_1\cos{\theta_1}\sin{\theta_1}\right] - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1\cos^2{\theta_1} - r_1\dot{\theta}_1\sin{\theta_1}\cos{\theta_1} + \dot{r}_2\cos{\theta_1}\cos{\theta_2}-r_2\dot{\theta}_2\cos{\theta_1}\sin{\theta_2} \right.\\ &\left.+ \dot{r}_1\sin^2{\theta_1} + r_1\dot{\theta}_1\cos{\theta_1}\sin{\theta_1} + \dot{r}_2\sin{\theta_1}\sin{\theta_2} + r_2\dot{\theta}_2\sin{\theta_1}\cos{\theta_2} \right] \\ &= -(b_1+c_1|\vec{v}_1|)\left[\dot{r}_1(\cos^2{\theta_1}+\sin^2{\theta_1})+r_1\dot{\theta}_1(-\sin{\theta}_1\cos{\theta_1}+\sin{\theta_1}\cos{\theta_1})\right] - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1(\cos^2{\theta_1}+\sin^2{\theta_1}) + r_1\dot{\theta}_1(-\sin{\theta_1}\cos{\theta_1}+\sin{\theta_1}\cos{\theta_1}) \right.\\ &\left. + \dot{r}_2(\cos{\theta_1}\cos{\theta_2}+\sin{\theta_1}\sin{\theta_2})+r_2\dot{\theta}_2(-\cos{\theta_1}\sin{\theta_2} + \sin{\theta_1}\cos{\theta_2}) \right] \\ &= -(b_1+c_1|\vec{v}_1|)\dot{r}_1 - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1+\dot{r}_2\cos{(\theta_2-\theta_1)}-r_2\dot{\theta}_2\sin{(\theta_2-\theta_1)} \right]. \\ &= -(b_1+c_1|\vec{v}_1|)\dot{r}_1 - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1+\dot{r}_2\cos{\Delta}-r_2\dot{\theta}_2\sin{\Delta} \right]. \\ \end{aligned} Q r 1 = − ( b 1 + c 1 ∣ v 1 ∣ ) v 1 ⋅ ∂ r 1 ∂ r 1 − ( b 2 + c 2 ∣ v 2 ∣ ) v 2 ⋅ ∂ r 1 ∂ r 2 = − ( b 1 + c 1 ∣ v 1 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 ] ⋅ [ cos θ 1 sin θ 1 ] − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 ] ⋅ [ cos θ 1 sin θ 1 ] = − ( b 1 + c 1 ∣ v 1 ∣ ) [ r ˙ 1 cos 2 θ 1 − r 1 θ ˙ 1 sin θ 1 cos θ 1 + r ˙ 1 sin 2 θ 1 + r 1 θ ˙ 1 cos θ 1 sin θ 1 ] − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 cos 2 θ 1 − r 1 θ ˙ 1 sin θ 1 cos θ 1 + r ˙ 2 cos θ 1 cos θ 2 − r 2 θ ˙ 2 cos θ 1 sin θ 2 + r ˙ 1 sin 2 θ 1 + r 1 θ ˙ 1 cos θ 1 sin θ 1 + r ˙ 2 sin θ 1 sin θ 2 + r 2 θ ˙ 2 sin θ 1 cos θ 2 ] = − ( b 1 + c 1 ∣ v 1 ∣ ) [ r ˙ 1 ( cos 2 θ 1 + sin 2 θ 1 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 1 + sin θ 1 cos θ 1 ) ] − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 ( cos 2 θ 1 + sin 2 θ 1 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 1 + sin θ 1 cos θ 1 ) + r ˙ 2 ( cos θ 1 cos θ 2 + sin θ 1 sin θ 2 ) + r 2 θ ˙ 2 ( − cos θ 1 sin θ 2 + sin θ 1 cos θ 2 ) ] = − ( b 1 + c 1 ∣ v 1 ∣ ) r ˙ 1 − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 + r ˙ 2 cos ( θ 2 − θ 1 ) − r 2 θ ˙ 2 sin ( θ 2 − θ 1 ) ] . = − ( b 1 + c 1 ∣ v 1 ∣ ) r ˙ 1 − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 + r ˙ 2 cos Δ − r 2 θ ˙ 2 sin Δ ] . Hence the Euler-Lagrange equation for r 1 r_1 r 1 with dissipative forces is
( m 1 + m 2 ) [ r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 ] + m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 ( r 1 − l 1 ) = Q r 1 . \begin{aligned} (m_1+m_2)\left[\ddot{r}_1-r_1\dot{\theta}_1^2 + g\sin{\theta_1}\right] + m_2\left[\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2) - \sin{\Delta} (2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2)\right] + k_1(r_1-l_1) &= Q_{r_1}. \end{aligned} ( m 1 + m 2 ) [ r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 ] + m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 ( r 1 − l 1 ) = Q r 1 . Dividing by m 1 + m 2 m_1+m_2 m 1 + m 2
r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 + m 2 m 1 + m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + k 1 m 1 + m 2 ( r 1 − l 1 ) = Q r 1 m 1 + m 2 . \begin{aligned} \ddot{r}_1-r_1\dot{\theta}_1^2 + g\sin{\theta_1} + \dfrac{m_2}{m_1+m_2}\left[\cos{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2) - \sin{\Delta} (2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2)\right] + \dfrac{k_1}{m_1+m_2}(r_1-l_1) &= \dfrac{Q_{r_1}}{m_1+m_2}. \end{aligned} r ¨ 1 − r 1 θ ˙ 1 2 + g sin θ 1 + m 1 + m 2 m 2 [ cos Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) − sin Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) ] + m 1 + m 2 k 1 ( r 1 − l 1 ) = m 1 + m 2 Q r 1 . Expanding out second derivative terms and placing them first on the left-hand side yields
r ¨ 1 + m 2 cos Δ m 1 + m 2 r ¨ 2 + 0 θ ¨ 1 − m 2 r 2 sin Δ m 1 + m 2 θ ¨ 2 − r 1 θ ˙ 1 2 + g sin θ 1 − m 2 m 1 + m 2 [ r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ] + k 1 m 1 + m 2 ( r 1 − l 1 ) = Q r 1 m 1 + m 2 . \begin{aligned} \ddot{r}_1 + \dfrac{m_2\cos{\Delta}}{m_1+m_2}\ddot{r}_2 + 0\ddot{\theta}_1 - \dfrac{m_2r_2\sin{\Delta}}{m_1+m_2}\ddot{\theta}_2 - r_1\dot{\theta}_1^2 + g\sin{\theta_1} - \dfrac{m_2}{m_1+m_2}\left[r_2\dot{\theta}_2^2\cos{\Delta} + 2\dot{r}_2\dot{\theta}_2\sin{\Delta}\right] + \dfrac{k_1}{m_1+m_2}(r_1-l_1) &= \dfrac{Q_{r_1}}{m_1+m_2}. \end{aligned} r ¨ 1 + m 1 + m 2 m 2 cos Δ r ¨ 2 + 0 θ ¨ 1 − m 1 + m 2 m 2 r 2 sin Δ θ ¨ 2 − r 1 θ ˙ 1 2 + g sin θ 1 − m 1 + m 2 m 2 [ r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ] + m 1 + m 2 k 1 ( r 1 − l 1 ) = m 1 + m 2 Q r 1 . Moving all terms that do not involve second derivatives to the right-hand side yields
r ¨ 1 + m 2 cos Δ m 1 + m 2 r ¨ 2 + 0 θ ¨ 1 − m 2 r 2 sin Δ m 1 + m 2 θ ¨ 2 = r 1 θ ˙ 1 2 − g sin θ 1 + m 2 m 1 + m 2 [ r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ] + Q r 1 − k 1 ( r 1 − l 1 ) m 1 + m 2 . \begin{aligned} \ddot{r}_1 + \dfrac{m_2\cos{\Delta}}{m_1+m_2}\ddot{r}_2 + 0\ddot{\theta}_1 - \dfrac{m_2r_2\sin{\Delta}}{m_1+m_2}\ddot{\theta}_2 &= r_1\dot{\theta}_1^2 - g\sin{\theta_1} + \dfrac{m_2}{m_1+m_2}\left[r_2\dot{\theta}_2^2\cos{\Delta} + 2\dot{r}_2\dot{\theta}_2\sin{\Delta}\right] + \dfrac{Q_{r_1}-k_1(r_1-l_1)}{m_1+m_2}. \end{aligned} r ¨ 1 + m 1 + m 2 m 2 cos Δ r ¨ 2 + 0 θ ¨ 1 − m 1 + m 2 m 2 r 2 sin Δ θ ¨ 2 = r 1 θ ˙ 1 2 − g sin θ 1 + m 1 + m 2 m 2 [ r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ] + m 1 + m 2 Q r 1 − k 1 ( r 1 − l 1 ) . As for r 2 r_2 r 2
δ ′ L δ ′ r 2 = ( m 1 + m 2 ) [ δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ r 2 2 ] + m 2 [ δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ r 2 2 − g sin θ 2 δ ′ r 2 δ ′ r 2 ] − k 2 2 δ ′ ( r 2 − l 2 ) 2 δ ′ r 2 = ( m 1 + m 2 ) [ 0 2 ] + m 2 [ 2 r ¨ 2 − 2 r 2 θ ˙ 2 2 + 2 cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + 2 sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) 2 + g sin θ 2 ] + k 2 ( r 2 − l 2 ) = m 2 [ r ¨ 2 − r 2 θ ˙ 2 2 + cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) + g sin θ 2 ] + k 2 ( r 2 − l 2 ) Q r 2 = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) v ⃗ 1 ⋅ ∂ r ⃗ 1 ∂ r 2 − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) v ⃗ 2 ⋅ ∂ r ⃗ 2 ∂ r 2 = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 ] ⋅ 0 ⃗ − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos θ 1 − r 1 θ ˙ 1 sin θ 1 + r ˙ 2 cos θ 2 − r 2 θ ˙ 2 sin θ 2 r ˙ 1 sin θ 1 + r 1 θ ˙ 1 cos θ 1 + r ˙ 2 sin θ 2 + r 2 θ ˙ 2 cos θ 2 ] ⋅ [ cos θ 2 sin θ 2 ] = − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos θ 1 cos θ 2 − r 1 θ ˙ 1 sin θ 1 cos θ 2 + r ˙ 2 cos 2 θ 2 − r 2 θ ˙ 2 sin θ 2 cos θ 2 + r ˙ 1 sin θ 1 sin θ 2 + r 1 θ ˙ 1 cos θ 1 sin θ 2 + r ˙ 2 sin 2 θ 2 + r 2 θ ˙ 2 cos θ 2 sin θ 2 ] = − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 ( cos θ 1 cos θ 2 + sin θ 1 sin θ 2 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 2 + cos θ 1 sin θ 2 ) + r ˙ 2 ( cos 2 θ 2 + sin 2 θ 2 ) + r 2 θ ˙ 2 ( − sin θ 2 cos θ 2 + cos θ 2 sin θ 2 ) ] = − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos ( θ 2 − θ 1 ) + r 1 θ ˙ 1 sin ( θ 2 − θ 1 ) + r ˙ 2 ] = − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r ˙ 1 cos Δ + r 1 θ ˙ 1 sin Δ + r ˙ 2 ] . \begin{aligned} \dfrac{\delta' \mathcal{L}}{\delta' r_2} &= (m_1+m_2)\left[\dfrac{\dfrac{\delta' |\vec{v}_1|^2}{\delta' r_2}}{2}\right] + m_2\left[\dfrac{\dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' r_2}}{2} - g\sin{\theta}_2\dfrac{\delta' r_2}{\delta' r_2}\right] - \dfrac{k_2}{2} \dfrac{\delta' (r_2-l_2)^2}{\delta' r_2} \\ &= (m_1+m_2)\left[\dfrac{0}{2}\right] + m_2\left[\dfrac{2\ddot{r}_2 -2r_2\dot{\theta}_2^2 + 2\cos{\Delta}(\ddot{r}_1 - r_1\dot{\theta}_1^2)+2\sin{\Delta}(r_1\ddot{\theta}_1 + 2\dot{r}_1\dot{\theta}_1)}{2} + g\sin{\theta_2}\right] + k_2(r_2-l_2) \\ &= m_2\left[\ddot{r}_2 - r_2\dot{\theta}_2^2 + \cos{\Delta}(\ddot{r}_1 - r_1\dot{\theta}_1^2)+\sin{\Delta}(r_1\ddot{\theta}_1 + 2\dot{r}_1\dot{\theta}_1) + g\sin{\theta_2}\right] + k_2(r_2-l_2)\\ Q_{r_2} &= -(b_1+c_1|\vec{v}_1|)\vec{v}_1 \cdot \dfrac{\partial \vec{r}_1}{\partial r_2} - (b_2+c_2|\vec{v}_2|)\vec{v}_2 \cdot \dfrac{\partial \vec{r}_2}{\partial r_2} \\ &= -(b_1+c_1|\vec{v}_1|)\begin{bmatrix} \dot{r}_1\cos{\theta_1} - r_1\dot{\theta}_1\sin{\theta_1} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1\cos{\theta_1} \end{bmatrix} \cdot \vec{0} - (b_2+c_2|\vec{v}_2|)\begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2} \end{bmatrix} \cdot \begin{bmatrix} \cos{\theta_2} \\ \sin{\theta_2} \end{bmatrix} \\ &= - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1\cos{\theta_1}\cos{\theta_2} - r_1\dot{\theta}_1\sin{\theta_1}\cos{\theta_2} + \dot{r}_2\cos^2{\theta_2}-r_2\dot{\theta}_2\sin{\theta_2}\cos{\theta_2} + \dot{r}_1\sin{\theta_1}\sin{\theta_2} + r_1\dot{\theta}_1\cos{\theta_1}\sin{\theta_2} + \dot{r}_2\sin^2{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2}\sin{\theta_2}\right] \\ &= - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1(\cos{\theta_1}\cos{\theta_2}+\sin{\theta_1}\sin{\theta_2}) + r_1\dot{\theta}_1(-\sin{\theta_1}\cos{\theta_2} + \cos{\theta_1}\sin{\theta_2}) + \dot{r}_2(\cos^2{\theta_2} + \sin^2{\theta_2})+r_2\dot{\theta}_2(-\sin{\theta_2}\cos{\theta_2} + \cos{\theta_2}\sin{\theta_2})\right] \\ &= - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1\cos{(\theta_2-\theta_1)} + r_1\dot{\theta}_1\sin{(\theta_2-\theta_1)} + \dot{r}_2\right] \\ &= - (b_2+c_2|\vec{v}_2|)\left[\dot{r}_1\cos{\Delta} + r_1\dot{\theta}_1\sin{\Delta} + \dot{r}_2\right]. \end{aligned} δ ′ r 2 δ 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 cos θ 1 cos θ 2 − r 1 θ ˙ 1 sin θ 1 cos θ 2 + r ˙ 2 cos 2 θ 2 − r 2 θ ˙ 2 sin θ 2 cos θ 2 + r ˙ 1 sin θ 1 sin θ 2 + r 1 θ ˙ 1 cos θ 1 sin θ 2 + r ˙ 2 sin 2 θ 2 + r 2 θ ˙ 2 cos θ 2 sin θ 2 ] = − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 ( cos θ 1 cos θ 2 + sin θ 1 sin θ 2 ) + r 1 θ ˙ 1 ( − sin θ 1 cos θ 2 + cos θ 1 sin θ 2 ) + r ˙ 2 ( cos 2 θ 2 + sin 2 θ 2 ) + r 2 θ ˙ 2 ( − sin θ 2 cos θ 2 + cos θ 2 sin θ 2 ) ] = − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 cos ( θ 2 − θ 1 ) + r 1 θ ˙ 1 sin ( θ 2 − θ 1 ) + r ˙ 2 ] = − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 cos Δ + r 1 θ ˙ 1 sin Δ + r ˙ 2 ] . Hence the Euler-Lagrange equation for r 2 r_2 r 2 with dissipative forces is
m 2 [ r ¨ 2 − r 2 θ ˙ 2 2 + cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) + g sin θ 2 ] + k 2 ( r 2 − l 2 ) = Q r 2 \begin{aligned} m_2\left[\ddot{r}_2 - r_2\dot{\theta}_2^2 + \cos{\Delta}(\ddot{r}_1 - r_1\dot{\theta}_1^2)+\sin{\Delta}(r_1\ddot{\theta}_1 + 2\dot{r}_1\dot{\theta}_1) + g\sin{\theta_2}\right] + k_2(r_2-l_2) &= Q_{r_2} \end{aligned} m 2 [ r ¨ 2 − r 2 θ ˙ 2 2 + cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) + g sin θ 2 ] + k 2 ( r 2 − l 2 ) = Q r 2 Dividing by m 2 m_2 m 2 yields
r ¨ 2 − r 2 θ ˙ 2 2 + cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) + g sin θ 2 + k 2 ( r 2 − l 2 ) m 2 = Q r 2 m 2 . \begin{aligned} \ddot{r}_2 - r_2\dot{\theta}_2^2 + \cos{\Delta}(\ddot{r}_1 - r_1\dot{\theta}_1^2)+\sin{\Delta}(r_1\ddot{\theta}_1 + 2\dot{r}_1\dot{\theta}_1) + g\sin{\theta_2} + \dfrac{k_2(r_2-l_2)}{m_2} &= \dfrac{Q_{r_2}}{m_2}. \end{aligned} r ¨ 2 − r 2 θ ˙ 2 2 + cos Δ ( r ¨ 1 − r 1 θ ˙ 1 2 ) + sin Δ ( r 1 θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 ) + g sin θ 2 + m 2 k 2 ( r 2 − l 2 ) = m 2 Q r 2 . Next we will expand out second time derivatives and moving everything else to the right-hand side
cos Δ r ¨ 1 + r ¨ 2 + r 1 sin Δ θ ¨ 1 + 0 θ ¨ 2 = r 2 θ ˙ 2 2 − g sin θ 2 + r 1 θ ˙ 1 2 cos Δ − 2 r ˙ 1 θ ˙ 1 sin Δ + Q r 2 − k 2 ( r 2 − l 2 ) m 2 . \begin{aligned} \cos{\Delta}\ddot{r}_1 + \ddot{r}_2 + r_1\sin{\Delta}\ddot{\theta}_1 + 0\ddot{\theta}_2 &= r_2\dot{\theta}_2^2 - g\sin{\theta_2} + r_1\dot{\theta}_1^2\cos{\Delta} - 2\dot{r}_1\dot{\theta}_1\sin{\Delta} + \dfrac{Q_{r_2}-k_2(r_2-l_2)}{m_2}. \end{aligned} cos Δ r ¨ 1 + r ¨ 2 + r 1 sin Δ θ ¨ 1 + 0 θ ¨ 2 = r 2 θ ˙ 2 2 − g sin θ 2 + r 1 θ ˙ 1 2 cos Δ − 2 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 2 cos θ 2 ] ⋅ r 1 [ − sin θ 1 cos θ 1 ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ − r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ ˙ 1 sin 2 θ 1 + r 1 r ˙ 1 sin θ 1 cos θ 1 + r 1 2 θ ˙ 1 cos 2 θ 1 ] − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ − r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ 1 ˙ sin 2 θ 1 − r 1 r ˙ 2 sin θ 1 cos θ 2 + r 1 r 2 θ ˙ 2 sin θ 1 sin θ 2 + r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ ˙ 1 cos 2 θ 1 + r 1 r ˙ 2 cos θ 1 sin θ 2 + r 1 r 2 θ ˙ 2 cos θ 1 cos θ 2 ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) [ r 1 r ˙ 1 ( − cos θ 1 sin θ 1 + sin θ 1 cos θ 1 ) + r 1 2 θ ˙ 1 ( sin 2 θ 1 + cos 2 θ 1 ) ] − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r 1 r ˙ 1 ( − cos θ 1 sin θ 1 + cos θ 1 sin θ 1 ) + r 1 2 θ 1 ˙ ( sin 2 θ 1 + cos 2 θ 1 ) + r 1 r ˙ 2 ( − sin θ 1 cos θ 2 + cos θ 1 sin θ 2 ) + r 1 r 2 θ ˙ 2 ( sin θ 1 sin θ 2 + cos θ 1 cos θ 2 ) ] = − ( b 1 + c 1 ∣ v ⃗ 1 ∣ ) r 1 2 θ ˙ 1 − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r 1 2 θ 1 ˙ + r 1 r ˙ 2 sin ( θ 2 − θ 1 ) + r 1 r 2 θ ˙ 2 cos ( θ 2 − θ 1 ) ] \begin{aligned} \dfrac{\delta' \mathcal{L}}{\delta' \theta_1} &= (m_1+m_2)\left[\dfrac{\dfrac{\delta' |\vec{v}_1|^2}{\delta' \theta_1}}{2} - gr_1\dfrac{\delta' \sin{\theta_1}}{\delta' \theta_1}\right] + m_2\left[\dfrac{\dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' \theta_1}}{2}\right] \\ &= (m_1+m_2)\left[\dfrac{2r_1^2\ddot{\theta}_1 + 4r_1\dot{r}_1\dot{\theta}_1}{2} + gr_1\cos{\theta}_1\right] + m_2\left[\dfrac{2\cos{\Delta}(2r_1\dot{r}_2\dot{\theta}_2+r_1r_2\ddot{\theta}_2) +2\sin{\Delta}(r_1\ddot{r}_2-r_1r_2\dot{\theta}_2^2)}{2}\right]\\ &= (m_1+m_2)\left[r_1^2\ddot{\theta}_1 + 2r_1\dot{r}_1\dot{\theta}_1 + gr_1\cos{\theta}_1\right] + m_2\left[\cos{\Delta}(2r_1\dot{r}_2\dot{\theta}_2+r_1r_2\ddot{\theta}_2) +\sin{\Delta}(r_1\ddot{r}_2-r_1r_2\dot{\theta}_2^2)\right]\\ Q_{\theta_1} &= -(b_1+c_1|\vec{v}_1|)\vec{v}_1 \cdot \dfrac{\partial \vec{r}_1}{\partial \theta_1} - (b_2+c_2|\vec{v}_2|)\vec{v}_2 \cdot \dfrac{\partial \vec{r}_2}{\partial \theta_1} \\ &= -(b_1+c_1|\vec{v}_1|)\begin{bmatrix} \dot{r}_1\cos{\theta_1} - r_1\dot{\theta}_1\sin{\theta_1} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1\cos{\theta}_1 \end{bmatrix} \cdot r_1\begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix} - (b_2+c_2|\vec{v}_2|) \begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2} \end{bmatrix} \cdot r_1\begin{bmatrix} -\sin{\theta_1} \\ \cos{\theta_1} \end{bmatrix} \\ &= -(b_1+c_1|\vec{v}_1|)\left[-r_1\dot{r}_1\cos{\theta_1}\sin{\theta_1}+r_1^2\dot{\theta}_1\sin^2{\theta_1} + r_1\dot{r}_1\sin{\theta_1}\cos{\theta_1}+r_1^2\dot{\theta}_1\cos^2{\theta_1}\right] - (b_2+c_2|\vec{v}_2|)\left[-r_1\dot{r}_1\cos{\theta_1}\sin{\theta_1} + r_1^2\dot{\theta_1}\sin^2{\theta_1} -r_1\dot{r}_2\sin{\theta_1}\cos{\theta_2} \right. \\ &\left.+r_1r_2\dot{\theta}_2\sin{\theta_1}\sin{\theta_2}+r_1\dot{r}_1\cos{\theta_1}\sin{\theta_1}+r_1^2\dot{\theta}_1\cos^2{\theta_1} + r_1\dot{r}_2\cos{\theta_1}\sin{\theta_2}+r_1r_2\dot{\theta}_2\cos{\theta_1}\cos{\theta_2}\right] \\ &= -(b_1+c_1|\vec{v}_1|)\left[r_1\dot{r}_1(-\cos{\theta_1}\sin{\theta_1}+\sin{\theta_1}\cos{\theta_1}) + r_1^2\dot{\theta}_1(\sin^2{\theta_1} +\cos^2{\theta_1})\right] - (b_2+c_2|\vec{v}_2|)\left[r_1\dot{r}_1(-\cos{\theta_1}\sin{\theta_1} + \cos{\theta_1}\sin{\theta_1}) +r_1^2\dot{\theta_1}(\sin^2{\theta_1}+\cos^2{\theta_1})\right.\\ &\left.+r_1\dot{r}_2(-\sin{\theta_1}\cos{\theta_2}+\cos{\theta_1}\sin{\theta_2})+r_1r_2\dot{\theta}_2(\sin{\theta_1}\sin{\theta_2}+\cos{\theta_1}\cos{\theta_2})\right] \\ &= -(b_1+c_1|\vec{v}_1|)r_1^2\dot{\theta}_1 - (b_2+c_2|\vec{v}_2|)\left[ r_1^2\dot{\theta_1}+r_1\dot{r}_2\sin{(\theta_2-\theta_1)}+r_1r_2\dot{\theta}_2\cos{(\theta_2-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 2 ] ⋅ r 1 [ − sin θ 1 cos θ 1 ] = − ( b 1 + c 1 ∣ v 1 ∣ ) [ − r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ ˙ 1 sin 2 θ 1 + r 1 r ˙ 1 sin θ 1 cos θ 1 + r 1 2 θ ˙ 1 cos 2 θ 1 ] − ( b 2 + c 2 ∣ v 2 ∣ ) [ − r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ 1 ˙ sin 2 θ 1 − r 1 r ˙ 2 sin θ 1 cos θ 2 + r 1 r 2 θ ˙ 2 sin θ 1 sin θ 2 + r 1 r ˙ 1 cos θ 1 sin θ 1 + r 1 2 θ ˙ 1 cos 2 θ 1 + r 1 r ˙ 2 cos θ 1 sin θ 2 + r 1 r 2 θ ˙ 2 cos θ 1 cos θ 2 ] = − ( b 1 + c 1 ∣ v 1 ∣ ) [ r 1 r ˙ 1 ( − cos θ 1 sin θ 1 + sin θ 1 cos θ 1 ) + r 1 2 θ ˙ 1 ( sin 2 θ 1 + cos 2 θ 1 ) ] − ( b 2 + c 2 ∣ v 2 ∣ ) [ r 1 r ˙ 1 ( − cos θ 1 sin θ 1 + cos θ 1 sin θ 1 ) + r 1 2 θ 1 ˙ ( sin 2 θ 1 + cos 2 θ 1 ) + r 1 r ˙ 2 ( − sin θ 1 cos θ 2 + cos θ 1 sin θ 2 ) + r 1 r 2 θ ˙ 2 ( sin θ 1 sin θ 2 + cos θ 1 cos θ 2 ) ] = − ( b 1 + c 1 ∣ v 1 ∣ ) r 1 2 θ ˙ 1 − ( b 2 + c 2 ∣ v 2 ∣ ) [ r 1 2 θ 1 ˙ + r 1 r ˙ 2 sin ( θ 2 − θ 1 ) + r 1 r 2 θ ˙ 2 cos ( θ 2 − θ 1 ) ] Hence Equation (1 ) is
( m 1 + m 2 ) [ r 1 2 θ ¨ 1 + 2 r 1 r ˙ 1 θ ˙ 1 + g r 1 cos θ 1 ] + m 2 [ cos Δ ( 2 r 1 r ˙ 2 θ ˙ 2 + r 1 r 2 θ ¨ 2 ) + sin Δ ( r 1 r ¨ 2 − r 1 r 2 θ ˙ 2 2 ) ] = Q θ 1 . \begin{aligned} (m_1+m_2)\left[r_1^2\ddot{\theta}_1 + 2r_1\dot{r}_1\dot{\theta}_1 + gr_1\cos{\theta}_1\right] + m_2\left[\cos{\Delta}(2r_1\dot{r}_2\dot{\theta}_2+r_1r_2\ddot{\theta}_2) +\sin{\Delta}(r_1\ddot{r}_2-r_1r_2\dot{\theta}_2^2)\right] &= Q_{\theta_1}. \end{aligned} ( m 1 + m 2 ) [ r 1 2 θ ¨ 1 + 2 r 1 r ˙ 1 θ ˙ 1 + g r 1 cos θ 1 ] + m 2 [ cos Δ ( 2 r 1 r ˙ 2 θ ˙ 2 + r 1 r 2 θ ¨ 2 ) + sin Δ ( r 1 r ¨ 2 − r 1 r 2 θ ˙ 2 2 ) ] = Q θ 1 . Dividing by ( m 1 + m 2 ) r 1 2 (m_1+m_2)r_1^2 ( m 1 + m 2 ) r 1 2 yields
θ ¨ 1 + 2 r ˙ 1 θ ˙ 1 r 1 + g cos θ 1 r 1 + m 2 ( m 1 + m 2 ) r 1 [ cos Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) + sin Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) ] = Q θ 1 ( m 1 + m 2 ) r 1 2 . \begin{aligned} \ddot{\theta}_1 + \dfrac{2\dot{r}_1\dot{\theta}_1}{r_1} + \dfrac{g\cos{\theta_1}}{r_1} + \dfrac{m_2}{(m_1+m_2)r_1}\left[\cos{\Delta}(2\dot{r}_2\dot{\theta}_2+r_2\ddot{\theta}_2) +\sin{\Delta}(\ddot{r}_2-r_2\dot{\theta}_2^2)\right] &= \dfrac{Q_{\theta_1}}{(m_1+m_2)r_1^2}. \end{aligned} θ ¨ 1 + r 1 2 r ˙ 1 θ ˙ 1 + r 1 g cos θ 1 + ( m 1 + m 2 ) r 1 m 2 [ cos Δ ( 2 r ˙ 2 θ ˙ 2 + r 2 θ ¨ 2 ) + sin Δ ( r ¨ 2 − r 2 θ ˙ 2 2 ) ] = ( m 1 + m 2 ) r 1 2 Q θ 1 . Expanding out all second time derivatives and moving all other terms to the right-hand side yields
0 r ¨ 1 + m 2 sin Δ ( m 1 + m 2 ) r 1 r ¨ 2 + θ ¨ 1 + m 2 r 2 cos Δ ( m 1 + m 2 ) r 1 θ ¨ 2 = − 2 r ˙ 1 θ ˙ 1 r 1 − g cos θ 1 r 1 − m 2 ( m 1 + m 2 ) r 1 [ 2 r ˙ 2 θ ˙ 2 cos Δ − r 2 θ ˙ 2 2 sin Δ ] + Q θ 1 ( m 1 + m 2 ) r 1 2 . \begin{aligned} 0\ddot{r}_1 + \dfrac{m_2\sin{\Delta}}{(m_1+m_2)r_1}\ddot{r}_2 + \ddot{\theta}_1 + \dfrac{m_2r_2\cos{\Delta}}{(m_1+m_2)r_1}\ddot{\theta}_2 &= -\dfrac{2\dot{r}_1\dot{\theta}_1}{r_1} - \dfrac{g\cos{\theta_1}}{r_1} - \dfrac{m_2}{(m_1+m_2)r_1}\left[2\dot{r}_2\dot{\theta}_2\cos{\Delta} -r_2\dot{\theta}_2^2\sin{\Delta}\right] + \dfrac{Q_{\theta_1}}{(m_1+m_2)r_1^2}. \end{aligned} 0 r ¨ 1 + ( m 1 + m 2 ) r 1 m 2 sin Δ r ¨ 2 + θ ¨ 1 + ( m 1 + m 2 ) r 1 m 2 r 2 cos Δ θ ¨ 2 = − r 1 2 r ˙ 1 θ ˙ 1 − r 1 g cos θ 1 − ( m 1 + m 2 ) r 1 m 2 [ 2 r ˙ 2 θ ˙ 2 cos Δ − r 2 θ ˙ 2 2 sin Δ ] + ( m 1 + m 2 ) r 1 2 Q θ 1 . As for θ 2 \theta_2 θ 2
δ ′ L δ ′ θ 2 = ( m 1 + m 2 ) [ δ ′ ∣ v ⃗ 1 ∣ 2 δ ′ θ 2 2 ] + m 2 [ δ ′ ∣ Δ v ⃗ 21 ∣ 2 δ ′ θ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 ) [ r ˙ 1 r 2 ( − cos θ 1 sin θ 2 + sin θ 1 cos θ 2 ) + r 1 r 2 θ ˙ 1 ( sin θ 1 sin θ 2 + cos θ 1 cos θ 2 ) + r 2 r ˙ 2 ( − cos θ 2 sin θ 2 + sin θ 2 cos θ 2 ) + r 2 2 θ ˙ 2 ( sin 2 θ 2 + cos 2 θ 2 ) ] = − ( b 2 + c 2 ∣ v ⃗ 2 ∣ ) [ r 2 2 θ ˙ 2 − r ˙ 1 r 2 sin ( θ 2 − θ 1 ) + r 1 r 2 θ ˙ 1 cos ( θ 2 − θ 1 ) ] . \begin{aligned} \dfrac{\delta' \mathcal{L}}{\delta' \theta_2} &= (m_1+m_2)\left[\dfrac{\dfrac{\delta' |\vec{v}_1|^2}{\delta' \theta_2}}{2}\right] + m_2\left[\dfrac{\dfrac{\delta' |\Delta \vec{v}_{21}|^2}{\delta' \theta_2}}{2} - gr_2\dfrac{\delta' \sin{\theta_2}}{\delta' \theta_2}\right] \\ &= (m_1+m_2)\left[\dfrac{0}{2}\right]+m_2\left[\dfrac{4r_2\dot{r}_2\dot{\theta}_2 + 2r_2^2\ddot{\theta}_2 +2\cos{\Delta}(2\dot{r}_1r_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)+2\sin{\Delta}(r_1r_2\dot{\theta}_1^2-\ddot{r}_1r_2)}{2} + gr_2\cos{\theta_2}\right]\\ &= m_2\left[2r_2\dot{r}_2\dot{\theta}_2 + r_2^2\ddot{\theta}_2 +\cos{\Delta}(2\dot{r}_1r_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)+\sin{\Delta}(r_1r_2\dot{\theta}_1^2-\ddot{r}_1r_2) + gr_2\cos{\theta_2}\right]\\ Q_{\theta_2} &= -(b_1+c_1|\vec{v}_1|)\vec{v}_1 \cdot \dfrac{\partial \vec{r}_1}{\partial \theta_2} - (b_2+c_2|\vec{v}_2|)\vec{v}_2\cdot \dfrac{\partial \vec{r}_2}{\partial \theta_2} \\ &= -(b_2+c_2|\vec{v}_2|)\begin{bmatrix} \dot{r}_1 \cos{\theta_1} - r_1 \dot{\theta}_1 \sin{\theta_1} + \dot{r}_2\cos{\theta_2} - r_2\dot{\theta}_2 \sin{\theta_2} \\ \dot{r}_1\sin{\theta_1} + r_1\dot{\theta}_1 \cos{\theta_1} + \dot{r}_2\sin{\theta_2} + r_2\dot{\theta}_2 \cos{\theta_2} \end{bmatrix} \cdot r_2\begin{bmatrix} -\sin{\theta_2}\\ \cos{\theta_2} \end{bmatrix} \\ &= -(b_2+c_2|\vec{v}_2|)\left[-\dot{r}_1r_2\cos{\theta}_1\sin{\theta_2} + r_1r_2\dot{\theta}_1\sin{\theta_1}\sin{\theta_2} - r_2\dot{r}_2\cos{\theta_2}\sin{\theta_2} + r_2^2\dot{\theta}_2\sin^2{\theta_2} + \dot{r}_1r_2\sin{\theta_1}\cos{\theta_2} + r_1r_2\dot{\theta}_1\cos{\theta_1}\cos{\theta_2} + r_2\dot{r}_2\sin{\theta_2}\cos{\theta_2} + r_2^2\dot{\theta}_2\cos^2{\theta_2}\right]\\ &= -(b_2+c_2|\vec{v}_2|)\left[\dot{r}_1r_2(-\cos{\theta}_1\sin{\theta_2} + \sin{\theta_1}\cos{\theta_2}) + r_1r_2\dot{\theta}_1(\sin{\theta_1}\sin{\theta_2}+\cos{\theta_1}\cos{\theta_2}) + r_2\dot{r}_2(-\cos{\theta_2}\sin{\theta_2} + \sin{\theta_2}\cos{\theta_2}) + r_2^2\dot{\theta}_2(\sin^2{\theta_2} +\cos^2{\theta_2})\right]\\ &= -(b_2+c_2|\vec{v}_2|)\left[ r_2^2\dot{\theta}_2-\dot{r}_1r_2\sin{(\theta_2-\theta_1)} + r_1r_2\dot{\theta}_1\cos{(\theta_2-\theta_1)}\right]. \end{aligned} δ ′ θ 2 δ ′ L Q θ 2 = ( m 1 + m 2 ) ⎣ ⎢ ⎢ ⎢ ⎡ 2 δ ′ θ 2 δ ′ ∣ v 1 ∣ 2 ⎦ ⎥ ⎥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˙ 2 cos 2 θ 2 ] = − ( b 2 + c 2 ∣ v 2 ∣ ) [ r ˙ 1 r 2 ( − cos θ 1 sin θ 2 + sin θ 1 cos θ 2 ) + r 1 r 2 θ ˙ 1 ( sin θ 1 sin θ 2 + cos θ 1 cos θ 2 ) + r 2 r ˙ 2 ( − cos θ 2 sin θ 2 + sin θ 2 cos θ 2 ) + r 2 2 θ ˙ 2 ( sin 2 θ 2 + cos 2 θ 2 ) ] = − ( b 2 + c 2 ∣ v 2 ∣ ) [ r 2 2 θ ˙ 2 − r ˙ 1 r 2 sin ( θ 2 − θ 1 ) + r 1 r 2 θ ˙ 1 cos ( θ 2 − θ 1 ) ] . Hence Equation (1 ) for θ 2 \theta_2 θ 2 is
m 2 [ 2 r 2 r ˙ 2 θ ˙ 2 + r 2 2 θ ¨ 2 + cos Δ ( 2 r ˙ 1 r 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) + sin Δ ( r 1 r 2 θ ˙ 1 2 − r ¨ 1 r 2 ) + g r 2 cos θ 2 ] = Q θ 2 . \begin{aligned} m_2\left[2r_2\dot{r}_2\dot{\theta}_2 + r_2^2\ddot{\theta}_2 +\cos{\Delta}(2\dot{r}_1r_2\dot{\theta}_1+r_1r_2\ddot{\theta}_1)+\sin{\Delta}(r_1r_2\dot{\theta}_1^2-\ddot{r}_1r_2) + gr_2\cos{\theta_2}\right] &= Q_{\theta_2}. \end{aligned} m 2 [ 2 r 2 r ˙ 2 θ ˙ 2 + r 2 2 θ ¨ 2 + cos Δ ( 2 r ˙ 1 r 2 θ ˙ 1 + r 1 r 2 θ ¨ 1 ) + sin Δ ( r 1 r 2 θ ˙ 1 2 − r ¨ 1 r 2 ) + g r 2 cos θ 2 ] = Q θ 2 . Dividing by m 2 r 2 2 m_2r_2^2 m 2 r 2 2 yields
θ ¨ 2 + 2 r ˙ 2 θ ˙ 2 r 2 + cos Δ r 2 ( 2 r ˙ 1 θ ˙ 1 + r 1 θ ¨ 1 ) + sin Δ r 2 ( r 1 θ ˙ 1 2 − r ¨ 1 ) + g cos θ 2 r 2 = Q θ 2 m 2 r 2 2 . \begin{aligned} \ddot{\theta}_2 + \dfrac{2\dot{r}_2\dot{\theta}_2}{r_2} + \dfrac{\cos{\Delta}}{r_2} (2\dot{r}_1\dot{\theta}_1+r_1\ddot{\theta}_1)+\dfrac{\sin{\Delta}}{r_2}(r_1\dot{\theta}_1^2-\ddot{r}_1) + \dfrac{g\cos{\theta_2}}{r_2} &= \dfrac{Q_{\theta_2}}{m_2r_2^2}. \end{aligned} θ ¨ 2 + r 2 2 r ˙ 2 θ ˙ 2 + r 2 cos Δ ( 2 r ˙ 1 θ ˙ 1 + r 1 θ ¨ 1 ) + r 2 sin Δ ( r 1 θ ˙ 1 2 − r ¨ 1 ) + r 2 g cos θ 2 = m 2 r 2 2 Q θ 2 . Next we will expand out second time derivatives and moving everything else to the right-hand side
− sin Δ r 2 r ¨ 1 + 0 r ¨ 2 + r 1 cos Δ r 2 θ ¨ 1 + θ ¨ 2 = − 2 r ˙ 2 θ ˙ 2 r 2 − g cos θ 2 r 2 − 2 r ˙ 1 θ ˙ 1 cos Δ r 2 − r 1 θ ˙ 1 2 sin Δ r 2 + Q θ 2 m 2 r 2 2 . \begin{aligned} -\dfrac{\sin{\Delta}}{r_2}\ddot{r}_1 + 0\ddot{r}_2 + \dfrac{r_1\cos{\Delta}}{r_2}\ddot{\theta}_1 + \ddot{\theta}_2 &= -\dfrac{2\dot{r}_2\dot{\theta}_2}{r_2} - \dfrac{g\cos{\theta_2}}{r_2} - \dfrac{2\dot{r}_1\dot{\theta}_1\cos{\Delta}}{r_2}-\dfrac{r_1\dot{\theta}_1^2\sin{\Delta}}{r_2} + \dfrac{Q_{\theta_2}}{m_2r_2^2}. \end{aligned} − r 2 sin Δ r ¨ 1 + 0 r ¨ 2 + r 2 r 1 cos Δ θ ¨ 1 + θ ¨ 2 = − r 2 2 r ˙ 2 θ ˙ 2 − r 2 g cos θ 2 − r 2 2 r ˙ 1 θ ˙ 1 cos Δ − r 2 r 1 θ ˙ 1 2 sin Δ + m 2 r 2 2 Q θ 2 . There are three ways we could solve this problem; each of which involves numerical integration to obtain the final solution. Firstly, we could algebraically manipulate this ordinary differential equation (ODE) system until only one second time derivative appears in each equation. The final ODE system after this manipulation could, in turn, be numerically integrated using any standard scheme (e.g. the Runge-Kutta-Fehlberg method). Secondly, we could numerically integrate it as is using a differential-algebraic equation (DAE) solver, but these tend to be more prone to give convergence errors in my experience. Finally, we could convert the system to matrix form and invert it to obtain numerical approximations of each of our second time derivatives and use these to numerically integrate the system with a standard ODE solver. We will opt for this last method, as the first approach is almost guaranteed to introduce errors and the second gives convergence errors, at least in Julia.
Essentially, we will write our differential equation system as
A q ¨ = b . \begin{aligned} \mathbf{A}\mathbf{\ddot{q}} &= \mathbf{b}. \end{aligned} A q ¨ = b . where q ¨ \mathbf{\ddot{q}} q ¨ is a vector containing the second time derivatives of our generalized coordinates. Hence q ¨ = A − 1 b \mathbf{\ddot{q}}=\mathbf{A}^{-1} \mathbf{b} q ¨ = A − 1 b . Or, in full form, this above equation is
[ 1 m 2 cos Δ m 1 + m 2 0 − m 2 r 2 sin Δ m 1 + m 2 cos Δ 1 r 1 sin Δ 0 0 m 2 sin Δ ( m 1 + m 2 ) r 1 1 m 2 r 2 cos Δ ( m 1 + m 2 ) r 1 − sin Δ r 2 0 r 1 cos Δ r 2 1 ] [ r ¨ 1 r ¨ 2 θ ¨ 1 θ ¨ 2 ] = [ r 1 θ ˙ 1 2 − g sin θ 1 + m 2 m 1 + m 2 ( r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ) + Q r 1 − k 1 ( r 1 − l 1 ) m 1 + m 2 r 2 θ ˙ 2 2 − g sin θ 2 + r 1 θ ˙ 1 2 cos Δ − 2 r ˙ 1 θ ˙ 1 sin Δ + Q r 2 − k 2 ( r 2 − l 2 ) m 2 − 2 r ˙ 1 θ ˙ 1 r 1 − g cos θ 1 r 1 − m 2 ( m 1 + m 2 ) r 1 [ 2 r ˙ 2 θ ˙ 2 cos Δ − r 2 θ ˙ 2 2 sin Δ ] + Q θ 1 ( m 1 + m 2 ) r 1 2 − 2 r ˙ 2 θ ˙ 2 r 2 − g cos θ 2 r 2 − 2 r ˙ 1 θ ˙ 1 cos Δ r 2 − r 1 θ ˙ 1 2 sin Δ r 2 + Q θ 2 m 2 r 2 2 ] . \begin{aligned} \begin{bmatrix} 1 & \dfrac{m_2\cos{\Delta}}{m_1+m_2} & 0 & -\dfrac{m_2r_2\sin{\Delta}}{m_1+m_2} \\ \cos{\Delta} & 1 & r_1\sin{\Delta} & 0 \\ 0 & \dfrac{m_2\sin{\Delta}}{(m_1+m_2)r_1} & 1 & \dfrac{m_2r_2\cos{\Delta}}{(m_1+m_2)r_1} \\ -\dfrac{\sin{\Delta}}{r_2} & 0 & \dfrac{r_1\cos{\Delta}}{r_2} & 1 \end{bmatrix} \begin{bmatrix} \ddot{r}_1 \\ \ddot{r}_2 \\ \ddot{\theta}_1 \\ \ddot{\theta}_2 \end{bmatrix} &= \begin{bmatrix} r_1\dot{\theta}_1^2-g\sin{\theta_1} + \dfrac{m_2}{m_1+m_2}\left(r_2\dot{\theta}_2^2\cos{\Delta} + 2\dot{r}_2\dot{\theta}_2\sin{\Delta}\right) + \dfrac{Q_{r_1}-k_1(r_1-l_1)}{m_1+m_2}\\ r_2\dot{\theta}_2^2-g\sin{\theta_2} + r_1\dot{\theta}_1^2\cos{\Delta} - 2\dot{r}_1\dot{\theta}_1\sin{\Delta} + \dfrac{Q_{r_2}-k_2(r_2-l_2)}{m_2} \\ -\dfrac{2\dot{r}_1\dot{\theta}_1}{r_1} - \dfrac{g\cos{\theta_1}}{r_1} - \dfrac{m_2}{(m_1+m_2)r_1}\left[2\dot{r}_2\dot{\theta}_2\cos{\Delta} -r_2\dot{\theta}_2^2\sin{\Delta}\right] + \dfrac{Q_{\theta_1}}{(m_1+m_2)r_1^2} \\ -\dfrac{2\dot{r}_2\dot{\the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Q θ 2 ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎤ . So the solution is
[ r ¨ 1 r ¨ 2 θ ¨ 1 θ ¨ 2 ] = [ 1 m 2 cos Δ m 1 + m 2 0 − m 2 r 2 sin Δ m 1 + m 2 cos Δ 1 r 1 sin Δ 0 0 m 2 sin Δ ( m 1 + m 2 ) r 1 1 m 2 r 2 cos Δ ( m 1 + m 2 ) r 1 − sin Δ r 2 0 r 1 cos Δ r 2 1 ] − 1 [ r 1 θ ˙ 1 2 − g sin θ 1 + m 2 m 1 + m 2 ( r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ) + Q r 1 − k 1 ( r 1 − l 1 ) m 1 + m 2 r 2 θ ˙ 2 2 − g sin θ 2 + r 1 θ ˙ 1 2 cos Δ − 2 r ˙ 1 θ ˙ 1 sin Δ + Q r 2 − k 2 ( r 2 − l 2 ) m 2 − 2 r ˙ 1 θ ˙ 1 r 1 − g cos θ 1 r 1 − m 2 ( m 1 + m 2 ) r 1 [ 2 r ˙ 2 θ ˙ 2 cos Δ − r 2 θ ˙ 2 2 sin Δ ] + Q θ 1 ( m 1 + m 2 ) r 1 2 − 2 r ˙ 2 θ ˙ 2 r 2 − g cos θ 2 r 2 − 2 r ˙ 1 θ ˙ 1 cos Δ r 2 − r 1 θ ˙ 1 2 sin Δ r 2 + Q θ 2 m 2 r 2 2 ] . \begin{aligned} \begin{bmatrix} \ddot{r}_1 \\ \ddot{r}_2 \\ \ddot{\theta}_1 \\ \ddot{\theta}_2 \end{bmatrix} &= \begin{bmatrix} 1 & \dfrac{m_2\cos{\Delta}}{m_1+m_2} & 0 & -\dfrac{m_2r_2\sin{\Delta}}{m_1+m_2} \\ \cos{\Delta} & 1 & r_1\sin{\Delta} & 0 \\ 0 & \dfrac{m_2\sin{\Delta}}{(m_1+m_2)r_1} & 1 & \dfrac{m_2r_2\cos{\Delta}}{(m_1+m_2)r_1} \\ -\dfrac{\sin{\Delta}}{r_2} & 0 & \dfrac{r_1\cos{\Delta}}{r_2} & 1 \end{bmatrix}^{-1} \begin{bmatrix} r_1\dot{\theta}_1^2-g\sin{\theta_1} + \dfrac{m_2}{m_1+m_2}\left(r_2\dot{\theta}_2^2\cos{\Delta} + 2\dot{r}_2\dot{\theta}_2\sin{\Delta}\right) + \dfrac{Q_{r_1}-k_1(r_1-l_1)}{m_1+m_2}\\ r_2\dot{\theta}_2^2-g\sin{\theta_2} + r_1\dot{\theta}_1^2\cos{\Delta} - 2\dot{r}_1\dot{\theta}_1\sin{\Delta} + \dfrac{Q_{r_2}-k_2(r_2-l_2)}{m_2} \\ -\dfrac{2\dot{r}_1\dot{\theta}_1}{r_1} - \dfrac{g\cos{\theta_1}}{r_1} - \dfrac{m_2}{(m_1+m_2)r_1}\left[2\dot{r}_2\dot{\theta}_2\cos{\Delta} -r_2\dot{\theta}_2^2\sin{\Delta}\right] + \dfrac{Q_{\theta_1}}{(m_1+m_2)r_1^2} \\ -\dfrac{2\dot{r}_2\dot{\theta}_2}{r_2}- \dfrac{g\cos{\theta_2}}{r_2} - \dfrac{2\dot{r}_1\dot{\theta}_1\cos{\Delta}}{r_2} - \dfrac{r_1\dot{\theta}_1^2\sin{\Delta}}{r_2} + \dfrac{Q_{\theta_2}}{m_2r_2^2} \end{bmatrix}. \end{aligned} ⎣ ⎢ ⎢ ⎢ ⎡ r ¨ 1 r ¨ 2 θ ¨ 1 θ ¨ 2 ⎦ ⎥ ⎥ ⎥ ⎤ = ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎡ 1 cos Δ 0 − r 2 sin Δ m 1 + m 2 m 2 cos Δ 1 ( m 1 + m 2 ) r 1 m 2 sin Δ 0 0 r 1 sin Δ 1 r 2 r 1 cos Δ − m 1 + m 2 m 2 r 2 sin Δ 0 ( m 1 + m 2 ) r 1 m 2 r 2 cos Δ 1 ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎤ − 1 ⎣ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎢ ⎡ r 1 θ ˙ 1 2 − g sin θ 1 + m 1 + m 2 m 2 ( r 2 θ ˙ 2 2 cos Δ + 2 r ˙ 2 θ ˙ 2 sin Δ ) + m 1 + m 2 Q r 1 − k 1 ( r 1 − l 1 ) r 2 θ ˙ 2 2 − g sin θ 2 + r 1 θ ˙ 1 2 cos Δ − 2 r ˙ 1 θ ˙ 1 sin Δ + m 2 Q r 2 − k 2 ( r 2 − l 2 ) − r 1 2 r ˙ 1 θ ˙ 1 − r 1 g cos θ 1 − ( m 1 + m 2 ) r 1 m 2 [ 2 r ˙ 2 θ ˙ 2 cos Δ − r 2 θ ˙ 2 2 sin Δ ] + ( m 1 + m 2 ) r 1 2 Q θ 1 − r 2 2 r ˙ 2 θ ˙ 2 − r 2 g cos θ 2 − r 2 2 r ˙ 1 θ ˙ 1 cos Δ − r 2 r 1 θ ˙ 1 2 sin Δ + m 2 r 2 2 Q θ 2 ⎦ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎥ ⎤ . Ordinarily, I would use a symplectic method to integrate a classical mechanical system, as it minimizes cumulative errors in the Hamiltonian over long-term integration. That being said, symplectic methods typically are either implicit (which significantly increases their computational complexity) or require a separable Hamiltonian. The Hamiltonian of this system would not separable as the kinetic energy cannot be written entirely in terms of momenta. Additionally, rewriting the kinetic energy in terms of the momenta would be tedious and prone to error.