In this lecture, we introduce the concept of harmonic oscillators. We derive an equation of motion of a harmonic oscillator and derive an analytical solution. Models of harmonic oscillators are archetypical models of a number of mechanical and electrical systems. A YouTube video accompanying this post is given below.
A basic example of a harmonic oscillator is a mass-spring system shown in Fig. 1 below.
![](https://aleksandarhaber.com/wp-content/uploads/2020/03/graph1-1024x738.jpg)
An object of a mass is attached to the wall by a spring with stiffness of
. If we displace the object from its equilibrium position, the object will oscillate, and since there is no damping the object will oscillate forever. Our goal is to derive the equation describing the motion of the object as a function of time and to solve such an equation. As always, the first step is to derive a free-body diagram that is shown in Fig. 2 below. The equilibrium position is established for the displacement of
for which the spring is not compressed or extended.
![](https://aleksandarhaber.com/wp-content/uploads/2020/03/graph2-1024x565.jpg)
The force is the spring force whose magnitude is equal to
, where
is the displacement of the object from its equilibrium position.
The next step is to apply Newton’s second law:
(1)
By projecting this equation onto the x-axis, we obtain:
(2)
By defining
![Rendered by QuickLaTeX.com \omega_{n}=\sqrt{\frac{k}{m}}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-71a534c993efd1337b10f30d358d0c64_l3.png)
(3)
The equation (3) is the equation of motion describing the dynamics of the mass-spring system. For given initial conditions, the solution of this equation is a function
(4)
The quantity
![Rendered by QuickLaTeX.com \omega_{n}=\sqrt{\frac{k}{m}}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-71a534c993efd1337b10f30d358d0c64_l3.png)
The next step is to solve the equation of motion. We assume a solution of the following form:
(5)
where
![Rendered by QuickLaTeX.com s](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-ae1901659f469e6be883797bfd30f4f8_l3.png)
(6)
or compactly
(7)
Since
![Rendered by QuickLaTeX.com e^{st}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-98a282845746354384e0f371e5547965_l3.png)
(8)
The equation (8) is called the auxiliary equation. The soluton of this equation is given by
(9)
where
![Rendered by QuickLaTeX.com i](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-695d9d59bd04859c6c99e7feb11daab6_l3.png)
(10)
where
![Rendered by QuickLaTeX.com C_{1},C_{2}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-b6abebe842edeed36305c0e1eda836ff_l3.png)
(11)
where
![Rendered by QuickLaTeX.com \phi](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-5b2be26c0c1341f54b29baddda771346_l3.png)
(12)
where we used the fact that
![Rendered by QuickLaTeX.com cos( -\omega_{n}t )= cos( \omega_{n}t )](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-4f86b0018937b56c6930bf5affa13c86_l3.png)
![Rendered by QuickLaTeX.com sin(- \omega_{n}t )= -sin(\omega_{n}t )](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-e966befb8770b9392289079a14e80e93_l3.png)
![Rendered by QuickLaTeX.com K_{1}= (C_{1}+C_{2})](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-a587e85c9301b25668f1a2c30bb9fd5b_l3.png)
![Rendered by QuickLaTeX.com K_{2}= i(C_{1}-C_{2})](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-4ded3a977b1a06524072b876d1da63ee_l3.png)
(13)
The equation (13) is the solution of the equation of motion (8). Our next goal is to write this equation in a more compact form. Namely, we want to write this equation as follows:
(14)
where
![Rendered by QuickLaTeX.com A](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-25b206f25506e6d6f46be832f7119ffa_l3.png)
![Rendered by QuickLaTeX.com \theta](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-356a08e839ab6974a16448e16e56745d_l3.png)
(15)
By applying this formula to (14), we obtain
(16)
By comparing (16) and (13), we obtain
(17)
From these two equations, we obtain:
(18)
The equation (14) is important since it tells us that the mass will oscillate with the angular frequency of , with the amplitude of
, and with the phase of
. The angular frequency
, where
is the frequency in
and
is the period. Since the angular frequency is our natural frequency, we see that the frequency of oscillation is determined by
(19)
That is, higher the stiffness and smaller the mass, higher is the frequency of oscillation and vice-versa. Also, the frequency of oscillation is independent from the initial condition. That is, the object will oscillate with a predetermined frequency that only depends on the mass and on the spring stiffness. This is the main reason why
![Rendered by QuickLaTeX.com \omega_{n}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-b7bec5d69e54dd9994a3fefd1793a2c6_l3.png)
Now in order to find the constants,
![Rendered by QuickLaTeX.com K_{1},K_{2}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-aff7519248f3f2e2dacf0d8aab640b7f_l3.png)
![Rendered by QuickLaTeX.com t=0](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-b7b41acc5cb99fb07aaa07b445eb2483_l3.png)
![Rendered by QuickLaTeX.com x=0](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-8203ced39e0cdafefa708857c7ec2264_l3.png)
![Rendered by QuickLaTeX.com \dot{x}_{0}](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-dba2400470011a9b568cf9f09b4ffed9_l3.png)
![Rendered by QuickLaTeX.com \dot{x}_{0}=1](https://aleksandarhaber.com/wp-content/ql-cache/quicklatex.com-619550c0bb177160d3ed6f186083a4ff_l3.png)
(20)
Substituting this value in (13) and differentiating, we obtain
(21)
So, the solution is
(22)