Definitions
Nearby Words

# Harmonic oscillator

In classical mechanics, a harmonic oscillator is a system which, when displaced from its equilibrium position, experiences a restoring force $F$ proportional to the displacement $x$ according to Hooke's law:

$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 equilibrium point, with a constant amplitude and a constant frequency (which does not depend on the amplitude).

If a frictional force (damping) proportional to the velocity is also present, the harmonic oscillator is described as a damped oscillator. In such situation, the frequency of the oscillations is smaller than in the non-damped case, and the amplitude of the oscillations decreases with time.

If an external time-dependent force is present, the harmonic oscillator is described as a driven oscillator.

Mechanical examples include pendula (with small angles of displacement), masses connected to springs, and acoustical systems. Other analogous systems include electrical harmonic oscillators such as RLC circuits (see Equivalent systems below). The analysis of the harmonic oscillator exhibits the paradox that there is almost no ideal, or perfect, harmonic oscillator in nature or by manufacture, yet it is a system of profound importance in mathematics, physics and applied science.

## Simple harmonic oscillator

The simple harmonic oscillator has no driving force, and no friction (damping), so the net force is just:

$F = -k x$

Using Newton's Second Law of motion,

$F = m a = -k x ,$

The acceleration, $a$ is equal to the second derivative of $x$.

$m frac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} = -k x$

If we define $\left\{omega_0\right\}^2 = k/m$, then the equation can be written as follows,

$frac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} + \left\{omega_0\right\}^2 x = 0$

Define $dot x = frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\}$.
We observe that:

$frac\left\{mathrm\left\{d\right\}^2 x\right\}\left\{mathrm\left\{d\right\} t^2\right\} = ddot x = frac\left\{mathrm\left\{d\right\}dot \left\{x\right\}\right\}\left\{mathrm\left\{d\right\}t\right\}frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}x\right\}=frac\left\{mathrm\left\{d\right\}dot \left\{x\right\}\right\}\left\{mathrm\left\{d\right\}x\right\}frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\}=frac\left\{mathrm\left\{d\right\}dot\left\{x\right\}\right\}\left\{mathrm\left\{d\right\}x\right\}dot \left\{x\right\}$
and substituting
$frac\left\{mathrm\left\{d\right\} dot\left\{x\right\}\right\}\left\{mathrm\left\{d\right\}x\right\}dot x + \left\{omega_0\right\}^2 x = 0$
$mathrm\left\{d\right\} dot\left\{x\right\}cdot dot x + \left\{omega_0\right\}^2 x cdot mathrm\left\{d\right\}x = 0$
integrating
$dot\left\{x\right\}^2 + \left\{omega_0\right\}^2 x^2 = K$
where K is the integration constant, set K = (A ω0)2
$dot\left\{x\right\}^2 = A^2 \left\{omega_0\right\}^2-\left\{omega_0\right\}^2 x^2$
$dot\left\{x\right\} = pm \left\{omega_0\right\} sqrt\left\{A^2 - x^2\right\}$
$frac \left\{mathrm\left\{d\right\}x\right\}\left\{pm sqrt\left\{A^2 - x^2\right\}\right\} = \left\{omega_0\right\}mathrm\left\{d\right\}t$
integrating, the results (including integration constant ϕ) are
$begin\left\{cases\right\} arcsin\left\{frac \left\{x\right\}\left\{A\right\}\right\}= omega_0 t + phi arccos\left\{frac \left\{x\right\}\left\{A\right\}\right\}= omega_0 t + phi end\left\{cases\right\}$

and has the general solution

$x = A cos \left\{\left(omega_0 t + phi\right)\right\} ,$

where the amplitude $A ,$ and the phase $phi ,$ are determined by the initial conditions.

Alternatively, the general solution can be written as

$x = A sin \left\{\left(omega_0 t + phi\right)\right\} ,$

where the value of $phi ,$ is shifted by $pi/2 ,$ relative to the previous form;

or as

$x = C_1 sin\left\{omega_0 t\right\} + C_2 cos\left\{omega_0 t\right\} ,$

where $C_1 ,$ and $C_2 ,$ are the constants which are determined by the initial conditions.

The frequency of the oscillations is given by


`  displaystyle`
`  f`
`  =`
`  frac`
{omega_0} {2 pi}
`  =`
frac{1}{2 pi} sqrt{frac{k}{m}}

The kinetic energy is

$K = frac\left\{1\right\}\left\{2\right\} m left\left(frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\}right\right)^2 = frac\left\{1\right\}\left\{2\right\} k A^2 sin^2\left(omega_0 t + phi\right)$.

and the potential energy is

$U = frac\left\{1\right\}\left\{2\right\} k x^2 = frac\left\{1\right\}\left\{2\right\} k A^2 cos^2\left(omega_0 t + phi\right)$

so the total energy of the system has the constant value

$E = frac\left\{1\right\}\left\{2\right\} k A^2.$

## Driven harmonic oscillator

A driven harmonic oscillator satisfies the nonhomogeneous second order linear differential equation

$frac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} + \left\{omega_0\right\}^2x = A_0 cos\left(omega t\right),$

where $A_\left\{0\right\}$ is the driving amplitude and $omega$ is the driving frequency for a sinusoidal driving mechanism. This type of system appears in AC LC (inductor-capacitor) circuits and idealized spring systems lacking internal mechanical resistance or external air resistance.

## Damped harmonic oscillator

A damped harmonic oscillator satisfies the second order differential equation

$frac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} + frac\left\{b\right\}\left\{m\right\} frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\} + \left\{omega_0\right\}^2x = 0,$

where $b$ is an experimentally determined damping constant satisfying the relationship $F = -bv$. An example of a system obeying this equation would be a weighted spring underwater if the damping force exerted by the water is assumed to be linearly proportional to $v$.

The frequency of the damped harmonic oscillator is given by

$omega_1 = sqrt\left\{omega_0^2 - R_m^2\right\}$
where

$R_m=frac\left\{b\right\}\left\{2m\right\}.$

## Damped, driven harmonic oscillator

This satisfies the equation

$mfrac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} + r frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\} + kx= F_0 cos\left(omega t\right).$

The general solution is a sum of a transient (the solution for damped undriven harmonic oscillator, homogeneous ODE) that depends on initial conditions, and a steady state (particular solution of the nonhomogenous ODE) that is independent of initial conditions and depends only on driving frequency, driving force, restoring force, damping force,

$x\left(t\right) = frac\left\{F_0\right\}\left\{Z_m omega\right\} sin\left(omega t - phi\right)$

where

$Z_m = sqrt\left\{r^2 + left\left(omega m - frac\left\{k\right\}\left\{omega\right\}right\right)^2\right\}$

is the absolute value of the impedance or linear response function

$Z = r + ileft\left(omega m - frac\left\{k\right\}\left\{omega\right\}right\right)$

and

$phi = arctanleft\left(frac\left\{omega m - frac\left\{k\right\}\left\{omega\right\}\right\}\left\{r\right\}right\right)$

is the phase of the oscillation relative to the driving force.

One might see that for a certain driving frequency, $omega$, the amplitude (relative to a given $F_0$) is maximal. This occurs for the frequency

$\left\{omega\right\}_r = sqrt\left\{frac\left\{k\right\}\left\{m\right\} - 2left\left(frac\left\{r\right\}\left\{2 m\right\}right\right)^2\right\}$

and is called .

In summary: at a steady state the frequency of the oscillation is the same as that of the driving force, but the oscillation is phase-offset and scaled by amounts that depend on the frequency of the driving force in relation to the preferred (resonant) frequency of the oscillating system.

Example: RLC circuit.

## Full mathematical definition

Most harmonic oscillators, at least approximately, solve the differential equation:

$frac\left\{mathrm\left\{d\right\}^2x\right\}\left\{mathrm\left\{d\right\}t^2\right\} + frac\left\{b\right\}\left\{m\right\} frac\left\{mathrm\left\{d\right\}x\right\}\left\{mathrm\left\{d\right\}t\right\} + \left\{omega_0\right\}^2x = A_0 cos\left(omega t\right)$

where t is time, b is the damping constant, ωo is the characteristic angular frequency, and Aocos(ωt) represents something driving the system with amplitude Ao and angular frequency ω. x is the measurement that is oscillating; it can be position, current, or nearly anything else. The angular frequency is related to the frequency, f, by

$f = frac\left\{omega\right\}\left\{2 pi\right\}.$

### Important terms

• Amplitude: maximal displacement from the equilibrium.
• Period: the time it takes the system to complete an oscillation cycle. Inverse of frequency.
• Frequency: the number of cycles the system performs per unit time (usually measured in hertz = 1/s).
• Angular frequency: $omega = 2 pi f$
• Phase: how much of a cycle the system completed (system that begins is in phase zero, system which completed half a cycle is in phase $pi$).
• Initial conditions: the state of the system at t = 0, the beginning of oscillations.

## Universal oscillator equation

The equation
$frac\left\{mathrm\left\{d\right\}^2q\right\}\left\{mathrm\left\{d\right\} tau^2\right\} + 2 zeta frac\left\{mathrm\left\{d\right\}q\right\}\left\{mathrm\left\{d\right\}tau\right\} + q = 0$

is known as the universal oscillator equation since all second order linear oscillatory systems can be reduced to this form. This is done through nondimensionalization.

If the forcing function is f(t) = cos(ωt) = cos(ωtcτ) = cos(ωτ), where ω = ωtc, the equation becomes

$frac\left\{mathrm\left\{d\right\}^2q\right\}\left\{mathrm\left\{d\right\} tau^2\right\} + 2 zeta frac\left\{mathrm\left\{d\right\}q\right\}\left\{mathrm\left\{d\right\}tau\right\} + q = cos\left(omega tau\right).$

The solution to this differential equation contains two parts, the "transient" and the "steady state".

### Transient solution

The solution based on solving the ordinary differential equation is for arbitrary constants c1 and c2 is

$q_t \left(tau\right) = begin\left\{cases\right\} e^\left\{-zetatau\right\} left\left(c_1 e^\left\{tau sqrt\left\{zeta^2 - 1\right\}\right\} + c_2 e^\left\{- tau sqrt\left\{zeta^2 - 1\right\}\right\} right\right) & zeta > 1 mbox\left\{\left(overdamping\right)\right\} e^\left\{-zetatau\right\} \left(c_1+c_2 tau\right) = e^\left\{-tau\right\}\left(c_1+c_2 tau\right) & zeta = 1 mbox\left\{\left(critical damping\right)\right\} e^\left\{-zeta tau\right\} left\left[c_1 cos left\left(sqrt\left\{1-zeta^2\right\} tauright\right) +c_2 sinleft\left(sqrt\left\{1-zeta^2\right\} tauright\right) right\right] & zeta < 1 mbox\left\{\left(underdamping\right)\right\} end\left\{cases\right\}$

The transient solution is independent of the forcing function. If the system is critically damped, the response is independent of the damping.

Apply the "complex variables method" by solving the auxiliary equation below and then finding the real part of its solution:
$frac\left\{mathrm\left\{d\right\}^2 q\right\}\left\{mathrm\left\{d\right\}tau^2\right\} + 2 zeta frac\left\{mathrm\left\{d\right\}q\right\}\left\{mathrm\left\{d\right\}tau\right\} + q = cos\left(omega tau\right) + isin\left(omega tau\right) = e^\left\{ i omega tau\right\} .$

Supposing the solution is of the form

$,! q_s\left(tau\right) = A e^\left\{i \left(omega tau + phi \right) \right\} .$

Its derivatives from zero to 2nd order are

$q_s = A e^\left\{i \left(omega tau + phi \right) \right\}, frac\left\{mathrm\left\{d\right\}q_s\right\}\left\{mathrm\left\{d\right\} tau\right\} = i omega A e^\left\{i \left(omega tau + phi \right) \right\}, frac\left\{mathrm\left\{d\right\}^2 q_s\right\}\left\{mathrm\left\{d\right\} tau^2\right\} = - omega^2 A e^\left\{i \left(omega tau + phi \right) \right\} .$

Substituting these quantities into the differential equation gives

$,! -omega^2 A e^\left\{i \left(omega tau + phi\right)\right\} + 2 zeta i omega A e^\left\{i\left(omega tau + phi\right)\right\} + A e^\left\{i\left(omega tau + phi\right)\right\} = \left(-omega^2 A , + , 2 zeta i omega A , + , A\right) e^\left\{i \left(omega tau + phi\right)\right\} = e^\left\{i omega tau\right\} .$

Dividing by the exponential term on the left results in

$,! -omega^2 A + 2 zeta i omega A + A = e^\left\{-i phi\right\} = cosphi - i sinphi .$

Equating the real and imaginary parts results in two independent equations

$A \left(1-omega^2\right)=cosphi qquad 2 zeta omega A = - sinphi.$

#### Amplitude part

Squaring both equations and adding them together gives

$left . begin\left\{matrix\right\}A^2 \left(1-omega^2\right)^2 = cos^2phi \left(2 zeta omega A\right)^2 = sin^2phi end\left\{matrix\right\} right \right\} Rightarrow A^2\left[\left(1-omega^2\right)^2 + \left(2 zeta omega\right)^2\right] = 1.$

By convention the positive root is taken since amplitude is usually considered a positive quantity. Therefore,

$A = A\left(zeta, omega\right) = frac\left\{1\right\}\left\{sqrt\left\{\left(1-omega^2\right)^2 + \left(2 zeta omega\right)^2\right\}\right\}.$

