Group Abstract Group Abstract

Message Boards Message Boards

[?] Derive, solve and plot the equations of motion for the double pendulum?

Posted 8 years ago

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}]
POSTED BY: Jonas Hamp
3 Replies

I think your expression for the kinetic energy is incorrect.

POSTED BY: Frank Kampas
Posted 8 years ago

Thank you, I corrected it, but the output says:

NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {True,\[Pi],\[Pi],0,0}.
NDSolve::deqn: Equation or list of equations expected instead of True in the first argument {True,\[Pi],\[Pi],0,0}.
POSTED BY: Jonas Hamp
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard