Professional Documents
Culture Documents
Robert Stanescu
In classical mechanics, a harmonic oscillator is a system that, when displaced from its
equilibrium position, experiences a restoring force F~ proportional to the displacement x:
F~ = −k~x, where k is a positive constant.
If F~ is the only force acting on the system, the system is called a simple harmonic
oscillator, and it undergoes simple harmonic motion: sinusoidal oscillations about the equi-
librium point, with a constant amplitude and a constant frequency (which does not depend
on the amplitude).
O x
~a
k F~e
O m
m · ~a = F~e
d2 x
m· = −k · x
dt2
d2 x k
2
=− ·x (1)
dt m
1
We can see that equation (1) is a second order homogenous differential equation that we
will solve accordingly.
The general solution for a homogenous differential equation is x = A · eα·t .
x = A · eα·t
dx
= A · α · eα·t (2)
dt
d2 x
2
= A · α2 · eα·t
dt
Introducing the results from (2) in (1):
k
A · α2 ·
eα·t
= − eα·t
· A · (3)
m
k
From (3) we get α2 = − m . The solutions for this are:
r
k
α1 = +i
rm (4)
k
α2 = −i
m
We rewrite (4) as:
α1 = +iω
(5)
α2 = −iω
q
k
,where ω = m .
Thus, the solution for (1) is:
Here A1 and A2 are constants determined by the initial conditions of the system.
Rewriting (6) using (5), we get:
2
We can simplify this further by rewriting the exponential functions using Euler’s formula,
ix
e = cos(x) + i sin(x). We then get:
We could replace A1 , A2 and φ with other constants since they are all determined by the
initial conditions of the system so the result would have√been the same, it is just simpler and
nicer to write x(t) = A · cos(ωt + ϕ) instead of x(t) = 2 A1 A2 · cos(ωt − φ). On top of that,
we can also write ϕ − π2 instead of ϕ and the solution would become x(t) = A · sin(ωt + ϕ).
The result is the same either way, it is just a matter of preference.
In conclusion, the solution for a second order homogeneous differential equation of the form
d2 x
2
= −ω 2 · x (9)
dt
is given by:
x(t) = A · sin(ωt + ϕ) (10)
We can see that this holds for any second order homogeneous differential equation of that
form and is not specific to an object attached to a spring sliding on a frictionless table.
In conclusion, any time you see a differential equation with the same form as (9) it will
imply the harmonic oscillations of x and the solution will be given by equation (10).
3
Example
Taking the example given at the beginning and given a set of initial conditions for the system
we can plot the value of the coordinate x of the object against time.
x(t) = A · sin(ωt + ϕ)
dx
v(t) = = Aω · cos(ωt + ϕ)
dt
d2 x
a(t) = 2 = −Aω 2 · sin(ωt + ϕ)
dt
Initial conditions: at t0 = 0, the displacement of the spring is x(0) = xmax and the
speed of the object is v(0) = 0.
Therefore, equation (10) becomes x(t) = xmax · sin ωt + π2 = xmax · cos(ωt) and
q
k
v(t) = −xmax ω · sin(ωt). Here, ω = m . Plotting x(t) and v(t) we get:
xmax
v(t)
x(t)
O t
4
Because x(t) is a periodic function, we can find out the period of oscillation from
x(t) = x(t+T ) .
A · sin(ωt + ϕ) = A · sin(ω(t + T ) + ϕ)
⇒ ω(t + T ) + ϕ =
ωt
+ ϕ + 2π
2π
⇒T =
ω
The energy of a harmonic oscillator is constant and given by:
1
E = kA2 (11)
2