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.
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.
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 , we can write the last equation as follows:
(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 is the natural frequency. You will see later in this lecture why this quantity is called the natural frequency.
The next step is to solve the equation of motion. We assume a solution of the following form:
(5)
where is a complex number. By substituting (5) in (3), we obtain
(6)
or compactly
(7)
Since cannot be equal to zero, the only possibility is that
(8)
The equation (8) is called the auxiliary equation. The soluton of this equation is given by
(9)
where is the imaginary unit. Now, the solution can be written as follows:
(10)
where are constants. We want to get rid of the imaginary unit in the equation (10). This can be done by using the Euler’s formula:
(11)
where is an arbitrary real number. By applying this formula to (10), we obtain
(12)
where we used the fact that and . Finally by introducing new constants and , we can write the equation (16) as follows:
(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 is the ampliture of oscillation and is the phase angle. We recall the addition formula:
(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 is called the natural frequency.
Now in order to find the constants, or the amplitude and the phase, we need to include the initial conditions. Let us assume that at the time instant , the position of the object was at and that the velocity is . Let us substitute these initial conditions in the solution (13). We have
(20)
Substituting this value in (13) and differentiating, we obtain
(21)
So, the solution is
(22)