# Harmonic oscillator: Wikis

Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.

# Encyclopedia

An undamped spring-mass system is a simple 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. Depending on the friction coefficient, the system can:

• Oscillate with a frequency smaller than in the non-damped case, and an amplitude decreasing with time (underdamped oscillator).
• Decay exponentially to the equilibrium position, without oscillations (overdamped oscillator).

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. The harmonic oscillator model is very important in physics, because any mass subject to a force in stable equilibrium acts as a harmonic oscillator for small vibrations. Harmonic oscillators occur widely in nature and are exploited in many manmade devices, such as clocks and radio circuits. They are the source of virtually all sinusoidal vibrations and waves.

## Simple harmonic oscillator

Simple harmonic motion.

A simple harmonic oscillator is an oscillator that is neither driven nor damped. Its motion is periodic— repeating itself in a sinusoidal fashion with constant amplitude, A. Simple harmonic motion SHM can serve as a mathematical model of a variety of motions, such as a pendulum with small amplitudes and a mass on a spring. It also provides the basis of the characterization of more complicated motions through the techniques of Fourier analysis.

In addition to its amplitude, the motion of a simple harmonic oscillator is characterized by its period T, the time for a single oscillation, its frequency, f, the reciprocal of the period f = 1T (i.e. the number of cycles per unit time), and its phase, φ, which determines the starting point on the sine wave. The period and frequency are constants determined by the overall system, while the amplitude and phase are determined by the initial conditions (position and velocity) of that system. Overall then, the equation describing simple harmonic motion is

$x(t) = A\sin\left( 2\,\pi \,ft+\phi\right)$.

Alternatively a cosine can be used in place of the sine with the phase shifted by π2.

The general differential force equation for an object of mass m experiencing SHM is:

$F = m \frac{\mathrm{d}^2x}{\mathrm{d}t^2} = -k x$,

where k is the spring constant which relates the displacement of the object to the force applied to the object. The general solution for this equation is given above with the frequency of the oscillations given by:

$\displaystyle f = \frac{1}{2 \pi} \sqrt{\frac{k}{m}}$.
The velocity (green arrow) and acceleration (red arrow) oscillate with a quarter and half a period delay from the displacement (black arrow)

The velocity and acceleration of a simple harmonic oscillator oscillate with the same frequency as the position but with shifted phases. The velocity is maximum for zero displacement, while the acceleration is in the opposite direction as the displacement.

The potential energy of SHM is:

$U = \frac{1}{2}kx^2$.

## Damped harmonic oscillator

Dependence of the system behavior on the value of the damping ratio ζ.

In real oscillators friction, or damping, slows the motion of the system. In many vibrating systems the frictional force Ff can be modeled as being proportional to the velocity v of the object: Ff = −cv, where c is the viscous damping coefficient.

Similar damped oscillator behavior occurs for a diverse range of disciplines that include control engineering, mechanical engineering and electrical engineering. The physical quantity that is oscillating varies greatly, and could be the swaying of a tall building in the wind, the speed of an electric motor, or the current through an RLC circuit. Generally, damped harmonic oscillators satisfy:

$\frac{d^2x}{dt^2} + 2\zeta\omega_0\frac{dx}{dt} + \omega_0^{\,2} x = 0$,

where ω0 is the undamped angular frequency of the oscillator and ζ is a constant called the damping ratio. For a mass on a spring having a spring constant k and a damping coefficient c, ω0 = k/m and ζ = c/20.

Step-response of a damped harmonic oscillator; curves are plotted for three values of μ = ω1 = ω01−ζ2. Time is in units of the decay time τ = 1/(ζω0).

The value of the damping ratio ζ critically determines the behavior of the system. A damped harmonic oscillator can be:

• Overdamped (ζ > 1): The system returns (exponentially decays) to equilibrium without oscillating. Larger values of the damping ratio ζ return to equilibrium slower.
• Critically damped (ζ = 1): The system returns to equilibrium as quickly as possible without oscillating. This is often desired for the damping of systems such as doors.
• Underdamped (ζ < 1): The system oscillates (with a slightly different frequency than the undamped case) with the amplitude gradually decreasing to zero.

The angular frequency of the underdamped harmonic oscillator is given by

$\omega_1 = \omega_0\sqrt{1 - \zeta^2}.$

## Driven harmonic oscillators

Driven harmonic oscillators are damped oscillators driven by an externally applied force F(t), for example, a step function, an impulse function or a continuous sinusoidal force. In general, driven harmonic oscillators satisfy the nonhomogeneous second order linear differential equation:

$\frac{d^2x}{dt^2} + 2\zeta\omega_0\frac{dx}{dt} + \omega_0^2 x = \frac{F(t)}{m}\ .$

