Professional Documents
Culture Documents
L05 SimpleOscillations
L05 SimpleOscillations
25 September 2023
Readings:
• Morin 4.1-4.2
• If you want to go into (a lot) more detail, see French Chap. 3, until p. 62
1 Expectations
1.1 Remember
• The simple harmonic oscillator (SHO) equation, ẍ + ω02 x = 0.
• For the pendulum, ω02 = g/`; for the mass+spring system, ω02 = k/m.
• Solutions to the SHO are in the form of Aei(ω0 t+φ) , or any equivalent form.
• A phase space diagram of an oscillation is a plot of the oscillation on a (ẋ, x) graph, with the
trace parameterized by time.
• Solutions to a linear ODE satisfy the superposition principle.
1.2 Understand
• That an SHO is the combination of an inertial process (e.g., mass inertia, magnetic induc-
tion. . . ) and of a restoring process (e.g., spring stiffness, capacitance. . . )
• What the linear regime means.
• What linearizing entails.
• How we can linearize also in an unstable case, although the regime is only valid in the early
instants of the instability.
• Similarities in Physics: if two ODEs have the same form, the mathematical solutions will also
look the same.
• How adopt-an-exponential in the forced case leads to knowing the oscillation’s frequency,
amplitude and phase shift with respect to the forcing,
1
1.3 Create and apply
• From a set of two initial conditions (e.g. initial position and initial velocity, for the pendulum
system), how to compute the complete evolution of the system.
• How to apply knowledge from one type of oscillator (e.g., pendulum) to obtain the solutions
of a difference kind of oscillator (e.g., mass+spring).
• The “adopt-an-exponential” method.
• . . . and the worked out examples and tutorials
Before I introduce the main oscillator of this chapter and the two after that (i.e., the mass+spring
system), let me introduce you to another oscillator we will use often: the pendulum. See below
(Jupyter) or at https://youtu.be/QPpatmnS3bs.
YouTubeVideo('QPpatmnS3bs', width=800, height=300)
[2]:
[2]:
2
2.1 Equations of motion
Consider the spring-mass system in the PhET simulation below (and at
https://phet.colorado.edu/en/simulation/hookes-law). An ideal spring (that is, a weightless,
dissipationless spring) of stiffess k > 0 [in N.m−1 , or kg.s−2 ], attached to a fixed wall on one end,
and an objet of mass m [kg] on the other.
%%html
[3]: <iframe src="https://phet.colorado.edu/sims/html/hookes-law/latest/hookes-law_en.html" width="800" height="600" scrolling="no"
<IPython.core.display.HTML object>
Let x be the position of the centre of mass of the object. x = 0 at rest, x 6= 0 otherwise. Let’s also
assume the mass can slide on the surface without friction, and that the spring is “ideal” (namely, it
is weightless and can oscillate without dissipation).
An equivalent system is the one I am presenting below (Jupyter notebook) and at
https://youtu.be/cMjn04ivOfE.
YouTubeVideo('cMjn04ivOfE', width=800, height=300)
[4]:
[4]:
We now pull the mass to position x = x0 6= 0 and hold it there. If x0 is “not too big”, the spring
will not deform or break. In this case, the force of the spring on the mass is (Hooke’s law)
F = −kx0 .
3
• The negative sign means that the force is a restoring force (i.e., it tends to bring back the
oscillator to its state of rest; here, the sate of rest is when the mass is at its equilibrium
position).
• k being constant, the force is proportional to the distance from equilibrium position. It makes
this force linear: if I double the distance, I double the force. See a comment in the second
lecture notes (which I did not mention in class then, but hopefully will do this time) for a
discussion about how to make it non-linear. Later, we will talk about the pendulum, for which
the process of linearizing is more transparent.
Let us now release our spring. The motion of the object has to obey Newton’s second law, which
constitutes an equation of motion.
ma = F ⇒ mẍ = −kx.
The equation above is a second-order Ordinary Differential Equation (ODE), which we saw before.
Let
k
ω02 = ⇒ ẍ + ω02 x = 0. (1)
m
4
Of all these possible forms, the ones that will prove the most useful are the last two, with the
complex exponentials. The reason is not particularly obvious for the SHO, because all forms are
quite convenient to handle, but sticking to exponentials will prove invaluable when equations become
more complicated. So, let’s take a step back, pretend we never heard of oscillations during the last
lecture, and let us be falsely naive.
We will use what I (and only I, as far as I know) call the “adopt-an-exponential ” method. We
will “test” if the function
x(t) = cert , with (c, r) ∈ C2 ,
can be a solution, and under which conditions. And to know that, we will plug it in the equation
of motion, and let it “adopt” the exponential, i.e., tell us which r would work.
Note that r ∈ C, but unlike iω, it is not purely imaginary and may have a real part. The letter r
stands for “root”.
Plugging in, ẍ = r2 cert = r2 x, and eqn. (1) becomes
So, either r2 = −ω02 , or x(t) = 0, and we want it to be true all the time. Now, the latter cannot be
zero all the time, otherwise. . . well, there would be no oscillation to study. Therefore, it has to be
√
r2 = −ω02 ⇒ r = ± −1ω0 = ±iω0 .
The ± is important: it tells us that two linearly independent solutions can satisfy this equation,
and that the general solution has to be a linear combination of those:
Note that we can simply add them thanks to the superposition principle: “If two functions each
are a solution of a linear differential equation, then any linear combination will be a solution as
well.” You can easily check by plugging in the linear combination (2) into the original ODE (1),
and you will see that both sub-solution individually solve the ODE as well as their sum. The
superposition principle is a wonderful fact about solving linear ODEs.
Could there be a 3rd sub-solution? Not an independent one. There is no 3rd exponential, or any
other function. This comes from the theory of ODEs, which you will see in a math course: a
nth -order linear ODE has n independent solutions. No less, and no more.
The ODE has adopted two exponentials, and is excited to see them grow. Or, more accurately,
oscillate. Parenting means a lot of ups and downs, after all.
To complete the adoption process, the two initial conditions will tell us what c1 and c2 are. See
tutorial #2: to keep x purely real, we need c2 = c∗1 , and if x0 and v0 are the initial position and
velocity, then
1 v0
c1 = x0 − i ,
2 ω0
p
with the amplitude A = 2|c1 | = x20 + v02 /ω02 and an initial phase defined by cos φ = x0 /A and
sin φ = −v0 /(ω0 A).
Let us plot this, with the option to change various parameters:
5
def plot_SHO(k, m, x0, v0):
[5]: """ Function that computes and plots position and velocity
INPUT:
k: spring stiffness [N/m, kg/(s**2)]
m: mass [kg]
x0: initial position [m]
v0: initial velocity [m/s]
OUTPUT: plot of the mass position and velocity"""
# let's plot
ftsz = 13
plt.figure(dpi=100)
# plt.show()
return
6
from ipywidgets import interact, FloatSlider
[7]: interact(plot_SHO, k=180, m=0.8, x0=FloatSlider(min=-0.1, max=0.1, step=1e-2, value=4e-2), v0=FloatSlider(min=-0.5, max=0.5, st
7
v = -omega0*A*np.sin(omega0*t+phi) # velocity
def plot_xv_t():
[9]: """ First figure shows time series of x and v """
plt.plot(t/T0, xnorm, label=r'$x/A$')
plt.plot(t/T0, vnorm, '--', label=r'$v/(A\omega_0)$')
plt.legend()
plt.title('Time series')
plt.xlabel(r'$t/T_0$')
plt.xlim(t[0]/T0, t[-1]/T0)
plt.grid()
return
plot_xv_t()
[10]:
This plot contains a lot of redundant information and it is not necessarily easy to see a clear
relationship between x and v.
The phase plot takes x and v as coordinates in the plane, and plots the parametric curve
which describes an ellipse with horizontal and vertical axes. Let’s plot it.
8
def plot_phase_SHM():
[11]: """ Second figure shows phase diagram """
plt.plot(xnorm, vnorm)
plt.xlabel(r'$x/A$')
plt.ylabel(r'$v/(\omega_0 A)$')
plt.arrow(xnorm[0], vnorm[0], xnorm[1]-xnorm[0], vnorm[1]-vnorm[0], width=0.05)
plt.grid()
plt.title('Phase portrait')
plt.xlim([-1.1, 1.1])
plt.ylim([-1.2, 1.1])
plt.axhline(0., color='k') # $v=0$ axis
plt.axvline(0., color='k') # $x=0$ axis
plt.axis('equal')
return
plot_phase_SHM()
[12]:
This curve describes the whole motion because it’s periodic. With a bit of practice, the following
pieces of info are more legible than on the time series plots:
• Points where the extension x is at an extremum are points where v = 0, and points of maximum
velocity occur at x = 0.
• It proceeds clockwise (negative direction), as indicated by the arrow. It highlights that v
precedes x in phase: when v/(ω0 A) = −1 (its minimal value), we will have x/A = −1 one-
quarter cycle later.
9
The plot above looks like a circle of radius one in the (x/A, ẋ/(ω0 A)) coordinates, or an ellipse
when the axes aren’t stretched as arbitrarily. To see why, recall that x2 = A2 cos2 (ω0 t) and ẋ2 =
ω02 A2 sin2 (ω0 t). Thus,
x2 ẋ2
+ = cos2 (ω0 t) + sin2 (ω0 t) = 1,
A2 ω02 A2
which is the equation of an ellipse in the (x, ẋ) plane, or a circle in the (x/A, ẋ/(ω0 A)) space.
We will often plot systems of interest in phase space, as a way of summarizing their behaviour.
4 The pendulum
Now that we have nailed the undamped mass+spring system, let’s consider a different oscillator,
the pendulum. In doing so, I want to show you two things:
• An illustration of a non-linear oscillator, and how to linearize the system.
• That the equations are generic, the particular physics of a system being contained in the
coefficients involved in the equations. In other words, if you can do it with a mass+spring
system, you can do it with any other SHO.
• A foray into unstable behaviour and non-linear phenomena.
<IPython.core.display.HTML object>
Since the mass at the end of the pendulum undergoes circular motion, it makes sense to use polar
coordinates, and the angle θ as our variable in particular. Recalling from the first lecture that
the azimuthal acceleration is 2ṙθ̇ + rθ̈. Here, we can simplify the expression because the motion
is strictly circular (i.e., r = ` and ṙ = r̈ = 0). The azimuthal, a.k.a. tangential, acceleration, is
therefore
aθ = `θ̈.
<IPython.core.display.HTML object>
10
This means that Fθ = −mg sin θ, and
g
m`θ̈ = −mg sin θ or θ̈ = − sin θ . (3)
`
The above equation is a 2nd order homogeneous ODE, but it is nonlinear because of the sin θ (“If
I double θ, I double the acceleration. . . not”). This means we can’t solve the equation by adopting
an exponential. (You can try. . . but there is not much you can do about sin(Aebt ).) Later on, we
will learn how to solve this equation, but for now we are going to consider a restricted version of
this pendulum, one that we have been discussing before: the linear version.
You can’t say the same about the non-linear solutions: even if we had
11
At the risk of beating a dead horse, we recover the small-angle linearity the following way:
and for small angles, sin θ ≈ θ and cos θ ≈ 1. So, for small angles, sin(θ1 + θ2 ) ≈ θ1 + θ2 and we
recover linearity.
Let’s now discuss how the form of equation (4) is exactly like equation (1) for the mass on a spring,
which gave SHM. Besides the phenomenon being described and the physics in it however, this case
is equivalent to the spring case, as long as θ 1. But recall that a spring has its own linear regime
of small x, “small” being compared to. . . well, by how much x has to be to start seeing prominent
non-linear phenomena such as maximum compression or permanent deformation. The pendulum
makes it more simple to define what the linear and the non-linear regimes are, is all.
Therefore, exactly like for the mass + spring system, we have linear solutions of the form
θ̇0
θ = θ0 cos(ω0 t) + sin(ω0 t).
ω0
Pendulums have a surprisingly interesting history, considering how simple they are. The follow-
ing fun facts are a regurgitation of https://en.wikipedia.org/wiki/Pendulum#History and should
motivate you to read about it:
• Galileo noticed that the period of a pendulum was independent of amplitude as long as it was
small by looking at a giant chandelier hanging off of Pisa’s cathedral’s ceiling (you can look
up pictures of this pendulum, apparently it still exists), and independent of mass.
• Huygens used it to make very nice clocks that only deviated by 15 seconds per day instead of
the 15 minutes of the previous technology.
• People used it to measure g on various points of Earth, leading to a very accurate measure of
the shape of the Earth very early on.
5 Summary
In this lecture, we saw the following.
• How to derive the motion of a SHO using ODE science and the “adopt-an-exponential” method.
• How to completely determine SHM based on initial position and velocity.
• How to linearize a non-linear equation of motion, from the pendulum example, assuming small
deviations from rest and Taylor expansions. (See Appendix for a different linearization.)
• What a phase plot, or phase diagram, is, illustrated with the case of SHM.
• How to predict the shape of the phase portrait based on the x, v solutions in simple cases.
12
6.1 The non-linear pendulum
The large-amplitude pendulum has an analytical formula for the period T for any θmax for the
full eqn. (3), although it does not involve solving the ODE, but rather conservation of energy (see
Morin, exercise 4.23 on p. 124). Because I want to postpone energy considerations to a little later,
I will just write down this solution, which is
s Z
8` θmax dθ
T = √ .
g 0 cos θ − cos θmax
θ3
g
θ̈ + θ− = 0.
` 6
Note that I did not use the notation ω0 here. This is because I want ω0 to retain its special meaning
as the angular frequency of linear oscillations. Because we don’t have
p it anymore, and because the
angular frequency of oscillations is now different, I prefer to keep g/`.
This equation is actually quite famous, and not just about pendulums. It is called the undamped,
undriven Duffing equation. If it were damped and driven, it would exhibit chaotic behaviour (see
e.g. https://en.wikipedia.org/wiki/Duffing_equation).
from now on, because this quantity will still hold a special importance, though not as an angular
frequency.
We are starting near the angle θ = π. Because we like our small numbers, let’s define a new angle
for which the initial angle is zero. That is, define
θ = π − δ.
Then, sin θ = sin(π − δ) = − sin δ (easy to see if you draw a circle), θ̇ = −δ̇ and θ̈ = −δ̈. Newton’s
2nd law becomes
δ̈ − σ 2 sin δ = 0.
Notice the specific difference compared to the pendulum “down” case. In that case, we had a “+”
sign in between the terms. Now we have a “−” sign, which will make all the difference.
13
Note that δ = 0 is a possible steady solution of the equation above. This is what it means to be
unstable: it could stay there forever if nothing were to perturb it, but the smallest perturbation will
dramatically throw it off-balance. This is opposite to the θ = 0 case, where the smallest perturbation
will just create the smallest oscillations, trying to bring the system back to its equilibrium position.
But this is also in opposition to any other θ 6= 0 or θ 6= π case: those aren’t associated with any
θ̈ = 0 situation, they are simply out-of-equilibrium (which is different from an unstable equilibrium).
We can linearize the solution again to small δ’s, which yields
δ̈ − σ 2 δ = 0. (5)
The regime of validity of this approximation will not be as wide as the stable case (pendulum down):
there, if θ 1 at all times during one oscillation, it will stay that way for ever and the SHO equation
will also be valid forever. In the present case, the pendulum will eventually go wayyy down and
back wayyyyy up, and the linearization will eventually lose its validity. But the linearization should
be valid for a few initial moments.
To solve eq. (5), we notice that it is a 2nd order, linear, homogeneous ODE and therefore, we can
attempt to adopt an exponential again: try x = cert and solve for r. Doing so gives r = ±σ. The
exponent is now real in the “up” pendulum, where it was complex in the “down” pendulum. We will
not see oscillations.
We can now write the solutions as exponential functions, where
etc., are all equivalent. The coefficients are again determined by the initial conditions.
We cannot start at exactly δ = 0, because in theory it would stay there for ever. Instead, consider
an initial angle δ|t=0 = δ0 1 but 6= 0. Let’s also consider δ̇|t=0 = 0 for simplicity. Using the 2nd
form above (eq. 6), we find
δ̇(t) = σC sinh(σt) + σD cosh(σt)
and plugging in the initial conditions, we find (recall cosh(0) = 1 and sinh(0) = 0)
δ0 = C and 0 = D.
So,
δ0 σt
e + e−σt .
δ(t) = δ0 cosh σt =
2
In this case, the solutions are exponentially
p growing as t increases: a small perturbation grows
arbitrarily large with a time scale of `/g called the “growth rate”. This case is linearly unstable
(because this is all very linear). But recall that the motion exponentially moves away from the axis
only in the initial moments, when the angle is still small. Beyond that, there be nonlinear dragons.
14