Fundamentals / Mechanical engineering / Machine dynamics / Vibration and identification in machinery

From beam curvature to a mass matrix and a frequency measurement

A coarse cantilever model often predicts its first resonance accurately while putting the third far too high. Derive both matrices from the same displacement field and inspect how each mode converges.

Turn distributed kinetic and strain energy into coordinates

Take a uniform slender beam at rest, with transverse displacement \(w(x,t)\) and small rotation. Neglect cross-section rotary inertia, shear compliance and prestress. An element of length \(h\) stores strain energy \(\int EI(w'')^2dx/2\) and kinetic energy \(\int\rho A\dot w^2dx/2\). Continuity of both displacement and slope at the interfaces prevents a spurious concentrated curvature. A cubic polynomial has four coefficients, exactly enough to interpolate the displacement and slope at each end.

Put \(s=x/h\) and \(q_e=(w_1,\theta_1,w_2,\theta_2)^T\). Apply the four endpoint conditions to a cubic, or verify them directly, to obtain \(w=Nq_e\) with

\[N=(1-3s^2+2s^3,\ h(s-2s^2+s^3),\ 3s^2-2s^3,\ h(-s^2+s^3)).\]

Substitution into the energy integrals gives the element stiffness and consistent mass. The word consistent records that the same shape functions transport mass and displacement.

\[K_e=\int_0^h EI(N'')^TN''\,dx,\]
\[M_e=\int_0^h\rho A N^TN\,dx.\]

For example, \(N_1''=(-6+12s)/h^2\), so \(K_{11}=12 EI/h^3\). Integrating \(N_1^2\) gives \(M_{11}=156\rho Ah/420\). Mass couplings to rotations carry one additional length factor, and rotation–rotation terms carry two. These dimensions catch sign and assembly errors which a plausible first eigenvalue can hide.

Recover the vibration equation and its boundary conditions

Scatter-add each element into both global matrices at its shared nodal indices. A clamped root imposes \(w_0=\theta_0=0\). Delete those rows and columns from both matrices. The free end has no applied transverse force or moment, which the weak form already enforces as natural conditions. Lagrange’s equations give \(M\ddot q+Kq=0\). A harmonic ansatz gives \(K\phi=\omega^2M\phi\). Eigenvectors from different frequencies are orthogonal in the mass inner product. Their overall signs remain arbitrary.

Take a one-metre steel cantilever, 30 mm wide and 10 mm deep, \(E=210\) GPa and \(\rho=7800\) kg/m³. The analytical clamped-free roots solve \(\cosh\beta\cos\beta=-1\). Their frequencies scale as \(\beta^2\sqrt{EI/(\rho A)}/(2\pi L^2)\). The test provides three independent references and a direct check on units and boundary conditions.

Interactive experiment · Rotate a beam mode and vary length, thickness and phase

The live plot evaluates the analytical clamped-free mode. The spatial view gives the beam its rectangular cross-section so that the modal centreline can be inspected from different directions. Move the phase slider through one cycle; the displayed frequency gives the physical time corresponding to that cycle.

\[\phi(x)=\cosh(\beta x/L)-\cos(\beta x/L)-\frac{\cosh\beta+\cos\beta}{\sinh\beta+\sin\beta}\bigl[\sinh(\beta x/L)-\sin(\beta x/L)\bigr].\]

Scale this shape to the chosen tip amplitude and multiply it by the cosine of the phase. Double the length and check the factor of four in period; double the depth and check the factor of two in frequency. Modes two and three introduce internal nodes which a coarse mesh may miss. The interactive view uses the analytical slender-beam solution; the OneSimulation notebook below independently assembles and solves the discrete mass–stiffness eigenproblem. The selected amplitude illustrates a linear mode and is not a load-response prediction.

Continue in the OneSimulation notebook · Download its Python model

OneSimulation experiment · Convergence of the first three cantilever frequencies under mesh refinement

Run the notebook with OneSimulation 0.2.0, NumPy, SciPy and Matplotlib. Change the input data and compare your run with the recorded result.

"""Assemble a cantilever from Hermite elements; validate its first three modes."""
import numpy as np
import matplotlib.pyplot as plt
from onesim.numerics.linear import SparseSymmetricEigenSolver

length, width, depth = 1.0, 0.03, 0.01  # m
E, density = 210e9, 7800.0
area, inertia = width*depth, width*depth**3/12

