Modal analysis is a set of mathematical techniques for determining the modal characteristics of a dynamical system. Modal analysis can be used to determine the resonant frequencies and vibration responses of a structure and is closely related to failure analysis. The technique often assumes a system to behave linearly as an approximation so that matrix algebra can be used, for which computers are especially well suited. This assumption turns out to be pretty good, in fact, as unperson points out, since stable equilibrium configurations correspond to local minima in potential energy, which can be approximated locally by parabolas, the hallmarks of the simple harmonic oscillator.

Consider three masses m_{1} = m, m_{2} = M, and m_{3} = m constrained to move along a single direction, say, the x axis, with m_{1} and m_{3} on either side of m_{2}. Now join m_{1} and m_{3} separately to m_{2} with two springs having spring constants equal to k. Let the three generalized coordinates of the masses be x_{1}, x_{2} and x_{3}, each of which are zero at the equilibrium positions of the masses.

The total kinetic energy of the system is

T = ½m(dx_{1}/dt)^{2} +
½M(dx_{2}/dt)^{2} + ½m(dx_{3}/dt)^{2}

From Hooke's law, the total potential energy of the system is

V = ½k(x_{2}-x_{1})^{2} + ½k(x_{3}-x_{2})^{2}

V = ½kx_{1}^{2} + kx_{2}^{2} + ½kx_{3}^{2} - kx_{1}x_{2} - kx_{2}x_{3}

So the Lagrangian for the system is L = T - V:

L =
½m(dx_{1}/dt)^{2} +
½M(dx_{2}/dt)^{2} + ½m(dx_{3}/dt)^{2}
- ½kx_{1}^{2} - kx_{2}^{2} - ½kx_{3}^{2} + kx_{1}x_{2} + kx_{2}x_{3}

Now, assuming there aren't any damping forces present, we can obtain the equations of motion from

d/dt (∂L/∂x'_{i}) - ∂L/∂x_{i} = 0

Where x'_{i} is taken to be dx_{i}/dt. So,

∂L/∂x'_{1} = mx_{1}

∂L/∂x_{1} = kx_{1} - kx_{2}

∂L/∂x'_{2} = Mx_{2}

∂L/∂x_{2} = 2kx_{2} - kx_{1} - kx_{3}

∂L/∂x'_{3} = mx_{3}

∂L/∂x_{3} = kx_{3} - kx_{2}

This results in a set of three equations:

md^{2}x_{1}/dt^{2} - kx_{1} + kx_{2} = 0

Md^{2}x_{2}/dt^{2} - 2kx_{2} + kx_{1} + kx_{3} = 0

md^{2}x_{3}/dt^{2} - kx_{3} + kx_{2} = 0

Now, we let **x** = [x_{1}, x_{2}, x_{3}]^{T} and **x**" = [d^{2}x_{1}/dt^{2},
d^{2}x_{2}/dt^{2},
d^{2}x_{3}/dt^{2}]^{T}, and define the following matrices:

/m 0 0\
**M** = |0 M 0|
\0 0 m/
/ k -k 0\
**K** = |-k 2k -k|
\ 0 -k k/

Here **M** is the mass matrix and **K** is the stiffness matrix, although in general these matrices may be in units other than that of mass or stiffness. With these definitions, we may write our equations of motion as:

**M****x**" - **K****x** = 0

Now we may make a series of substitutions in order to simplify calculations. First, we define the matrix square root. The square root of a matrix **A**, if defined, is **A**^{½} such that **A**^{½} **A**^{½} = **A**. A convenient way of finding the square root of a matrix is by noting that if A is diagonalizable by an orthogonal matrix **P**, such that **P**^{T}**A****P** = **D** where **D** is a diagonal matrix, then **A**^{½} = **P****D**^{½}**P**^{T}. This is because **P****P**^{T} = **P**^{T}**P** = **I** and **P****D**^{½}**P**^{T}**P****D**^{½}**P**^{T} = **P****D**^{½}**D**^{½}**P**^{T} = **P****D****P**^{T} = **A**.

For those unfamiliar with the diagonalization process, **D** is a diagonal matrix with diagonal entries being the eigenvalues of **A**. The columns of **P** are the eigenvectors of **A** corresponding to the eigenvalues of **A**. The columns must be in the same order as their corresponding eigenvectors in **D**.

Now **D**^{½} is easy to calculate because only the diagonal terms in **D** are present, so we take their square roots individually. Finally, let **D**^{-½} be the inverse of **D**^{½}.

With these in place, let **x** = **M**^{-½}**q**, or equivalently let **q** = **M**^{½}**x**. In our example. We do not need to use diagonalization to calculate **M**^{-½} because **M** is already a diagonal matrix. Therefore substitute into the equation of motion to obtain

**M****M**^{-½}**q**" - **K****M**^{-½}**q** = 0

Left multiply by **M**^{-½} to obtain

**M**^{-½}**M****M**^{-½}**q**" - **M**^{-½}**K****M**^{-½}**q** = 0

**q**" - **M**^{-½}**K****M**^{-½}**q** = 0

Now, let **K** = **M**^{-½}**K****M**^{-½}, which is the modified stiffness matrix. At this point we obtain

**q**" - **K****q** = 0

This is an eigenvalue problem and can be solved directly, but to further simplify the problem, we can turn use some more substitution. First, we must diagonalize **K**, i.e. find a matrix **P**, such that **P**^{T}**K****P** = **D** where **D** is a diagonal matrix. Then let **q** = **P****r** so that

**P****r**" - **K****P****r** = 0

This time, left multiply by **P**^{T} so that:

**P**^{T}**P****r**" - **P**^{T}**K****P****r** = 0

**r**" - **D****r** = 0

With the problem simplified thusly, we can easily express the solutions to the equations of motion, since by changing coordinates from x_{i} to q_{i} and then to r_{i}, we've managed to decouple the systems completely (**D** is diagonal), so that we may write:

r"_{i} - λ_{i} r_{i} = 0

Writing λ_{i} = ω_{i}^{2}, where λ_{i} is the i^{th} eigenvalue of **K** and diagonal element of **D**, and where { ω_{i} } is the set of natural or resonant frequencies of the system. We can solve each of these equations independently, so that r_{i} = A_{i} cos(ω_{i}t + φ_{i}). Any general set of coordinates in which the system oscillates at a single frequency in each coordinate is called a set of normal coordinates. Thus {r_{i}} represent the normal coordinates for the system. We can get back our original coordinates by applying the transformations in reverse:

**x** = **M**^{-½}**q**

**q** = **P****r**

So,

**x** = **M**^{-½}**P****r**

The matrix **S** = **M**^{-½}**P** is called the matrix of modal shapes, since it encodes characteristic shape of each mode. Writing **x** = **S****r**, and denoting the column vectors of **S** as **S**_{i} we get that

**x** = A_{1}**S**_{1}cos(ω_{1}t + φ_{1}) +
A_{2}**S**_{2}cos(ω_{2}t + φ_{2}) +
A_{3}**S**_{3}cos(ω_{3}t + φ_{3}) + ...

Thus, the net displacement of each mass, the components of **x**, are linear superpositions of the displacements brought about by each mode of oscillation. For instance, in our example of three masses connected to eachother with springs, we would find that one mode for which **S**_{1} = [ -1,0,1 ] ^{T}. This mode is antisymmetric with the outer masses oscillating 90° out of phase with one another, and the inner mass remaining stationary. This mode has its own frequency ω_{1} and is independent of and uninfluenced by the other modes.

In order to solve the problem in its entirety, then, we need determine the values of A_{i} and φ_{i}. This can be done as long as the initial conditions for the system are given, or any other independent conditions that fix these constants. Normally the initial conditions are given in terms of the system's initial displacements and velocities.

In the above development we used an approach that allowed us to find both the modal shapes and natural frequencies. If we were only after the frequencies ω_{i} we would have used the equation **M****x**" - **K****x** = 0 directly, by assuming that x_{i} was of the form A_{i} cos(ω_{i}t + φ_{i}). In this method we consider each mode separately, by assuming that the amplitudes of all the other modes are zero (by some appropriate initial conditions). We can then substitute into the above equation to obtain

ω_{i}^{2}**M****x** + **K****x** = 0

(ω_{i}^{2}**M** + **K**)**x** = 0.

Since non-trivial solutions require that det(ω_{i}^{2}**M** + **K**) = 0, we can find { ω_{i} } as the roots of the characteristic equation.