This equation can be solved exactly for any driving force using the solutions z(t) to the unforced equation, which satisfy:

$\frac{d^2z}{dt^2} + 2\zeta\omega_0\frac{dz}{dt} + \omega_0^2 z = 0\ ,$

and which can be expressed as a damped sinusoidal oscillation:

$z(t) = A e^{-\zeta \omega_0 t} \ \sin \left( \sqrt{1-\zeta^2} \ \omega_0 t + \varphi \right)\ ,$

in the case where ζ ≤ 1. The amplitude A and phase φ determine the behavior needed to match the initial conditions.

### Step input

In the case ζ < 1 and a unit step input with x(0) = 0:

$F(t) = \begin{cases} \omega _0^2 & t \geq 0 \\ 0 & t < 0 \end{cases}$

the solution is:

$x(t) = 1 - e^{-\zeta \omega_0 t} \frac{\sin \left( \sqrt{1-\zeta^2} \ \omega_0 t + \varphi \right)}{\sin(\varphi)} \ ,$

with phase φ given by

$\cos \varphi = \zeta.$

This behavior is found in (for example) feedback amplifiers, where the amplifier design is adjusted to obtain the fastest step response possible without undue overshoot or undershoot and with an adequate settling time.

The time an oscillator needs to adapt to changed external conditions is of the order τ=1/(ζω0). In physics, the adaptation is called relaxation, and τ is called the relaxation time.

In electrical engineering, a multiple of τ is called the settling time, i.e. the time necessary to insure the signal is within a fixed departure from final value, typically within 10%. The term overshoot refers to the extent the maximum response exceeds final value, and undershoot refers to the extent the response falls below final value for times following the maximum response.

### Sinusoidal driving force

In the case of a sinusoidal driving force:

$\frac{d^2x}{dt^2} + 2\zeta\omega_0\frac{dx}{dt} + \omega_0^2 x = \frac{F_{0}\sin(\omega t)}{m} \ ,$

where F0 is the driving amplitude and ω is the driving frequency for a sinusoidal driving mechanism. This type of system appears in AC driven RLC circuits (resistor-inductor-capacitor) and driven spring systems having internal mechanical resistance or external air resistance.

The general solution is a sum of a transient solution that depends on initial conditions, and a steady state that is independent of initial conditions and depends only on the driving amplitude F0, driving frequency, ω, undamped angular frequency ω0, and the damping ratio ζ.

The steady-state solution is proportional to the driving force with an induced phase change of φ:

$x(t) = \frac{F_0}{m Z_m \omega} \sin(\omega t + \phi)$

where

$Z_m = \sqrt{\left(2\omega_0\zeta\right)^2 + \frac{1}{\omega^2}\left(\omega_0^2 - \omega^2\right)^2}$

is the absolute value of the impedance or linear response function and

$\phi = \arctan\left(\frac{2\omega \omega_0\zeta}{\omega^2-\omega_0^2}\right)$

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

For a particular driving frequency called the resonance frequency ωr = ω01-2ζ², the amplitude (for a given F0) is maximum. For underdamped systems the value of the amplitude can become quite large near the resonance frequency.

The transient solutions are the same as the unforced (F0 = 0) damped harmonic oscillator and represent the systems response to other events that occurred previously. The transient solutions typically die out rapidly enough that they can be ignored.

## Parametric oscillators

A parametric oscillator is a harmonic oscillator whose parameters oscillate in time. For example, a well known parametric oscillator is a child on a swing where periodically changing the child's center of gravity causes the swing to oscillate. The varying of the parameters drives the system. Examples of parameters that may be varied are its resonance frequency ω and damping β.

Parametric oscillators are used in many applications. The classical varactor parametric oscillator will oscillate when the diode's capacitance is varied periodically. The circuit that varies the diode's capacitance is called the "pump" or "driver". In microwave electronics, waveguide/YAG based parametric oscillators operate in the same fashion. The designer varies a parameter periodically in order to induce oscillations.

Parametric oscillators have been developed as low-noise amplifiers, especially in the radio and microwave frequency range. Thermal noise is minimal, since a reactance (not a resistance) is varied. Another common use is frequency conversion, e.g., conversion from audio to radio frequencies. For example, the Optical parametric oscillator converts an input laser wave into two output waves of lower frequency (ωsi).

Parametric resonance occurs in a mechanical system when a system is parametrically excited and oscillates at one of its resonant frequencies. Parametric excitation differs from forcing since the action appears as a time varying modification on a system parameter. This effect is different from regular resonance because it exhibits the instability phenomenon.

## Universal oscillator equation

The equation

