I am trying to derive the equations of motion for the double pendulum and then solve and plot it. Unfortunately, it does not work. Any suggestions?
Remove[l1, l2, m1, m2, g]
x1 = l1*Sin[\[Theta]1[t]];
x1' = D[x1, t];
y1 = -l1*Cos[\[Theta]1[t]];
y1' = D[y1, t];
x2 = l2*Sin[\[Theta]2[t]] + x1;
x2' = D[x2, t];
y2 = -l2*Cos[\[Theta]2[t]] + y1;
y2' = D[y2, t];
V = m1*g*y1 + m2*g*y2;
T = m1/2*(x1' + y1')^2 + m2*(x2' + y2')^2;
Lagrange = T - V;
eqs = D[D[Lagrange, \[Theta]'], t] - D[Lagrange, \[Theta]];
sol = NDSolve[{eqs == 0, \[Theta]1[0] = Pi, \[Theta]2[0] =
Pi, \[Theta]1'[0] = 0, \[Theta]2'[0] =
0}, {\[Theta]1, \[Theta]2}, {t, 0, 10}];
l1 = 1;
l2 = 1;
g = 9.81;
m1 = 1;
m2 = 1;
Plot[{\[Theta]1, \[Theta]2}, {t, 0, 10}]