Double Pendulum

English German previous next

Sim

Graph

Time Graph

Multi Graph

show sim terminal

command >

This is a simulation of a double pendulum. For large motions it is a chaotic system, but for small motions it is a simple linear system.

You can change parameters in the simulation such as mass, gravity, and length of rods. You can drag the pendulum with your mouse to change the starting position.

The math behind the simulation is shown below. Also available are: open source code, documentation and a simple-compiled version which is more customizable.

For small angles, a pendulum behaves like a linear system (see Simple Pendulum). When the angles are small in the Double Pendulum, the system behaves like the linear Double Spring. In the graph, you can see similar Lissajous curves being generated. This is because the motion is determined by simple sine and cosine functions.

For large angles, the pendulum is non-linear and the phase graph becomes much more complex. You can see this by dragging one of the masses to a larger angle and letting go.

We regard the pendulum rods as being massless and rigid. We regard the pendulum masses as being point masses. The derivation of the equations of motion is shown below, using the direct Newtonian method.

Kinematics of the Double Pendulum

Kinematics means the relations of the parts of the device, without regard to forces. In kinematics we are only trying to find expressions for the position, velocity, and acceleration in terms of the variables that specify the state of the device. x = horizontal position of pendulum mass

horizontal position of pendulum mass y = vertical position of pendulum mass

vertical position of pendulum mass θ = angle of pendulum (0 = vertical downwards, counter-clockwise is positive)

angle of pendulum (0 = vertical downwards, counter-clockwise is positive) L = length of rod (constant)

We place the origin at the pivot point of the upper pendulum. We regard y as increasing upwards. We indicate the upper pendulum by subscript 1, and the lower by subscript 2. Begin by using simple trigonometry to write expressions for the positions x 1 , y 1 , x 2 , y 2 in terms of the angles θ 1 , θ 2 . x 1 = L 1 sin θ 1 y 1 = −L 1 cos θ 1 x 2 = x 1 + L 2 sin θ 2 y 2 = y 1 − L 2 cos θ 2 The velocity is the derivative with respect to time of the position. x 1 ' = θ 1 ' L 1 cos θ 1 y 1 ' = θ 1 ' L 1 sin θ 1 x 2 ' = x 1 ' + θ 2 ' L 2 cos θ 2 y 2 ' = y 1 ' + θ 2 ' L 2 sin θ 2 The acceleration is the second derivative. x 1 '' = −θ 1 '2 L 1 sin θ 1 + θ 1 '' L 1 cos θ 1 (1) y 1 '' = θ 1 '2 L 1 cos θ 1 + θ 1 '' L 1 sin θ 1 (2) x 2 '' = x 1 '' − θ 2 '2 L 2 sin θ 2 + θ 2 '' L 2 cos θ 2 (3) y 2 '' = y 1 '' + θ 2 '2 L 2 cos θ 2 + θ 2 '' L 2 sin θ 2 (4)

Forces in the Double Pendulum



upper mass





lower mass upper masslower mass

We treat the two pendulum masses as point particles. Begin by drawing the free body diagram for the upper mass and writing an expression for the net force acting on it. Define these variables: T = tension in the rod

tension in the rod m = mass of pendulum

mass of pendulum g = gravitational constant The forces on the upper pendulum mass are the tension in the upper rod T 1 , the tension in the lower rod T 2 , and gravity −m 1 g . We write separate equations for the horizontal and vertical forces, since they can be treated independently. The net force on the mass is the sum of these. Here we show the net force and use Newton's law F = m a . m 1 x 1 '' = −T 1 sin θ 1 + T 2 sin θ 2 (5) m 1 y 1 '' = T 1 cos θ 1 − T 2 cos θ 2 − m 1 g (6) For the lower pendulum, the forces are the tension in the lower rod T 2 , and gravity −m 2 g . m 2 x 2 '' = −T 2 sin θ 2 (7) m 2 y 2 '' = T 2 cos θ 2 − m 2 g (8) In relating these equations to the diagrams, keep in mind that in the example diagram θ 1 is positive and θ 2 is negative, because of the convention that a counter-clockwise angle is positive.

Direct Method for Finding Equations of Motion