Compare this result with the theory section on resonance, as well as the "magnitude part" of the RLC circuit. This amplitude function is particularly important in the analysis and understanding of the frequency response of second-order systems.

#### Phase part

To solve for φ, divide both equations to get
$tanphi = - frac\left\{2 zeta omega\right\}\left\{ 1 - omega^2\right\} = frac\left\{2 zeta omega\right\}\left\{omega^2 - 1\right\} Rightarrow phi equiv phi\left(zeta, omega\right) = arctan left\left(frac\left\{2 zeta omega\right\}\left\{omega^2 - 1\right\} right \right).$

This phase function is particularly important in the analysis and understanding of the frequency response of second-order systems.

### Full solution

Combining the amplitude and phase portions results in the steady-state solution
$,! q_s \left(tau\right) = A\left(zeta,omega\right) cos\left(omega tau + phi\left(zeta,omega\right)\right) = Acos\left(omega tau + phi\right).$

The solution of original universal oscillator equation is a superposition (sum) of the transient and steady-state solutions

$,! q\left(tau\right) = q_t \left(tau\right) + q_s \left(tau\right).$

For a more complete description of how to solve the above equation, see linear ODEs with constant coefficients.

## Equivalent systems

Harmonic oscillators occurring in a number of areas of engineering are equivalent in the sense that their mathematical models are identical (see universal oscillator equation above). Below is a table showing analogous quantities in four harmonic oscillator systems in mechanics and electronics. If analogous parameters on the same line in the table are given numerically equal values, the behavior of the oscillators will be the same.

Translational Mechanical Torsional Mechanical Series RLC Circuit Parallel RLC Circuit
Position $x,$ Angle $theta,$ Charge $q,$ Voltage $e,$
Velocity $frac\left\{dx\right\}\left\{dt\right\},$ Angular velocity $frac\left\{dtheta\right\}\left\{dt\right\},$ Current $frac\left\{dq\right\}\left\{dt\right\},$ $frac\left\{de\right\}\left\{dt\right\},$
Mass $M,$ Moment of inertia $I,$ Inductance $L,$ Capacitance $C,$
Spring constant $K,$ Torsion constant $mu,$ Elastance $1/C,$ Susceptance $1/L,$
Friction $gamma,$ Rotational friction $Gamma,$ Resistance $R,$ Conductance $1/R,$
Drive force $F\left(t\right),$ Drive torque $tau\left(t\right),$ $e,$ $di/dt,$
Undamped resonant frequency $f_n,$:
$frac\left\{1\right\}\left\{2pi\right\}sqrt\left\{frac\left\{K\right\}\left\{M\right\}\right\},$ $frac\left\{1\right\}\left\{2pi\right\}sqrt\left\{frac\left\{mu\right\}\left\{I\right\}\right\},$ $frac\left\{1\right\}\left\{2pi\right\}sqrt\left\{frac\left\{1\right\}\left\{LC\right\}\right\},$ $frac\left\{1\right\}\left\{2pi\right\}sqrt\left\{frac\left\{1\right\}\left\{LC\right\}\right\},$
Differential equation:
$Mddot x + gammadot x + Kx = F,$ $Iddot theta + Gammadot theta + mu theta = tau,$ $Lddot q + Rdot q + q/C = e,$ $Cddot e + dot e/R + e/L = dot i,$

## Applications

The problem of the simple harmonic oscillator occurs frequently in physics because a mass at equilibrium under the influence of any conservative force, in the limit of small motions, will behave as a simple harmonic oscillator.

A conservative force is one that has a potential energy function. The potential energy function of a harmonic oscillator is:

$V\left(x\right) = frac\left\{1\right\}\left\{2\right\} k x^2$

Given an arbitrary potential energy function $V\left(x\right)$, one can do a Taylor expansion in terms of $x$ around an energy minimum ($x = x_0$) to model the behavior of small perturbations from equilibrium.