$\frac{\mathrm{d}^2q}{\mathrm{d} \tau^2} + 2 \zeta \frac{\mathrm{d}q}{\mathrm{d}\tau} + 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{\mathrm{d}^2q}{\mathrm{d} \tau^2} + 2 \zeta \frac{\mathrm{d}q}{\mathrm{d}\tau} + q = \cos(\omega \tau).$

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

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

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{\mathrm{d}^2 q}{\mathrm{d}\tau^2} + 2 \zeta \frac{\mathrm{d}q}{\mathrm{d}\tau} + q = \cos(\omega \tau) + i\sin(\omega \tau) = e^{ i \omega \tau} .$

Supposing the solution is of the form

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

Its derivatives from zero to 2nd order are

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

Substituting these quantities into the differential equation gives

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

Dividing by the exponential term on the left results in

$\,\! -\omega^2 A + 2 \zeta i \omega A + A = e^{-i \phi} = \cos\phi - i \sin\phi .$

Equating the real and imaginary parts results in two independent equations

$A (1-\omega^2)=\cos\phi \qquad 2 \zeta \omega A = - \sin\phi.$

#### Amplitude part

Bode plot of the frequency response of an ideal harmonic oscillator.

Squaring both equations and adding them together gives

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

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

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

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

$\tan\phi = - \frac{2 \zeta \omega}{ 1 - \omega^2} = \frac{2 \zeta \omega}{\omega^2 - 1} \Rightarrow \phi \equiv \phi(\zeta, \omega) = \arctan \left( \frac{2 \zeta \omega}{\omega^2 - 1} \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 (\tau) = A(\zeta,\omega) \cos(\omega \tau + \phi(\zeta,\omega)) = A\cos(\omega \tau + \phi).$

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

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

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{dx}{dt}\,$ Angular velocity $\frac{d\theta}{dt}\,$ Current $\frac{dq}{dt}\,$ $\frac{de}{dt}\,$
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(t)\,$ Drive torque $\tau(t)\,$ $e\,$ $di/dt\,$
Undamped resonant frequency $f_n\,$:
$\frac{1}{2\pi}\sqrt{\frac{K}{M}}\,$ $\frac{1}{2\pi}\sqrt{\frac{\mu}{I}}\,$ $\frac{1}{2\pi}\sqrt{\frac{1}{LC}}\,$ $\frac{1}{2\pi}\sqrt{\frac{1}{LC}}\,$
Differential equation:
$M\ddot x + \gamma\dot x + Kx = F\,$ $I\ddot \theta + \Gamma\dot \theta + \mu \theta = \tau\,$ $L\ddot q + R\dot q + q/C = e\,$ $C\ddot 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(x) = \frac{1}{2} k x^2$

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

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

Because V(x0) is a minimum, the first derivative evaluated at x0 must be zero, so the linear term drops out:

$V(x) = V(x_0) + \frac{1}{2} (x-x_0)^2 V^{(2)}(x_0) + O(x-x_0)^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(x) \approx \frac{1}{2} x^2 V^{(2)}(0) = \frac{1}{2} k x^2$

Thus, given an arbitrary potential energy function V(x) 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

A simple pendulum exhibits simple harmonic motion under the conditions of no damping and small amplitude.

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

${\mathrm{d}^2\theta\over \mathrm{d}t^2}+{g\over \ell}\theta=0.$

The solution to this equation is given by:

$\theta(t) = \theta_0\cos\left(\sqrt{g\over \ell}t\right) \quad\quad\quad\quad |\theta_0| \ll 1$

where θ0 is the largest angle attained by the pendulum. The period, the time for one complete oscillation, is given by divided by whatever is multiplying the time in the argument of the cosine ($\sqrt{g\over \ell}$ here).

$T_0 = 2\pi\sqrt{\ell\over g}\quad\quad\quad\quad |\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=2\pi f = \frac{2\pi}{T}.$

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

Spring–mass system in equilibrium (A), compressed (B) and stretched (C) states.

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( t \right) =-kx \left( t \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.

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(t) = -kx(t) = m \frac {\mathrm{d}^{2}}{\mathrm{d}{t}^{2}} x \left( t \right) = ma.$

...the latter evidently being Newton's second law of motion.

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

$x \left( t \right) =A \cos \left( \sqrt{k \over m}t \right).$

Given an ideal massless spring, m is the mass on the end of the spring. If the spring itself has mass, its effective mass must be included in m.

#### Energy variation in the spring–damping 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 = kx2 / 2.

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 not all its potential energy is converted into kinetic energy of the mass.

## In-line notes and 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. ed.). W. H. Freeman. ISBN 1-57259-492-6.
• Wylie, C. R. (1975). Advanced Engineering Mathematics (4th ed. ed.). McGraw-Hill. ISBN 0-07-072180-7.