Professional Documents
Culture Documents
Coupled Pendulum PDF
Coupled Pendulum PDF
We can see that there is a force on the system due to the spring. Hookes 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 = kx
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 Newtons 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
k
( 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:
x1 = g sin( 1 ) +
k
( x 2 x1 )
m1
x 2 = g sin( 2 ) +
k
( x 2 x1 )
m2
(1)
x1 = l1 sin(1 )
(2)
x2 = l 2 sin( 2 )
Therefore:
x1 = l1 1 cos( 1 )
x1 = l1 1 cos(1 ) l11 sin(1 )
2
(3)
x 2 = l 2 2 cos( 2 ) l 2 2 sin( 2 )
2
k
(l 2 sin( 2 ) l1 sin(1 ))
m1
1 =
And simplifying:
1 =
Thus by symmetry:
When the spring is compressed, the points of a real spring get closer together and the vertical
distance between them increases.
Similarly, when the spring is expanded they get further apart and the vertical distance
between them decreases:
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 .
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
, y'
)
0+
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:
y[i ] = y '
0+
i y T (1) i S H
+
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:
ls =
xT
n
SH
2
S H = 2 ls
x
T
n
i yT
x
2
y[i ] = y '
+ (1) i l s T
0+
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 =
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:
l'1 =
l1 l'T
l1 + l 2
l' 2 =
l 2 l' T
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.