Vous êtes sur la page 1sur 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. Hookes law states that:

nt displaceme F
s


Where
s
F 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:

x k F
s
=
) (
1 2
x x k F
s
=

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 ) (
1 2
x x k F
s
= 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 (
g
F )
is:
) sin(
1 1 , 1
g m F
g
=
) sin(
2 2 , 2
g m F
g
=

Where
g
F
, 1
and
g
F
, 2
are the driving forces due to gravity on the bobs with masses
1
m and
2
m
respectively.

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

) ( ) sin(
1 2 1 1 , 1
x x k g m F
T
+ =
) ( ) sin(
1 2 2 2 , 2
x x k g m F
T
+ =

And Newtons second law of motion states that:

ma F =

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

So:

) ( ) sin(
1 2 1 1 1 1
x x k g m a m + =
) ( ) sin(
1 2
1
1 1
x x
m
k
g a + =

And thus by symmetry:

) ( ) sin(
1 2
2
2 2
x x
m
k
g a + =

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

) ( ) sin(
1 2
1
1 1
x x
m
k
g x + = (1)
) ( ) sin(
1 2
2
2 2
x x
m
k
g x + =




We can see from Figure 1 that:
) sin(
1 1 1
l x = (2)
) sin(
2 2 2
l x =
Therefore:

) cos(
1 1 1 1

l x =

) sin( ) cos(
1
2
1 1 1 1 1 1


l l x =
(3)

And thus by symmetry:

) sin( ) cos(
2
2
2 2 2 2 2 2


l l x =

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

)) sin( ) sin( ( ) sin( ) sin( ) cos(
1 1 2 2
1
1 1
2
1 1 1 1 1
l l
m
k
g l l + =



Rearranging gives us:

) cos(
) sin(
) cos(
) sin(
) cos(
) sin(
) cos(
) sin(
1 1 1
1 1
1 1 1
2 2
1 1
1
2
1 1
1 1
1
1

l m
kl
l m
kl
l
l
l
g
+ + =




And simplifying:

( )
) cos(
) sin( ) ( ) sin(
1 1 1
2 2 1
2
1 1 1 1
1

l m
kl kl g l m +
=




Thus by symmetry:

( )
) cos(
) sin( ) ( ) sin(
2 2 2
1 1 2
2
2 2 2 2
2

l m
kl kl g l m +
=





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 (
T
x )
would be:


1 2
' x ' x x
T
= (4)
Where
1
' x and
2
' x 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:
1 2
' y ' y y
T
=

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,
then from Figure 5 we can see that the x -distance between each point would be
n
x
T
(for
1 + n points) and the y -distance between each point would be
n
T
y
.

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

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

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


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:
n
x i
i x
T

+ =
0
' x ] [

2
) 1 ( y i
' ] [
T
0
H
i
S
n
y i y

+

+ =
Where ] i [ x and ] i [ y are the
th
i 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 (
T
x ) decreases, and vice versa.

We can see from Figures 2, 3, and 4 that the length
s
l (the length of the spring between 2
points) is constant for any amount of spring compression and so we can fix this constant. We
also know the x -distance between each point as being
n
x
T
. Thus, we can calculate the
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
2

=
H T
s
S
n
x
l




Solving for
H
S we have:

2
2
2

=
n
x
l S
T
s H


So the formula for ] i [ y becomes:

2
2
T
0
) 1 (
y i
' ] [

+ =
n
x
l
n
y i y
T
s
i


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 (
LARGE
l ),
made this bigger rod a constant
LARGE
' l pixels long, and then calculated the smaller rod length
in pixels to be:
LARGE
LARGE SMALL
SMALL
l
' l l
' l

=

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:

2 1
1
1
l l
' l l
' l
T
+

=

2 1
2
2
l l
' l l
' l
T
+

=

Where
1
' l and
2
' l are the pixel lengths of the 2 rods;
1
l and
2
l are their actual lengths; and
T
' l
is their (fixed) total pixel length.

Vous aimerez peut-être aussi