A Double Spring Pendulum: Student Projects in Differential Equations
A Double Spring Pendulum: Student Projects in Differential Equations
http://online.redwoods.edu/instruct/darnold/deproj/index.htm 1/33
Spring 1
m1 (X1 , Y1 , Z1 )
Spring 2
m2 (X2 , Y2 , Z2 )
Getting Started with Vectors
3/33
What we know:
• The force on mass 1 is always in the direction of the origin and
mass 2
• The force on mass 2 is always in the direction of mass 1
• Gravity always pulls in the -κ̂
κ̂ direction
What we need:
• A unit vector pointing from the origin to mass 1
κ̂)
r1 = (X1ı̂ + Y1̂ + Z1κ̂ 4/33
q
kr1k = X12 + Y12 + Z12
r1 (X1ı̂ + Y1̂ + Z1κ̂
κ̂)
rˆ1 = = p 2
kr1k X1 + Y12 + Z12
• Unit vectors pointing from mass 2 to mass 1 and mass 1 to mass 2
r3
F3 = −k2(kr3k − L2)
kr k
3
L2
F3 = k2 − 1 r3
kr3k
Putting the Forces Together
8/33
The force on mass 1 is
Fm1 = F1 + F2 − m1gκ̂
κ̂
L1 L2
Fm1 = k1 − 1 r1 + k2 − 1 r2 − m1gκ̂
κ̂
kr1k kr2k
The force on mass 2 is
Fm2 = F3 − m2gκ̂κ̂
L2
Fm2 = k2 − 1 r3 − m2gκ̂
κ̂
kr3k
To find the accelerations of the masses, use the formula F = ma
m1am1 = Fm1
Fm1
am 1 = 9/33
m1
m2am2 = Fm2
Fm2
am 2 =
m2
So for the acceleration of mass 1 and mass 2
!
k1 L1
am1 = p − 1 (X1ı̂ + Y1̂ + Z1κ̂
κ̂)
m1 X12 + Y12 + Z12
! 10/33
k2 L2
+ p − 1 ...
m1 (X1 − X2)2 + (Y1 − Y2)2 + (Z1 − Z2)2
κ̂) − gκ̂
∗ ((X1 − X2)ı̂ı̂ + (Y1 − Y2)̂̂ + (Z1 − Z2)κ̂
κ̂ κ̂
!
k2 L2
am 2 = p − 1 ...
m2 )2 )2
(X2 − X1 + (Y2 − Y1 + (Z2 − Z1 )2
∗ ((X2 − X1)ı̂ı̂ + (Y2 − Y1)̂̂ + (Z2 − Z1)κ̂
κ̂) − gκ̂
κ̂ κ̂
Let me show the ı̂ part of am1 , which is
!
k1 L1 k2
Ẍ1 = X1 p −1 + (X1 − X2)...
m1 X12 + Y12 + Z12 m1
! 11/33
L2
∗ p −1
)2 )2
(X1 − X2 + (Y1 − Y2 + (Z1 − Z2 )2
This is not the only way to get the solution. The Euler Lagrange
equation can also be used. The equation is
d ∂` ∂`
=
dt ∂ q̇ ∂q 12/33
Finding the Kinetic Energy
13/33
Kinetic energy = 1/2mv 2. For the masses, v = velocity of the masses
is just the derivative of their position with respect to time.
1 2 1 2 1 2
T = m1Ẋ1 + m1Y˙1 + m1Ż1
2 2 2
1 2 1 2 1 2
+ m2Ẋ2 + m2Y˙2 + m2Ż2
2 2 2
1 2 ˙ 2 2
1 2
˙ 2 2
T = m1 Ẋ1 + Y1 + Ż1 + m2 Ẋ2 + Y2 + Ż2
2 2
Finding the Potential Energy
14/33
x
` =T − V
1 2 2 2
1 2 2 2
` = m1 Ẋ1 + Y˙1 + Ż1 + m2 Ẋ2 + Y˙2 + Ż2
2 2
q 2
1 2 2 2
− k1 X1 + Y1 + Z1 − L1
2
1 p 2
− k2 (X1 − X2)2 + (Y1 − Y − 2)2 + (Z1 − Z2)2 − L2
2
− m1gZ1 − m2gZ2
Remember the Euler Lagrange equation
d ∂` ∂`
=
dt ∂ q̇ ∂q
16/33
where q is any variable of differentiation. So,
∂`
=m1Ẋ1
∂ Ẋ1
d ∂`
=m1Ẍ1
dt ∂ Ẋ1
!
∂` L1
=k1X1 p −1 + k2(X1 − X2)...
∂X1 X12 + Y12 + Z12
!
L2
∗ p −1
(X1 − X2)2 + (Y1 − Y2)2 + (Z1 − Z2)2
And doing this for Y1 and Z1 will yield
!
L1
m1Y¨1 =k1Y1 p −1 + k2(Y1 − Y2)...
X12 + Y12 + Z12
! 17/33
L2
∗ p −1
)2 )2
(X1 − X2 + (Y1 − Y2 + (Z1 − Z2 )2
!
L1
m1Z̈1 =k1Z1 p −1 + k2(Z1 − Z2)...
X12 + Y12 + Z12
!
L2
∗ p −1
(X1 − X2)2 + (Y1 − Y2)2 + (Z1 − Z2)2
− m1 g
Remember that (∂`)/(∂X1) is in the ı̂ direction. Putting the last
three equation from the Euler Lagrange equation together, and dividing
by m1, I get
!
18/33
k1 L1
am1 = = p − 1 (X1ı̂ + Y1̂ + Z1κ̂
κ̂)
m1 X12 + Y12 + Z12
!
k2 L2
+ p − 1 ...
m1 (X1 − X2)2 + (Y1 − Y2)2 + (Z1 − Z2)2
∗ ((X1 − X2)ı̂ı̂ + (Y1 − Y2)̂̂ + (Z1 − Z2)κ̂
κ̂) − gκ̂
κ̂ κ̂
Which is the same as from using vectors to get the acceleration of the
first mass.
Getting Results
19/33
These equations can be solved using MATLAB’s ode45 routine. But
there really is three different models here
• When spring 1 has constant zero.
• When spring 2 has constant zero.
• When both spring constants are non-zero.
What will happen when spring 1 has constant zero?
20/33
21/33
Getting the Error
22/33
We know there was error in this graph because we knew what it should
look like. But how do we find the error when we don’t know what it
should look like?
• There is no friction
• There is no external force
• Total energy has to remain constant
Total energy being constant means that the kinetic energy plus the
potential energy has to be constant.
(TF + VF ) − (TI + VI )
E =
TI + VI
The error of the first graph is
(TF + VF ) − (TI + VI )
= 0.3235
TI + VI
23/33
The error of the second graph is
(TF + VF ) − (TI + VI )
= 0.0057
TI + VI
What causes error?
2
−2
−4
−6
24/33
Z1
−8
−10
−12
−14
−16
−18
−20 −15 −10 −5 0 5 10 15 20
X1
−5
Z2
−10
−15
−20
−20 −15 −10 −5 0
X2
5 10 15 20
50.02
Potential+Kinetic
50.01
25/33
50
49.99
49.98
49.97
49.96
49.95
0 2 4 6 8 10 12 14 16 18 20
The Potential + Kinetic energy changes only 0.05, or .1 percent
50
40
30
20
10
Z1
0
−10 26/33
−20
−30
−40
−50
−40 −30 −20 −10 0 10 20 30 40
X1
40
30
20
10
0
Z2
−10
−20
−30
−40
−50
−50 −40 −30 −20 −10
X2
0 10 20 30 40
4
x 10
5.45
Potential+Kinetic
5.4
5.35 27/33
5.3
5.25
5.2
5.15
5.1
0 2 4 6 8 10 12 14 16 18 20
The Potential + Kinetic energy changes 2500, or 4.5 percent.
0
−2
−4
−6
−8
Z1
−10
28/33
−12
−14
−16
−18
−20 −15 −10 −5 0 5 10 15 20
X1
−5
Z2
−10
−15
−20
−20 −15 −10 −5 0
X2
5 10 15 20
0.6
Potential+Kinetic
0.5
0.4
29/33
0.3
0.2
0.1
−0.1
0 2 4 6 8 10 12 14 16 18 20
The Potential + Kinetic energy changes 0.55, or ∞ percent.
800
Potential
Kinetic
600
400
30/33
200
−200
−400
−600
−800
0 2 4 6 8 10 12 14 16 18 20
5
−5
Z1
−10
31/33
−15
−20
−25
−25 −20 −15 −10 −5 0 5 10 15 20 25
X1
Types of Motion
As seen from before, with just the two masses and one spring, the
motion is circular. The motion of that system will always be circular.
When spring 2 has constant zero, the motion will be periodic.
With both spring constants non-zero, the motion can be quite chaotic,
so I made an animating program to view it easier. The amount that it
is chaotic is dependent on how much the masses affect each other. If
mass 1 is large, and mass 2 is small, the motion of mass 1 will be more 32/33
periodic.