def beam_frequencies(elements):
    h = length/elements
    k = E*inertia/h**3*np.array([[12,6*h,-12,6*h],[6*h,4*h*h,-6*h,2*h*h],
                                 [-12,-6*h,12,-6*h],[6*h,2*h*h,-6*h,4*h*h]])
    m = density*area*h/420*np.array([[156,22*h,54,-13*h],[22*h,4*h*h,13*h,-3*h*h],
                                    [54,13*h,156,-22*h],[-13*h,-3*h*h,-22*h,4*h*h]])
    size = 2*(elements+1)
    mass, stiffness = np.zeros((size,size)), np.zeros((size,size))
    for element in range(elements):
        dofs = np.arange(2*element,2*element+4)
        mass[np.ix_(dofs,dofs)] += m
        stiffness[np.ix_(dofs,dofs)] += k
    values, modes = SparseSymmetricEigenSolver()(mass[2:,2:], stiffness[2:,2:],
                                                 mode_count=3, target=0.0)
    assert np.allclose(modes.T @ mass[2:,2:] @ modes, np.eye(3), atol=1e-8)
    return np.sqrt(values)/(2*np.pi)

beta = np.array([1.875104069,4.694091133,7.854757438])
exact = beta**2*np.sqrt(E*inertia/(density*area))/(2*np.pi*length**2)
counts = [2, 4, 8, 16]
frequencies = np.array([beam_frequencies(count) for count in counts])
print("2 elements [Hz]", np.round(frequencies[0], 4))
print("16 elements [Hz]", np.round(frequencies[-1], 4))
print("analytical [Hz]", np.round(exact, 4))

Reference run

2 elements [Hz] [  8.386   52.9742 179.1685]
16 elements [Hz] [  8.3819  52.5288 147.0871]
analytical [Hz] [  8.3819  52.5285 147.0813]
Convergence of the first three cantilever frequencies under mesh refinement
Convergence of the first three cantilever frequencies under mesh refinement

Download editable notebook · Download Python script

Explain the disagreement between modes

With two elements the first mode is 8.3860 Hz against 8.3819 Hz analytically, an error of about 0.05%. The third mode is 179.1685 Hz against 147.0813 Hz, about 22% high. A conforming displacement space restricts admissible shapes and typically overestimates Ritz frequencies when integration is exact. Shorter spatial wavelengths require more independent shape degrees of freedom. The sixth significant digit of the first mode cannot certify the third.

Why attaching a sensor at a node changes the prediction

An accelerometer of mass \(m_s\) at coordinate \(x_s\) adds \(m_sN(x_s)^TN(x_s)\) to the element mass. It shifts a mode strongly where that mode moves, while its first-order effect at a true modal node vanishes. A location that resolves mode one may be almost blind to mode two.

Exercises on model assembly

Suppress the root deflection but release its rotation. Which diagnostic should fail?

Worked solution

A beam with one pinned end and a free end can rotate rigidly with \(w=ax\). This mode has zero curvature and stiffness. The smallest eigenvalue should tend to zero. The remaining list must not be compared in order with cantilever roots.

If the beam thickness doubles while width and length stay fixed, predict the frequency change without remeshing.

Worked solution

Inertia scales as thickness cubed and area as thickness, so \(\sqrt{I/A}\) doubles. All Euler–Bernoulli frequencies double within the slender-beam regime. A thick-beam test can depart systematically owing to shear and rotary inertia.

Test whether a calculated eigenvector is numerically valid without a known exact frequency.

Worked solution

Form \(K\phi-\omega^2 M\phi\) and scale its norm by \(\lVert K\phi\rVert+\omega^2\lVert M\phi\rVert\). A small residual certifies the discrete eigenpair. Only refinement or physical data test whether the discrete system is adequate.

Further reading · Rao, Mechanical Vibrations, 6th ed., Chapters 7, 8 and 12.

Spatial notebook output · inspect the same solved model in3D

The downloadable notebook now also draws the solved member forces or discrete beam eigenvectors in three dimensions. Its spatial figure below is produced by the actual OneSimulation run.

Three-dimensional output generated from the solved OneSimulation model
Recorded spatial output; the beam view enlarges transverse dimensions to make its mode shape legible.

Download the executed notebook with3D output