The Double Pendulum
Main Concept
In this Math App we explore the motion of the double pendulum in a constant gravitational field. It is a rather simple physical model, but nevertheless has a rich dynamics as it undergoes chaotic motion.
Fig. 1 Setup of the double pendulum The double pendulum consists of two single pendula, with one being attached at the end of the other. We consider idealized simple pendula, i.e. all their mass is concentrated at the end point of each cord and they move without any friction. The lengths of the pendula are denoted by l__1 and l__2, their masses by m__1 and m__2, respectively. Furthermore, we measure the displacement of each mass via the two angles ϑ__1 and ϑ__2 as indicated in the plot.
The dynamics of the double pendulum can be studied via the Euler-Lagrange equations. We implement and solve these in the next section using Maple procedures. In the subsequent section we discuss some properties of this solution.
Implementation in Maple
Below, we implement the problem of the double pendulum into Maple and solve its dynamics. We start by defining the positions of the masses using the notation in Fig. 1.
x1≔l__1 sinϑ__1;x2≔x1+l__2 sinϑ__2;y1≔− l__1cosϑ__1;y2≔y1−l__2 cosϑ__2
x1≔l__1⁢sin⁡ϑ__1
x2≔l__1⁢sin⁡ϑ__1+l__2⁢sin⁡ϑ__2
y1≔−l__1⁢cos⁡ϑ__1
y2≔−l__1⁢cos⁡ϑ__1−l__2⁢cos⁡ϑ__2
The x- and y-coordinates of the two masses depend on the time, t via the time dependence of the angles. Now we can define the kinetic and potential energy as follows:
T≔i→12mi⋅∂∂txi2+∂∂t yi2:
T1; T2;
m1⁢∂∂tl__1⁢sin⁡ϑ__12+∂∂t−l__1⁢cos⁡ϑ__122
m2⁢∂∂tl__1⁢sin⁡ϑ__1+l__2⁢sin⁡ϑ__22+∂∂t−l__1⁢cos⁡ϑ__1−l__2⁢cos⁡ϑ__222
V≔i→mi⋅g⋅yi:
V1; V2;
−m1⁢g⁢l__1⁢cos⁡ϑ__1
m2⁢g⁢−l__1⁢cos⁡ϑ__1−l__2⁢cos⁡ϑ__2
Thus the Lagrange function is given via (1.2) and (1.3) as:
Lagrange≔T1+T2−V1−V2:
S__1≔ϑ__1t=ϑ__1.t,ϑ__1=ϑ__1t,ϑ__2t= ϑ__2.t,ϑ__2=ϑ__2t;S__2≔maprhs=lhs,S__1
S__1≔ϑ__1t=ⅆⅆtϑ__1⁡t,ϑ__1=ϑ__1⁡t,ϑ__2t=ⅆⅆtϑ__2⁡t,ϑ__2=ϑ__2⁡t
S__2≔ⅆⅆtϑ__1⁡t=ϑ__1t,ϑ__1⁡t=ϑ__1,ⅆⅆtϑ__2⁡t=ϑ__2t,ϑ__2⁡t=ϑ__2
L≔subsS__2, simplifycombinevaluesubsS__1, Lagrange
L≔cos⁡ϑ__1−ϑ__2⁢ϑ__1t⁢ϑ__2t⁢l__1⁢l__2⁢m2+l__12⁢m1+m2⁢ϑ__1t22+ϑ__2t2⁢l__22⁢m22+l__1⁢m1+m2⁢cos⁡ϑ__1+l__2⁢cos⁡ϑ__2⁢m2⁢g
where in the second step we inserted relations (1.1), used trigonometric relations and simplified via combine and simplify. The equations of motion of the two masses can then be obtained via the Euler-Lagrange equations:
ⅆⅆt∂ L∂ϑ__i.−∂ L∂ ϑ__i=0
for i=1,2 as:
ⅆⅆ tsubsS__1,∂ ∂ ϑ__1tL−subsS__1,∂ ∂ ϑ__1L
−ⅆⅆtϑ__1⁡t−ⅆⅆtϑ__2⁡t⁢sin⁡ϑ__1⁡t−ϑ__2⁡t⁢ⅆⅆtϑ__2⁡t⁢l__1⁢l__2⁢m2+cos⁡ϑ__1⁡t−ϑ__2⁡t⁢ⅆ2ⅆt2ϑ__2⁡t⁢l__1⁢l__2⁢m2+l__12⁢m1+m2⁢ⅆ2ⅆt2ϑ__1⁡t+sin⁡ϑ__1⁡t−ϑ__2⁡t⁢ⅆⅆtϑ__1⁡t⁢ⅆⅆtϑ__2⁡t⁢l__1⁢l__2⁢m2+l__1⁢m1+m2⁢sin⁡ϑ__1⁡t⁢g
EL__1≔simplify=0
EL__1≔ⅆ2ⅆt2ϑ__2⁡t⁢l__2⁢m2⁢cos⁡ϑ__1⁡t−ϑ__2⁡t+ⅆⅆtϑ__2⁡t2⁢l__2⁢m2⁢sin⁡ϑ__1⁡t−ϑ__2⁡t+m1+m2⁢g⁢sin⁡ϑ__1⁡t+l__1⁢ⅆ2ⅆt2ϑ__1⁡t⁢l__1=0
ⅆⅆ tsubsS__1,∂∂ ϑ__2tL−subsS__1,∂∂ ϑ__2L
l__2⁢ⅆ2ⅆt2ϑ__1⁡t⁢cos⁡ϑ__1⁡t−ϑ__2⁡t⁢m2⁢l__1−l__2⁢ⅆⅆtϑ__1⁡t⁢ⅆⅆtϑ__1⁡t−ⅆⅆtϑ__2⁡t⁢sin⁡ϑ__1⁡t−ϑ__2⁡t⁢m2⁢l__1+ⅆ2ⅆt2ϑ__2⁡t⁢l__22⁢m2−sin⁡ϑ__1⁡t−ϑ__2⁡t⁢ⅆⅆtϑ__1⁡t⁢ⅆⅆtϑ__2⁡t⁢l__1⁢l__2⁢m2+l__2⁢sin⁡ϑ__2⁡t⁢m2⁢g
EL__2≔simplify=0
EL__2≔l__2⁢m2⁢−ⅆⅆtϑ__1⁡t2⁢l__1⁢sin⁡ϑ__1⁡t−ϑ__2⁡t+ⅆ2ⅆt2ϑ__1⁡t⁢l__1⁢cos⁡ϑ__1⁡t−ϑ__2⁡t+ⅆ2ⅆt2ϑ__2⁡t⁢l__2+sin⁡ϑ__2⁡t⁢g=0
The resulting equations EL__1 and EL__2 govern the dynamics of the two masses. They cannot be solved exactly, but we may try solving them numerically using dsolve. To do so, we set the constants to the following values in SI-units (g is given in m s−2 , the lengths l__i in m and the masses: m__i in kg)
g≔9.81: l__1≔5: l__2≔3: m1≔4: m2≔1:
Furthermore, we set the following initial conditions for the angles and their time derivatives:
initial≔ϑ__10=π7,Dϑ__10=π2,ϑ__20=π4, Dϑ__20=−π3:
with the derivatives given in s−1. Now we can solve the equations of motion (1.7) and (1.9) via
sol≔dsolveEL__1,EL__2, initial, numeric, output=listprocedure:
The procedures for the two angles ϑ__1 and ϑ__2 obtained from this solution:
ϑ__1≔evalϑ__1t, sol; ϑ__2≔eval ϑ__2t, sol
ϑ__1≔proct...end proc
ϑ__2≔proct...end proc
determine the dynamics of the system. In the following section we explore this solution a bit.
Chaotic Motion
The following plot visualizes the procedures obtained above in the time interval 0..25 s.
Fig. 2 Visualization of the solution for ϑ__1 and ϑ__2 Note that the solution for the angles in this interval evolves chaotically, i.e. it does not exhibit any periodicity. Furthermore, note that the values of ϑ__2 are not constrained to the interval −π≤ϑ__2≤π. Whenever the line crosses a gridline, the pendulum flips over.
The dynamics of the double pendulum is chaotic, i.e. it is highly sensitive to the initial conditions initial. The following plot contains the trajectory and the angles of the mass m__2 for slightly different initial conditions.
Fig. 3 Chaotic motion
The three plots show the motion of the double pendulum as parameterized in the previous section. They only differ in the initial condition for the first mass's initial position:
Plot 1: ϑ__10=0.9⋅π7
Plot 2: ϑ__10=1.0⋅π7 Plot 3: ϑ__10=1.1⋅π7
While under the first condition, m__2 flips over five times, in the second plot it only does so twice and in the third plot four times within the first 25 seconds. Thus, a small change in the initial state can result in large differences in the later behavior of the system.
In the following you can explore the motion of the double pendulum. Using the radio buttons, you can choose the strength of the gravitational field. Furthermore, you can adjust the lengths and masses of the two individual pendula using the sliders. The higher the mass, the bigger the circle representing the mass. The initial position of the pendula can be changed by dragging and dropping the masses directly in the plot. Their initial velocities can be adjusted using the sliders; by selecting Show arrows the animation shows the velocities of the masses relative to their pivot points. Furthermore, you may choose the animation duration. You can also plot the animation alongside the trajectory of m__2 by selecting Show trajectory. After you have adjusted the settings, click Animate and wait for the Play button to appear.
Try to answer the following questions: 1) How does the gravitational field influence the motion of the pendulum? What happens as you turn off gravity (g=0)? Is the motion still chaotic?
2) How do the lengths of the individual pendula influence the motion of the double pendulum? What do you observe for l__2≪l__1 and l__1≪l__2? 3) How do the masses influence the motion of the pendulum? What do you observe in the case m__1≫m__2? What happens when you change the masses of the pendula in the case l__2≪l__1 and l__1≪l__2? 4) Investigate the motion of the pendulum for different initial states. Confirm that slight changes in the initial state can lead to very different behaviors at later times.
gravitational field:
g=24.79 m s−2
g=9.81 m s−2
g=1.62 m s−2
g=0
lengths: l__1 cm: l__2 cm: masses: m__1 g: m__2 g: initial velocities:
ϑ.__10 π s−1 : ϑ.__20 π s−1 :
Drag and drop the two masses into position directly in the plot.
Note: The calculation of the animation delays the appearance
of the Play button. Depending on the chosen animation
duration and whether "Show arrows" or "Show trajectory" is checked, you may have to wait a few seconds.
animation duration t s:
Download Help Document