Message Boards Message Boards

GROUPS:

[GIF] Chaos and the Double Pendulum

Posted 2 years ago
4751 Views
|
2 Replies
|
14 Total Likes
|

enter image description here

A chaotic system is one in which infinitesimal differences in the starting conditions lead to drastically different results as the system evolves.

Summarized by mathematician Edward Lorenz, "Chaos [is] when the present determines the future, but the approximate present does not approximately determine the future.“

There’s an important distinction to make between a chaotic system and a random system. Given the starting conditions, a chaotic system is entirely deterministic. A random system, on the other hand, is entirely non-deterministic, even when the starting conditions are known. That is, with enough information, the evolution of a chaotic system is entirely predictable, but in a random system there’s no amount of information that would be enough to predict the system’s evolution.

The simulations above show two slightly different initial conditions for a double pendulum — an example of a chaotic system. In the left animation both pendulums begin horizontally, and in the right animation the red pendulum begins horizontally and the blue is rotated by 0.1 radians (≈ 5.73°) above the positive x-axis. In both simulations, all of the pendulums begin from rest.

For more information on how to solve for the motion of a double pendulum, check out my video and Wolfram Language code below.

Originally published on Fouriest Series

enter image description here

x1[t_] := R1*Sin[θ1[t]]
y1[t_] := (-R1)*Cos[θ1[t]]
x2[t_] := R1*Sin[θ1[t]] + R2*Sin[θ2[t]]
y2[t_] := (-R1)*Cos[θ1[t]] - R2*Cos[θ2[t]]
v1[t_] := Sqrt[D[x1[t], t]^2 + D[y1[t], t]^2]
v2[t_] := Sqrt[D[x2[t], t]^2 + D[y2[t], t]^2]

T1[t_] := (1/2)*m1*v1[t]^2
T2[t_] := (1/2)*m2*v2[t]^2
U[t_] := m1*g*y1[t] + m2*g*y2[t]
L[t_] := T1[t] + T2[t] - U[t]

Simplify[D[LB[t], θ1B[t]] == D[D[LB[t], Derivative[1][θ1B][t]], t]]; 
Simplify[D[LB[t], θ2B[t]] == D[D[LB[t], Derivative[1][θ2B][t]], t]]; 

θ10 = Pi/2; 
θ1d0 = 0; 
θ20 = Pi/2; 
θ2d0 = 0; 

g = 9.8; 
R1 = 0.7; 
R2 = 0.7; 
m1 = 1; 
m2 = 1; 

sols = 
  NDSolve[
   {R1*(g*m1*Sin[θ1[t]] + g*m2*Sin[θ1[t]] + 
     m2*R2*Sin[θ1[t] - θ2[t]]*Derivative[1][θ2][t]^2 + 
     (m1 + m2)*R1*Derivative[2][θ1][t] + 
     m2*R2*Cos[θ1[t] - θ2[t]]*Derivative[2][θ2][t]) == 0, 
    m2*R2*(g*Sin[θ2[t]] - R1*Sin[θ1[t] - 
      θ2[t]]*Derivative[1][θ1][t]^2 + R1*Cos[θ1[t] - 
      θ2[t]]*Derivative[2][θ1][t] + R2*Derivative[2][θ2][t]) == 0, 
    θ1[0] == θ10, 
    Derivative[1][θ1][0] == θ1d0, 
    θ2[0] == θ20, 
    Derivative[1][θ2][0] == θ2d0
   }, 
   {θ1, Derivative[1][θ1], Derivative[2][θ1], 
    θ2, Derivative[1][θ2], Derivative[2][θ2]
   }, 
   {t, 0, 490}, 
   MaxSteps -> 100000
  ]; 

θ1n[t_] := Evaluate[θ1[t] /. sols[[1,1]]]
θ2n[t_] := Evaluate[θ2[t] /. sols[[1,4]]]
θd1n[t_] := Evaluate[Derivative[1][θ1][t] /. sols[[1,1]]]
θd2n[t_] := Evaluate[Derivative[1][θ2][t] /. sols[[1,4]]]

x1n[t_] := R1*Sin[θ1n[t]]
y1n[t_] := (-R1)*Cos[θ1n[t]]
x2n[t_] := R1*Sin[θ1n[t]] + R2*Sin[θ2n[t]]
y2n[t_] := (-R1)*Cos[θ1n[t]] - R2*Cos[θ2n[t]]

Manipulate[
  Show[
    ParametricPlot[
      {{x1n[t], y1n[t]}, {x2n[t], y2n[t]}}, 
      {t, 0, tf}, 
      PlotStyle -> {{Red}, {Blue}}, 
      AspectRatio -> Automatic, 
      PlotRange -> {{-R1 - R2, R1 + R2}, {-R1 - R2, (R1 + R2)/3.5}}, 
      Axes -> True, 
      GridLines -> Automatic, GridLinesStyle -> Directive[LightGray]
    ], 
    Graphics[
      {
        {AbsoluteThickness[2], Red, Line[{{0, 0}, {x1n[tf], y1n[tf]}}]}, 
        {AbsoluteThickness[2], Blue, Line[{{x1n[tf], y1n[tf]}, {x2n[tf], y2n[tf]}}]}, 
        {PointSize[Large], Red, Point[{x1n[tf], y1n[tf]}]}, 
        {PointSize[Large], Blue, Point[{x2n[tf], y2n[tf]}]}
      }
    ]
  ], 
  {tf, 0.01, 14, 0.1}
]
2 Replies

Very nice! Just for the sake of completeness, here are a few other resources related to the double pendulum.

  1. Wolfram Language knows this system and its properties, for example:

    enter image description here

  2. You can ask Wolfram|Alpha and get complete equations of motion, plots, and even interactive interfaces!

  3. There is a complete example in docs.

    enter image description here

  4. There is an article in ScienceWorld. In contrast with Wikipedia, that considers joined rods system with distributed mass, the ScienceWorld shows equations for exactly your system of coupled masses:

    enter image description here

  5. There is a demonstration by Rob Morris: Double Pendulum

    enter image description here

enter image description here - another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the tops of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract