The Double Pendulum - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Math Apps : Natural Sciences : Physics : MathApps/DoublePendulum

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.

x1l__1 sinϑ__1;x2x1+l__2 sinϑ__2;y1 l__1cosϑ__1;y2y1l__2 cosϑ__2

x1l__1sinϑ__1

x2l__1sinϑ__1+l__2sinϑ__2

y1l__1cosϑ__1

y2l__1cosϑ__1l__2cosϑ__2

(1.1)

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:

Ti12mitxi2+t yi2:

T1; T2;

m1tl__1sinϑ__12+tl__1cosϑ__122

m2tl__1sinϑ__1+l__2sinϑ__22+tl__1cosϑ__1l__2cosϑ__222

(1.2)

Vimigyi:

V1; V2;

m1gl__1cosϑ__1

m2gl__1cosϑ__1l__2cosϑ__2

(1.3)

Thus the Lagrange function is given via (1.2) and (1.3) as:  

LagrangeT1+T2V1V2:

S__1ϑ__1t=ϑ__1.t,ϑ__1=ϑ__1t,ϑ__2t= ϑ__2.t,ϑ__2=ϑ__2t;S__2maprhs=lhs,S__1

S__1ϑ__1t=ⅆⅆtϑ__1t,ϑ__1=ϑ__1t,ϑ__2t=ⅆⅆtϑ__2t,ϑ__2=ϑ__2t

S__2ⅆⅆtϑ__1t=ϑ__1t,ϑ__1t=ϑ__1,ⅆⅆtϑ__2t=ϑ__2t,ϑ__2t=ϑ__2

(1.4)

LsubsS__2, simplifycombinevaluesubsS__1, Lagrange

Lcosϑ__1ϑ__2ϑ__1tϑ__2tl__1l__2m2+l__12m1+m2ϑ__1t22+ϑ__2t2l__22m22+l__1m1+m2cosϑ__1+l__2cosϑ__2m2g

(1.5)

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,  ϑ__1tLsubsS__1,  ϑ__1L

ⅆⅆtϑ__1tⅆⅆtϑ__2tsinϑ__1tϑ__2tⅆⅆtϑ__2tl__1l__2m2+cosϑ__1tϑ__2tⅆ2ⅆt2ϑ__2tl__1l__2m2+l__12m1+m2ⅆ2ⅆt2ϑ__1t+sinϑ__1tϑ__2tⅆⅆtϑ__1tⅆⅆtϑ__2tl__1l__2m2+l__1m1+m2sinϑ__1tg

(1.6)

EL__1simplify=0

EL__1ⅆ2ⅆt2ϑ__2tl__2m2cosϑ__1tϑ__2t+ⅆⅆtϑ__2t2l__2m2sinϑ__1tϑ__2t+m1+m2gsinϑ__1t+l__1ⅆ2ⅆt2ϑ__1tl__1=0

(1.7)

ⅆⅆ tsubsS__1, ϑ__2tLsubsS__1, ϑ__2L

l__2ⅆ2ⅆt2ϑ__1tcosϑ__1tϑ__2tm2l__1l__2ⅆⅆtϑ__1tⅆⅆtϑ__1tⅆⅆtϑ__2tsinϑ__1tϑ__2tm2l__1+ⅆ2ⅆt2ϑ__2tl__22m2sinϑ__1tϑ__2tⅆⅆtϑ__1tⅆⅆtϑ__2tl__1l__2m2+l__2sinϑ__2tm2g

(1.8)

EL__2simplify=0

EL__2l__2m2ⅆⅆtϑ__1t2l__1sinϑ__1tϑ__2t+ⅆ2ⅆt2ϑ__1tl__1cosϑ__1tϑ__2t+ⅆ2ⅆt2ϑ__2tl__2+sinϑ__2tg=0

(1.9)

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 s2 , the lengths l__i in m and the masses: m__i in kg)

g9.81: l__15: l__23: m14: m21:

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 s1. Now we can solve the equations of motion (1.7) and (1.9) via

soldsolveEL__1,EL__2, initial, numeric, output=listprocedure:

The procedures for the two angles ϑ__1 and ϑ__2 obtained from this solution:

ϑ__1evalϑ__1t, sol; ϑ__2eval ϑ__2t, sol

ϑ__1proct...end proc

ϑ__2proct...end proc

(1.10)

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__2l__1 and l__1l__2?
3) How do the masses influence the motion of the pendulum? What do you observe in the case m__1m__2? What happens when you change the masses of the pendula in the case l__2l__1 and l__1l__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 s2

 

 g=9.81 m s2

 

 g=1.62 m s2 

 

 g=0

lengths:
  l__1 cm:
  l__2 cm:
masses:              
 m__1 g:
  m__2 g:

initial velocities:  

    ϑ.__10 π s1 : 
  ϑ.__20 π s1 : 

 

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: