HarmonicOscillator - Maple Help

Online Help

All Products    Maple    MapleSim

Vibrational Motion and the Harmonic Oscillator

Copyright (c) RDMCHEM LLC 2021




Vibrational Motion



Vibrational motion of molecules can be modeled around the equilibrium geometry to a good approximation by a harmonic oscillator.  In this lesson we will model several diatomic molecules by harmonic oscillators.   The harmonic oscillator model consists of a particle in a parabolic potential:

Vx = 12kx2

where x is the displacement coordinate and k is a constant, often known as the spring constant.  From the mass m of the particle and the spring constant k the angular frequency ω of the oscillator can be computed from

    ω = km.

A diatomic molecule can be modeled by a harmonic oscillator through two steps.  (1) The diatomic molecule A-B with masses mA and mB of the atoms A and B separated by a distance R can be represented by a single particle with reduced mass μ oscillating about the equilibrium bond distance Req−the distance at which the minimum potential energy occurs.  Specifically, we can define the reduced mass μ as

μ = m__Am__Bm__A+m__B

and the displacement coordinate x as

x = R  R__eq .

(2) The potential energy of the diatomic molecule as a function of the displacement coordinate x can be approximated as a parabolic potential.  While the actual potential energy W(x) is not parabolic (see the blue curve in Fig. 1), it can be approximated in the vicinity of the equilibrium bond distance Req by a parabolic potential  (see the red curve in Fig.1)

Wx W__0+12kx2  

where the force constant k is the second derivative of the actual potential energy W(x) with respect to x (or by the chain rule R)

k = ⅆ2ⅆx2Wx=ⅆ2ⅆR2WR .

Figure 1: Exact (blue) and harmonic (red) potential energy curves of diatomic nitrogen


In this lesson for several diatomic molecules we will explore their approximations as harmonic oscillators by computing for each of them: a force constant k, a reduced mass μ, and the angular frequency ω.  From the angular frequency we can compute the energies of the oscillators

E__n=n+12 ℏω

and the energy differences

ΔE=ℏω .

The harmonic oscillator approximation can be extended to polyatomic molecules through coupled harmonic oscillators and their normal modes (which is discussed in a different lesson).

Vibrational Motion

We will model three diatomic molecules hydrogen fluoride HF, diatomic nitrogen N2, and carbon monoxide CO.  Computed properties will complete the following Table:


Table 1: Harmonic Oscillator Approximation of Diatomic Molecules


Reduced Mass (μ)

Spring Constant (k)

Angular Frequency (ω)

Energy Spacing (ΔE)

















(a) Use the worksheet below to compute these properties for HF.


(b) Modify the worksheet below to complete the table for N2 and CO.


Quantum Chemistry

We set the number of Digits to be used in computations to 15 and load the Quantum Chemistry package using Maple's with command.

Digits  15;






Diatomic Molecule A-B

Reduced Mass

Here we set the variables A and B to the strings of the atoms in the diatomic molecule (By changing these values, you can use the worksheet to treat other diatomic molecules!)

A  H;B  F;




We use the AtomicData command in the Quantum Chemistry package to obtain the masses as well as other data

dataA  AtomicDataA;



dataB  AtomicDataB;



Set the masses

mA  dataAatomicweight;



mB  dataBatomicweight;



Compute the reduced mass in amu

mu0  mAmBmA+mB;



Convert the reduced mass from amu to kg

mu  convertmu0,units,'kg';



Spring constant

To compute the equilibrium bond length and spring constant, we select a set of bond distances from the roots of the sixth-order Chebyshev polynomial that are suitable for interpolation

bonds  mapx  x/5+1.05, fsolveexpandChebyshevT6,x;



We define a list of molecular geometries with each geometry corresponding to one of the bond distances

molecules mapR A,0,0,0,B,0,0,R, bonds;



The energies for each geometry may be then readily computed with the Energy command in the Quantum Chemistry package.

energies  mapEnergy,molecules,basis=cc-pVDZ;



We use polynomial interpolation to generate a polynomial in the bond distance R

pes  interpbonds,energies,R;



The potential energy surface (curve) can be plotted

plotpesR, R=bonds1..bonds1, axes=boxed, labels='R','E', color=blue, thickness=3;

Finally, we differential the potential energy curve with respect to R and set the derivative to zero.

eq  diffpes, R = 0;



Solving the resulting equation yields the equilibrium bond length

R_eq  fsolveeq, R=bonds1..bonds1;



Differentiating the potential energy curve yields

d2pes  diffpes,R$2;



We define the atomic units of the spring constant

unit_factor  UnitsUnit'hartree'UnitsUnit'angstrom'2;



Evaluating the second derivative at the equilibrium bond distance gives the spring constant

k0  subsR=R_eq, d2pesunit_factor;



We convert the atomic units to standard international (SI) units

k  convertk0,units,'Jm2';



Angular Frequency

We compute the angular frequency ω in terms of k and μ and then simplify the units

omega0  sqrtkmu;



omega  simplifyomega0;



Energy Spacing

We define Z from Maple's knowledge of scientific constants

hbar  evalfScientificConstantsConstant'hbar', units;



Using Z and ω, we compute the ΔE between energy levels (which is a constant)

dE0  hbaromega;



The units can be combined with the simplify command

dE  simplifydE0;




The computed potential energy curve (blue) can be plotted against the harmonic potential energy curve (red) to assess the approximation

k0  convertk0,unit_free:W0  subsR=R_eq,pes:p_ex plotpes, R=bonds1..bonds1, axes=boxed, labels='R','E', color=blue, thickness=3:p_ho plotW0+k0RR_eq2, R=bonds1..bonds1, axes=boxed, labels='R','E', color=red, thickness=3:plotsdisplayp_ex,p_ho;



D. J. Griffiths and D. F. Schroeter, Introduction to Quantum Mechanics 3rd Edition (Cambridge University Press, 2018).


I. N. Levine, Quantum Chemistry 7th Edition (Pearson, New York, 2017).


J. J. Sakurai and J. Napolitano, Modern Quantum Mechanics 2nd Edition (Cambridge University Press, Cambridge, 2017).


J. P. Lowe, Quantum Chemistry Illustrated Edition (Academic Press, New York, 2012).


P. W. Atkins and R. S. Friedman, Molecular Quantum Mechanics 5th Edition (Oxford University Press, Oxford, 2010).


D. A. McQuarrie, Quantum Chemistry 2nd Edition (University Science, New York, 2007).


D. A. McQuarrie and J. D. Simon, Physical Chemistry: A Molecular Approach (University Science, New York, 1997).