Fundamentals / Numerical mathematics / Numerical linear algebra

Can an eigensolver certify the pitch of a continuous string?

A taut string gives a known continuum spectrum. Use its kinetic and elastic energies to construct two different matrix pencils. Both can pass a residual test to machine precision while assigning visibly different pitches to the same oscillation.

Build both matrices from a single element

A straight string of length \(L=1\) m, tension \(S=40\) N and mass per unit length \(\rho=0.0040\) kg/m has fixed ends. Divide it into \(N\) intervals of length \(h=L/N\). Approximate transverse displacement on each interval by a straight line between neighbouring nodal displacements \(u_i,u_{i+1}\). Use this shape for both velocity and slope. Which local mass entries would be lost by assigning half the segment mass to each end before squaring the interpolated velocity?

Integrate the kinetic and elastic quadratic forms

Derive the two \(2\times2\) matrices and explain which physical motion makes the elastic energy vanish.

Work through the solution

The interpolated velocity at local coordinate \(\xi\in[0,1]\) is \((1-\xi)\dot u_i+\xi\dot u_{i+1}\). The squared shape functions each integrate to \(1/3\) and their product integrates to \(1/6\). The slope is constant, \((u_{i+1}-u_i)/h\). Comparing the integrals with half a matrix quadratic form gives

\[M_e=\frac{\rho h}6\begin{pmatrix}2&1\\1&2\end{pmatrix},\qquad K_e=\frac S h\begin{pmatrix}1&-1\\-1&1\end{pmatrix}.\]

A common translation costs no elastic energy and a uniform velocity gives exactly the total element mass. Replacing \(M_e\) by its diagonal of row sums produces two equal masses \(\rho h/2\). This lumped version also gets the uniform-motion energy right but gives more kinetic energy for velocities of opposite sign at the nodes. Assemble contributions at shared nodes and eliminate fixed endpoint degrees of freedom after applying the local row sum. Summing rows only after deleting endpoint columns silently changes the end-adjacent mass.

Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.

Diagonalise a sparse pencil without forming an inverse

The interior stiffness row applies \(S(2u_j-u_{j-1}-u_{j+1})/h\). Set \(u_j=\sin(j\theta)\) so

\[u_{j-1}+u_{j+1}=2\cos\theta\,u_j.\]

What does each mass row do to the same nodal vector, and which wavenumbers obey both boundary conditions?

Find both discrete dispersion relations

Impose \(u_0=u_N=0\), discard the zero vector and express the angular frequencies directly.

Work through the solution

Use \(\theta=m\pi/N\) for \(m=1,\ldots,N-1\). The consistent mass row multiplies the nodal sine by \(\rho h(2+\cos\theta)/3\); the lumped row multiplies it by \(\rho h\). Inserting \(u(t)=v e^{i\omega t}\) into \(M\ddot u+Ku=0\) gives

\[Kv=\omega^2 Mv.\]

With \(c=\sqrt{S/\rho}=100\) m/s the results are

\[\omega_{\rm L}=\frac{2c}{h}\sin(\theta/2),\]
\[\omega_{\rm C}=\omega_{\rm L}\sqrt{\frac3{2+\cos\theta}},\]
\[\omega_{\rm exact}=c\,m\pi/L .\]

The consistent mass includes the exact kinetic energy of each piecewise-linear trial displacement. For this conforming space its Rayleigh–Ritz eigenvalues bound the exact squared frequencies from above. The lumped result is lower because \(\sin u<u\) for positive \(u\). Lumping changes the inner product, so the same variational upper-bound argument cannot simply be transferred to it. For a nonuniform mesh the sine vectors need not diagonalise either matrix. A symmetric generalised eigensolver or a Cholesky reduction \(M=BB^T,\ B^{-1}KB^{-T}w=\lambda w\) retains the appropriate symmetry. Recover \(v=B^{-T}w\) and normalise in the mass inner product.

Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.

Distinguish algebraic and discretisation error

Audit a computed fourth harmonic

Use eight intervals. Both sine vectors give tiny relative residual \(\|Kv-\lambda Mv\|/[(\|K\|+|\lambda|\|M\|)\|v\|]\) in their own equations. Report the predicted frequency with each mass. Explain how an experimenter could spot the error without an exact continuum reference.

Work through the solution

Here \(\theta=\pi/2\). The continuum fourth harmonic is 200.0 Hz. The lumped value is \(800\sqrt{2}/(2\pi)=180.06\) Hz, and the consistent value is larger by \(\sqrt{3/2}\), giving 220.53 Hz. Each algebraic residual tests whether the vector solves the matrix equation supplied to the solver. Neither residual tests the geometric approximation used to build that equation. Refine while keeping the same physical mode number and track the same number of interior zeros. Comparing the highest available harmonic after every refinement compares different physical modes.

For a smooth fixed mode the frequency ratios expand as \(1-\theta^2/24+O(\theta^4)\) for lumping and \(1+\theta^2/24+O(\theta^4)\) for consistent mass. Doubling the number of intervals quarters the leading bias. Their mean cancels the leading term for this uniform constant-coefficient string. Such cancellation is a consequence of these specific expansions; on a different mesh, solve or measure the convergence order again. Checking mass orthogonality between the reported modes gives a separate test that an eigensolver has returned distinct vectors, particularly when modes approach a cluster.

Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.

Measure the usable part of a spectrum

The experiment plots the two percentage errors against mode number over the actual discrete spectrum. Move the interval count while keeping track of mode 4. Look for a mode with about 1% frequency error and estimate how many points per wavelength the mesh must supply. The optional blended mass \(M_\alpha=(1-\alpha)M_L+\alpha M_C\) gives another quantitative test of the asymptotic cancellation. Blending mass matrices differs from averaging the two eigenfrequencies at finite \(h\).

Predict a dispersion-cancelling blend

Expand the blended mass multiplier and find the value of \(\alpha\) cancelling the leading smooth-mode frequency error. Why can it still give misleading high harmonics?

Work through the solution

The mass multiplier divided by \(\rho h\) is

\[1-\alpha(1-\cos\theta)/3=1-\alpha\theta^2/6+\cdots.\]

Its inverse square root contributes \(+\alpha\theta^2/12\) to the frequency ratio. Multiplying by the lumped sine ratio gives leading coefficient \((2\alpha-1)/24\), which vanishes at \(\alpha=1/2\). At eight intervals mode 4 has a blended frequency \(180.06/\sqrt{5/6}=197.25\) Hz. The improvement is substantial but finite. As the mode approaches the grid scale, the discarded higher powers of \(\theta\) cease to be small; exact solution of the blended pencil cannot restore a sub-element waveform.

Explore the related calculation with adjustable inputs. Change the parameters in the experiment on this same project page and compare its output with this part of the derivation.

Further reading

Notebook practice · Counting vibration modes without calculating their shapes