You are on page 1of 7

THE COUPLED PENDULUM

DERIVING THE EQUATIONS OF MOTION

The coupled pendulum is made of 2 simple pendulums connected (coupled) by a spring of


spring constant k .

Figure 1: The Coupled Pendulum

We can see that there is a force on the system due to the spring. Hooke’s law states that:

Fs ∝ displacement

Where Fs is the force on the system due to the spring.

So using k to denote the spring constant, the elastic force on the system due to the spring is:

Fs = k∆x
Fs = k ( x2 − x1 )

Note that this is true only for small oscillations. To model all cases of this pendulum system,
an extension would need to be employed - dependent on the configuration of the system, the
equation Fs = k ( x2 − x1 ) should be multiplied by either sin(θ ) or cos(θ ) .
Now, it can be seen from Figure 1 that the driving force on the system due to gravity ( Fg )
is:
F1, g = −m1 g sin(θ 1 )
F2, g = − m2 g sin(θ 2 )

Where F1, g and F2, g are the driving forces due to gravity on the bobs with masses m1 and m2
respectively.

Adding the elastic force to the gravitational force gives us the total driving force acting on
each bob:

F1,T = −m1 g sin(θ 1 ) + k ( x 2 − x1 )


F2,T = −m2 g sin(θ 2 ) + k ( x 2 − x1 )

And Newton’s second law of motion states that:

F = ma

Where F denotes force, m signifies mass, and a represents acceleration.

So:

m1 a1 = −m1 g sin(θ1 ) + k ( x 2 − x1 )
k
a1 = − g sin(θ1 ) + ( x 2 − x1 )
m1

And thus by symmetry:

k
a 2 = − g sin(θ 2 ) + ( x 2 − x1 )
m2

Since x1 and x 2 denote the displacements of the 2 bobs, we know that the 2 accelerations a1
and a 2 are actually x1 and x 2 respectively, so:

k
x1 = − g sin(θ 1 ) + ( x 2 − x1 ) (1)
m1
k
x 2 = − g sin(θ 2 ) + ( x 2 − x1 )
m2
We can see from Figure 1 that:
x1 = l1 sin(θ1 ) (2)
x2 = l 2 sin(θ 2 )
Therefore:

x1 = l1θ 1 cos(θ 1 )
x1 = l1θ 1 cos(θ1 ) − l1θ1 sin(θ1 )
2
(3)
And thus by symmetry:

x 2 = l 2θ 2 cos(θ 2 ) − l 2θ 2 sin(θ 2 )
2

Substituting equations (2) and (3) into equation (1) gives:

k
l1θ1 cos(θ1 ) − l1θ1 sin(θ1 ) = − g sin(θ1 ) + (l 2 sin(θ 2 ) − l1 sin(θ1 ))
2

m1

Rearranging gives us:

g sin(θ 1 ) l1θ 1 sin(θ1 ) kl 2 sin(θ 2 ) kl sin(θ1 )


2

θ1 = − + + − 1
l1 cos(θ 1 ) l1 cos(θ 1 ) m1l1 cos(θ1 ) m1l1 cos(θ1 )

And simplifying:

θ1 =
( )
sin(θ1 ) m1 (l1θ 1 − g ) − kl1 + kl 2 sin(θ 2 )
2

m1l1 cos(θ 1 )

Thus by symmetry:

θ2 =
( )
sin(θ 2 ) m 2 (l 2θ 2 − g ) − kl 2 + kl1 sin(θ 1 )
2

m2 l 2 cos(θ 2 )

PROGRAMMING THE JAVA APPLET

I had a good idea from the start as to how I was going to structure the code for this applet – I
intended to use similar code as was used in the other applets to calculate the positions of the 2
pendulums and then draw them, but I then needed to create another section of code in which
the coordinates of the spring were calculated and plotted.

To begin with I created an applet with the basic pendulum graphics but without the spring,
and then started to think about how I could make the spring look as realistic as possible.
Figure 2: Spring (Normal)

When the spring is compressed, the points of a real spring get closer together and the vertical
distance between them increases.

Figure 3: Spring (Compressed)

Similarly, when the spring is expanded they get further apart and the vertical distance
between them decreases:

Figure 4: Spring (Expanded)

With this in mind, I set about finding an algorithm to calculate the ‘shape’ of the spring in
relation to the positions of the bobs of the 2 pendulums at any time t .