Now we do some algebraic manipulations with the goal of finding expressions for θ 1 '', θ 2 '' in terms of θ 1 , θ 1 ', θ 2 , θ 2 ' . Begin by solving equations (7), (8) for T 2 sin θ 2 and T 2 cos θ 2 and then substituting into equations (5) and (6).

m 1 x 1 '' = −T 1 sin θ 1 − m 2 x 2 '' (9)

m 1 y 1 '' = T 1 cos θ 1 − m 2 y 2 '' − m 2 g − m 1 g (10)

Multiply equation (9) by cos θ 1 and equation (10) by sin θ 1 and rearrange to get

T 1 sin θ 1 cos θ 1 = −cos θ 1 (m 1 x 1 '' + m 2 x 2 '') (11)

T 1 sin θ 1 cos θ 1 = sin θ 1 (m 1 y 1 '' + m 2 y 2 '' + m 2 g + m 1 g) (12)

This leads to the equation

sin θ 1 (m 1 y 1 '' + m 2 y 2 '' + m 2 g + m 1 g) = −cos θ 1 (m 1 x 1 '' + m 2 x 2 '') (13)

Next, multiply equation (7) by cos θ 2 and equation (8) by sin θ 2 and rearrange to get

T 2 sin θ 2 cos θ 2 = −cos θ 2 (m 2 x 2 '') (14)

T 2 sin θ 2 cos θ 2 = sin θ 2 (m 2 y 2 '' + m 2 g) (15)

which leads to

sin θ 2 (m 2 y 2 '' + m 2 g) = −cos θ 2 (m 2 x 2 '') (16)

Next we need to use a computer algebra program to solve equations (13) and (16) for θ 1 '', θ 2 '' in terms of θ 1 , θ 1 ', θ 2 , θ 2 ' . Note that we also include the definitions given by equations (1-4), so that we have 2 equations (13, 16) and 2 unknowns ( θ 1 '', θ 2 '' ). The result is somewhat complicated, but is easy enough to program into the computer.

θ 1 '' = −g (2 m 1 + m 2 ) sin θ 1 − m 2 g sin(θ 1 − 2 θ 2 ) − 2 sin(θ 1 − θ 2 ) m 2 (θ 2 '2 L 2 + θ 1 '2 L 1 cos(θ 1 − θ 2 )) L 1 (2 m 1 + m 2 − m 2 cos(2 θ 1 − 2 θ 2 )) θ 2 '' = 2 sin(θ 1 − θ 2 ) (θ 1 '2 L 1 (m 1 + m 2 ) + g(m 1 + m 2 ) cos θ 1 + θ 2 '2 L 2 m 2 cos(θ 1 − θ 2 )) L 2 (2 m 1 + m 2 − m 2 cos(2 θ 1 − 2 θ 2 ))

These are the equations of motion for the double pendulum.

Numerical Solution

The above equations are now close to the form needed for the Runge Kutta method. The final step is convert these two 2nd order equations into four 1st order equations. Define the first derivatives as separate variables:

ω 1 = angular velocity of top rod

angular velocity of top rod ω 2 = angular velocity of bottom rod

Then we can write the four 1st order equations:

θ 1 ' = ω 1

θ 2 ' = ω 2

ω 1 ' = −g (2 m 1 + m 2 ) sin θ 1 − m 2 g sin(θ 1 − 2 θ 2 ) − 2 sin(θ 1 − θ 2 ) m 2 (ω 2 2 L 2 + ω 1 2 L 1 cos(θ 1 − θ 2 )) L 1 (2 m 1 + m 2 − m 2 cos(2 θ 1 − 2 θ 2 )) ω 2 ' = 2 sin(θ 1 −θ 2 ) (ω 1 2 L 1 (m 1 + m 2 ) + g(m 1 + m 2 ) cos θ 1 + ω 2 2 L 2 m 2 cos(θ 1 − θ 2 )) L 2 (2 m 1 + m 2 − m 2 cos(2 θ 1 − 2 θ 2 ))

This is now exactly the form needed to plug in to the Runge-Kutta method for numerical solution of the system.

This web page was first published February 2002.