$V\left(x\right) = V\left(x_0\right) + \left(x-x_0\right) V\text{'}\left(x_0\right) + frac\left\{1\right\}\left\{2\right\} \left(x-x_0\right)^2 V^\left\{\left(2\right)\right\}\left(x_0\right) + O\left(x-x_0\right)^3$

Because $V\left(x_0\right)$ is a minimum, the first derivative evaluated at $x_0$ must be zero, so the linear term drops out:

$V\left(x\right) = V\left(x_0\right) + frac\left\{1\right\}\left\{2\right\} \left(x-x_0\right)^2 V^\left\{\left(2\right)\right\}\left(x_0\right) + O\left(x-x_0\right)^3$

The constant term V(x0) is arbitrary and thus may be dropped, and a coordinate transformation allows the form of the simple harmonic oscillator to be retrieved:

$V\left(x\right) approx frac\left\{1\right\}\left\{2\right\} x^2 V^\left\{\left(2\right)\right\}\left(0\right) = frac\left\{1\right\}\left\{2\right\} k x^2$

Thus, given an arbitrary potential energy function $V\left(x\right)$ with a non-vanishing second derivative, one can use the solution to the simple harmonic oscillator to provide an approximate solution for small perturbations around the equilibrium point.

## Examples

### Simple pendulum

Assuming no damping and small amplitudes, the differential equation governing a simple pendulum is

$\left\{mathrm\left\{d\right\}^2thetaover mathrm\left\{d\right\}t^2\right\}+\left\{gover ell\right\}theta=0.$

The solution to this equation is given by:

$theta\left(t\right) = theta_0cosleft\left(sqrt\left\{gover ell\right\}tright\right) quadquadquadquad |theta_0| ll 1$

where $theta_0$ is the largest angle attained by the pendulum. The period, the time for one complete oscillation , is given by $2pi$ divided by whatever is multiplying the time in the argument of the cosine

$T_0 = 2pisqrt\left\{ellover g\right\}quadquadquadquad |theta_0| ll 1.$

### Pendulum swinging over turntable

Simple harmonic motion can in some cases be considered to be the one-dimensional projection of two-dimensional circular motion. Consider a long pendulum swinging over the turntable of a record player. On the edge of the turntable there is an object. If the object is viewed from the same level as the turntable, a projection of the motion of the object seems to be moving backwards and forwards on a straight line. It is possible to change the frequency of rotation of the turntable in order to have a perfect synchronization with the motion of the pendulum.

The angular speed of the turntable is the pulsation of the pendulum.

In general, the pulsation-also known as angular frequency, of a straight-line simple harmonic motion is the angular speed of the corresponding circular motion.

Therefore, a motion with period T and frequency f=1/T has pulsation

$omega=2pi f = frac\left\{2pi\right\}\left\{T\right\}.$

In general, pulsation and angular speed are not synonymous. For instance the pulsation of a pendulum is not the angular speed of the pendulum itself, but it is the angular speed of the corresponding circular motion.

### Spring-mass system

When a spring is stretched or compressed by a mass, the spring develops a restoring force. Hooke's law gives the relationship of the force exerted by the spring when the spring is compressed or stretched a certain length:

$F left\left(t right\right) =-kx left\left(t right\right)$

where F is the force, k is the spring constant, and x is the displacement of the mass with respect to the equilibrium position.

This relationship shows that the distance of the spring is always opposite to the force of the spring.

By using either force balance or an energy method, it can be readily shown that the motion of this system is given by the following differential equation:

$F\left(t\right) = -kx\left(t\right) = m frac \left\{mathrm\left\{d\right\}^\left\{2\right\}\right\}\left\{mathrm\left\{d\right\}\left\{t\right\}^\left\{2\right\}\right\} x left\left(t right\right) = ma.$

...the latter evidently being _law_of_resultant_force.

If the initial displacement is A, and there is no initial velocity, the solution of this equation is given by:

$x left\left(t right\right) =Acos left\left(\left(sqrt \left\{k/m\right\}\right) tright\right).$

#### Energy variation in the spring-damper system

In terms of energy, all systems have two types of energy, potential energy and kinetic energy. When a spring is stretched or compressed, it stores elastic potential energy, which then is transferred into kinetic energy. The potential energy within a spring is determined by the equation $U = 1/2,k\left\{x\right\}^\left\{2\right\}.$

When the spring is stretched or compressed, kinetic energy of the mass gets converted into potential energy of the spring. By conservation of energy, assuming the datum is defined at the equilibrium position, when the spring reaches its maximum potential energy, the kinetic energy of the mass is zero. When the spring is released, the spring will try to reach back to equilibrium, and all its potential energy is converted into kinetic energy of the mass.

## References

• Serway, Raymond A.; Jewett, John W. (2003). Physics for Scientists and Engineers. Brooks/Cole. ISBN 0-534-40842-7.
• Tipler, Paul (1998). Physics for Scientists and Engineers: Vol. 1. 4th ed., W. H. Freeman. ISBN 1-57259-492-6.
• Wylie, C. R. (1975). Advanced Engineering Mathematics. 4th ed., McGraw-Hill. ISBN 0-07-072180-7.