Figure 5: The Spring in Relation to the Bobs

As can be seen from Figure 5, the total distance along the x -axis between the 2 bobs ( xT )
would be:

xT = x' 2 − x'1 (4)


Where x'
1 and x '
2 are the x -coordinates of ‘bob 1’ and ‘bob 2’ respectively.

Figure 5 shows both bobs to have the same y -coordinate value. Even if they did not, it
would still be true that:
yT = y' 2 − y'1

Note that similar notation has been used here as was used for the x -coordinates in equation
(4).

Assuming that both the vertical and horizontal distances between each point would be equal,
x
then from Figure 5 we can see that the x -distance between each point would be T (for
n
y
n + 1 points) and the y -distance between each point would be T .
n

Then, taking S H to denote the spring height, ( x' i , y' i ) to be the coordinates (in pixels) of the
i th point of the spring, and remembering that Java plots downwards from the origin at the top
left of the screen:

( x' 0 , y' 0 ) = ( x' 0 , y'


0 )

xT y T SH
( x'1 , y'1 ) = ( x' 0 + 0+
, y' − )
n n 2
2x 2y T S H
( x' 2 , y' 2 ) = ( x' 0 + T , y'0+ + )
n n 2
3x 3y T S H
( x' 3 , y' 3 ) = ( x' 0 + T , y'0+ − )
n n 2
4x 4y T S H
( x' 4 , y' 4 ) = ( x' 0 + T , y'0+ + )
n n 2

And so on until:
( x' n , y' n ) = ( x' 0 + x T , y'
0 +yT )

A clear pattern can be seen from this, and so I implemented an algorithm into my applet code
accordingly. I used a ‘for’ loop to fill 2 arrays containing the x and y coordinates of the
points of the spring. The first and last elements of the arrays were simply the coordinates of
the first and second bob respectively, but the intermediate elements were calculated using the
following formulae:
i ⋅ xT
x[i ] = x '
0+
n

i ⋅ y T (−1) i S H
y[i ] = y '
0+ +
n 2
Where x [ i ] and y [ i ] are the i th elements in the arrays containing the x and y coordinates
respectively, i ranging (in this case) from 1 to n .

Next I needed to calculate the spring height term, bearing in mind that it is dynamic – it
increases when the distance between the 2 bobs ( xT ) decreases, and vice versa.

We can see from Figures 2, 3, and 4 that the length l s (the length of the spring between 2
points) is constant for any amount of spring compression and so we can fix this constant. We
x
also know the x -distance between each point as being T . Thus, we can calculate the
n
dynamic spring height term by using Pythagoras’ theorem:

Figure 6: Calculating the Spring Height Term

We can see from Figure 6 that:

2 2
2 xT SH
ls = +
n 2

Solving for S H we have:

2
2 x
S H = 2 ls − T
n

So the formula for y [ i ] becomes:

2
i ⋅ yT 2 x
y[i ] = y '
0+ + (−1) i l s − T
n n

Once I had incorporated this into the program I added a small portion of code to the ‘drawing’
section of the code so that the spring was plotted onto the applet as well as the pendulums.
Now that the applet was working satisfactorily I decided to alter the applet so that if the user
inputted 2 different rod lengths for the system, they would be drawn to scale with respect to
each other, as opposed to being drawn the same length and forcing the user to use their
imagination.
I did this by using ‘if’ statements to gauge which inputted rod length was larger ( l LARGE ),
made this bigger rod a constant l' LARGE pixels long, and then calculated the smaller rod length
in pixels to be:
l SMALL ⋅ l' LARGE
l' SMALL =
l LARGE

Where l 'denotes the graphical length in pixels of the respective rod, and l represents the
actual length of the rod in metres.

To finish the applet, I added a new text-field so that users could input their own values for the
spring constant k .

NOTE

I was so pleased with the results of the rod scaling that I went back to the double pendulum
applet and implemented a ‘scaling’ method there as well. The formulae I used to scale the
double pendulum ‘pixel rod length’ are:

l1 ⋅ l'T
l'1 =
l1 + l 2

l 2 ⋅ l' T
l' 2 =
l1 + l 2

Where l ' 1 and l '


2 are the pixel lengths of the 2 rods; l1 and l 2 are their actual lengths; and l' T

is their (fixed) total pixel length.

You might also like