Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

6. Continuous Systems — Rods & Beams

ISAE-SUPAERO

Solved reference notebook. See 06_ContinuousSystems_RodsAndBeams_Exercises.ipynb for the blanked-out version.

import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
from scipy.optimize import brentq, fsolve

plt.rcParams["figure.figsize"] = (7, 4.2)
plt.rcParams["axes.grid"] = True

6.1 Rods — longitudinal vibration

Cantilever rod

Summing forces on an infinitesimal element of a rod of varying cross-section A(x)A(x):

ρA(x)∂2u(x,t)∂t2=∂∂x(EA(x)∂u(x,t)∂x)\rho A(x)\frac{\partial^2u(x,t)}{\partial t^2} = \frac{\partial}{\partial x}\left(EA(x)\frac{\partial u(x,t)}{\partial x}\right)

For constant AA, this is the classical 1-D wave equation:

∂2u∂t2=c2∂2u∂x2,c=E/ρ\frac{\partial^2u}{\partial t^2} = c^2\frac{\partial^2u}{\partial x^2}, \qquad c=\sqrt{E/\rho}

(cc is the speed of propagation of the stress wave along the rod.)

Exercise (handwritten) — separation of variables

🟥 Writing u(x,t)=g(x)f(t)u(x,t)=g(x)f(t) and substituting:

g(x)f¨(t)=c2g′′(x)f(t)  ⟹  f¨f=c2g′′g=−ω2  (a constant, since LHS depends on t only and RHS on x only)g(x)\ddot f(t) = c^2 g''(x) f(t) \;\Longrightarrow\; \frac{\ddot f}{f} = c^2\frac{g''}{g} = -\omega^2 \;(\text{a constant, since LHS depends on }t \text{ only and RHS on }x\text{ only})

giving two ODEs: f¨+ω2f=0⇒f(t)=Asin⁡ωt+Bcos⁡ωt\ddot f+\omega^2 f=0 \Rightarrow f(t)=A\sin\omega t+B\cos\omega t, and g′′+β2g=0g''+\beta^2 g=0, β=ω/c\beta=\omega/c, ⇒g(x)=Csin⁡βx+Dcos⁡βx\Rightarrow g(x)=C\sin\beta x+D\cos\beta x.

Fixed-free rod (u(0,t)=0u(0,t)=0, free end ux(L,t)=0u_x(L,t)=0): g(0)=0⇒D=0g(0)=0\Rightarrow D=0, so g(x)=Csin⁡βxg(x)=C\sin\beta x; the free-end condition g′(L)=0g'(L)=0 gives cos⁡βL=0\cos\beta L=0, i.e.

βnL=(2n−1)π2,n=1,2,3,…⇒ωn=βnc\beta_n L = \frac{(2n-1)\pi}{2}, \qquad n=1,2,3,\ldots \qquad \Rightarrow \qquad \omega_n=\beta_n c
c, L = 1.0, 1.0  # non-dimensional speed and length for clarity
n_modes = 3
beta_n = np.array([(2 * n - 1) * np.pi / 2 / L for n in range(1, n_modes + 1)])
omega_n = beta_n * c

x = np.linspace(0, L, 300)
fig, ax = plt.subplots()
for n in range(n_modes):
    g = np.sin(beta_n[n] * x)
    ax.plot(x, g / np.max(np.abs(g)), label=rf"mode {n+1}, $\beta_{{{n+1}}}L={beta_n[n]*L:.3f}$")
ax.axhline(0, color="k", lw=0.6)
ax.set_xlabel("x / L")
ax.set_ylabel("Normalized mode shape g(x)")
ax.set_title("Fixed-free rod: first 3 longitudinal mode shapes")
ax.legend()
plt.show()

print("beta_n * L :", beta_n * L)
print("omega_n / c:", omega_n / c)
<Figure size 700x420 with 1 Axes>
beta_n * L : [1.57079633 4.71238898 7.85398163]
omega_n / c: [1.57079633 4.71238898 7.85398163]

6.2 Beams — Euler-Bernoulli theory

Beam

The Euler-Bernoulli beam equation is

m(x)∂2w∂t2+c∂w∂t+EI∂4w∂x4=f(x,t),m=ρAm(x)\frac{\partial^2w}{\partial t^2}+c\frac{\partial w}{\partial t}+ EI\frac{\partial^4w}{\partial x^4}=f(x,t), \qquad m=\rho A

For free, undamped vibration with constant EIEI and mm:

∂2w∂t2+EIm∂4w∂x4=0\frac{\partial^2w}{\partial t^2}+\frac{EI}{m}\frac{\partial^4w}{\partial x^4}=0

Assuming w(x,t)=W(x)F(t)w(x,t)=W(x)F(t) and substituting gives d4Wdx4−β4W=0\dfrac{d^4W}{dx^4}-\beta^4W=0, β4=ω2mEI\beta^4=\dfrac{\omega^2 m}{EI}, with general solution

W(x)=C1sin⁡βx+C2cos⁡βx+C3sinh⁡βx+C4cosh⁡βxW(x)=C_1\sin\beta x+C_2\cos\beta x+C_3\sinh\beta x+C_4\cosh\beta x

Clamped-free (cantilever) beam

Clamped-free beam

BCs: W(0)=0W(0)=0, W′(0)=0W'(0)=0, W′′(L)=0W''(L)=0 (no moment at the free tip), W′′′(L)=0W'''(L)=0 (no shear). Applying x=0x=0 conditions collapses the general solution to

W(x)=C1[cosh⁡βx−cos⁡βx]+C2[sinh⁡βx−sin⁡βx]W(x) = C_1\left[\cosh\beta x-\cos\beta x\right] + C_2\left[\sinh\beta x-\sin\beta x\right]

and the x=Lx=L conditions give a 2×22\times2 homogeneous system in (C1,C2)(C_1,C_2); a non-trivial solution requires its determinant to vanish, which reduces (see e.g. Inman, Rao, or Blevins) to the characteristic equation

cos⁡βL cosh⁡βL=−1\cos\beta L\,\cosh\beta L = -1

Exercise “Characteristic.m” — solving the characteristic equation

🟩 Two ways to solve cos⁡βLcosh⁡βL+1=0\cos\beta L\cosh\beta L+1=0: visually (plot cos⁡βL\cos\beta L against −1/cosh⁡βL-1/\cosh\beta L and read off the crossings) or numerically (scipy.optimize.brentq, the Python equivalent of MATLAB’s fzero).

betaL = np.linspace(0, 10, 2000)

fig, ax = plt.subplots()
ax.plot(betaL, np.cos(betaL), label=r"$\cos(\beta L)$")
ax.plot(betaL, -1 / np.cosh(betaL), label=r"$-1/\cosh(\beta L)$")


def char_eq(bl):
    return np.cos(bl) * np.cosh(bl) + 1


roots = []
for lo, hi in [(1, 3), (4, 5), (7, 8)]:
    r = brentq(char_eq, lo, hi)
    roots.append(r)
    ax.stem([r], [np.cos(r)], linefmt="r-", markerfmt="ro", basefmt=" ")

ax.set_xlabel(r"$\beta L$")
ax.set_ylabel("Solving visually the characteristic equation")
ax.legend()
plt.show()

print("betaL roots:", np.round(roots, 4), " (textbook: 1.8751, 4.6941, 7.8548)")
<Figure size 700x420 with 1 Axes>
betaL roots: [1.8751 4.6941 7.8548]  (textbook: 1.8751, 4.6941, 7.8548)

Exercise “EX9” — mode shapes for a real cantilever

Geometric/material properties: ρ=2750 kg/m3\rho=2750\,\text{kg/m}^3, L=340L=340,mm, b=22b=22,mm, t=2t=2,mm, E=7×1010E=7\times10^{10},N/m2^2 (an aluminium ruler).

rho, L_beam, b, t_beam, E = 2750.0, 0.340, 0.022, 0.002, 7e10
A = b * t_beam
I = b * t_beam**3 / 12
m = rho * A

betaL_roots = np.array(roots)
beta = betaL_roots / L_beam
omega = beta**2 * np.sqrt(E * I / m)

print("Natural frequencies (rad/s):", np.round(omega, 1))
print("(textbook: 88.6, 555.2, 1554.7 rad/s)")


def W_mode(x, beta, L):
    """Normalized (unit tip-shape) clamped-free eigenfunction, up to an arbitrary amplitude."""
    bl = beta * L
    sigma = (np.sinh(bl) - np.sin(bl)) / (np.cosh(bl) + np.cos(bl))
    return (np.cosh(beta * x) - np.cos(beta * x)) - sigma * (np.sinh(beta * x) - np.sin(beta * x))


x = np.linspace(0, L_beam, 300)
fig, ax = plt.subplots()
for i, b_i in enumerate(beta):
    W = W_mode(x, b_i, L_beam)
    W = W / np.max(np.abs(W))
    ax.plot(x * 1000, W, label=rf"mode {i+1}, $f_{i+1}={omega[i]/2/np.pi:.1f}$ Hz")
ax.axhline(0, color="k", lw=0.6)
ax.set_xlabel("x [mm]")
ax.set_ylabel("Normalized mode shape W(x)")
ax.set_title("Clamped-free beam: first 3 transverse mode shapes")
ax.legend()
plt.show()
Natural frequencies (rad/s): [  88.6  555.2 1554.6]
(textbook: 88.6, 555.2, 1554.7 rad/s)
<Figure size 700x420 with 1 Axes>

Note the number of internal nodes (zero-crossings) increases with mode number, and the slope at x=0x=0 is always zero (clamped condition) while the curvature at x=Lx=L is always zero (free condition, zero moment) — a good sanity check on any mode-shape plot.

Boundary-condition mode shape table

6.3 Homework 7 — free-free beam and a cantilever with a tip mass

🟦 Part 1: free-free beam. By symmetry with the clamped-free case (both ends free: W′′=W′′′=0W''=W'''=0 at x=0,Lx=0,L), the characteristic equation is cos⁡βLcosh⁡βL=1\cos\beta L\cosh\beta L=1 (a rigid body mode β=0\beta=0 also exists and is excluded here).

def char_eq_ff(bl):
    return np.cos(bl) * np.cosh(bl) - 1


roots_ff = []
for lo, hi in [(4, 5), (7, 8), (10, 11), (14, 15)]:
    roots_ff.append(brentq(char_eq_ff, lo, hi))
print("Free-free betaL roots:", np.round(roots_ff, 4), " (textbook/Blevins: 4.730, 7.853, 10.996, 14.137)")
Free-free betaL roots: [ 4.73    7.8532 10.9956 14.1372]  (textbook/Blevins: 4.730, 7.853, 10.996, 14.137)

🟦 Part 2: clamped-free beam with a tip point mass MM. Let the tip mass have no rotary inertia. Deriving the natural boundary conditions from Hamilton’s principle (the tip mass adds a 12Mw˙(L,t)2\frac12 M\dot w(L,t)^2 kinetic-energy term, which contributes an extra inertia term exactly at x=Lx=L): the moment condition is unaffected, EI W′′(L)=0EI\,W''(L)=0, while the shear condition becomes

EI W′′′(L)=−Mω2W(L)EI\,W'''(L) = -M\omega^2 W(L)

(the beam’s internal shear supplies exactly the force needed to accelerate the tip mass). Using ω2=β4EI/m\omega^2=\beta^4EI/m and the general solution W(x)=C1sin⁡βx+C2cos⁡βx+C3sinh⁡βx+C4cosh⁡βxW(x)=C_1\sin\beta x+C_2\cos\beta x +C_3\sinh\beta x+C_4\cosh\beta x, we build the full 2×22\times2 determinant of the two x=Lx=L boundary conditions symbolically (safer than hand algebra), after eliminating C1,C2C_1,C_2 via the x=0x=0 clamped conditions (C1=−C3C_1=-C_3, C2=−C4C_2=-C_4):

L_s, beta_s, EI_s, M_s, m_s, C3, C4 = sp.symbols("L beta EI M m C3 C4", positive=True)
x_s = sp.symbols("x", positive=True)

W_full = (-C3) * sp.sin(beta_s * x_s) + (-C4) * sp.cos(beta_s * x_s) \
    + C3 * sp.sinh(beta_s * x_s) + C4 * sp.cosh(beta_s * x_s)
Wpp_full = sp.diff(W_full, x_s, 2)
Wppp_full = sp.diff(W_full, x_s, 3)

eqM = EI_s * Wpp_full.subs(x_s, L_s)                                    # moment = 0
eqV = EI_s * Wppp_full.subs(x_s, L_s) + M_s * (beta_s**4 * EI_s / m_s) * W_full.subs(x_s, L_s)

Mat = sp.Matrix([[sp.diff(eqM, C3), sp.diff(eqM, C4)],
                  [sp.diff(eqV, C3), sp.diff(eqV, C4)]])
det_full = sp.simplify(Mat.det())

# non-dimensionalize: lambda = beta*L, gamma = M/(m*L) (tip mass / beam mass);
# m_s is an overall positive scale factor and does not affect the roots, so set it to 1
lam, gam = sp.symbols("lambda gamma", positive=True)
char_expr = sp.simplify(
    (det_full / (-2 * EI_s**2 * beta_s**5 / m_s))
    .subs(M_s, gam * m_s * L_s).subs(beta_s, lam / L_s).subs(m_s, 1)
)
char_expr  # = cos(lam)*cosh(lam) + 1 + gamma*lam*(cos(lam)*sinh(lam) - sin(lam)*cosh(lam))
Loading...
det_func = sp.lambdify((lam, gam), char_expr, "numpy")


def first_root(gamma_val, bracket=(0.01, 3.0), n=6000):
    lo, hi = bracket
    ls = np.linspace(lo, hi, n)
    vals = det_func(ls, gamma_val)
    idx = np.where(np.sign(vals[:-1]) != np.sign(vals[1:]))[0][0]
    return brentq(lambda l: det_func(l, gamma_val), ls[idx], ls[idx + 1])


gammas = np.array([1e-6, 0.01, 0.1, 0.3, 1, 3, 10, 30, 100])
lam1 = np.array([first_root(g) for g in gammas])

fig, ax = plt.subplots()
ax.semilogx(gammas, lam1, "o-", label=r"first root $\beta_1L$ (exact, from the determinant)")
ax.axhline(1.8751, color="gray", ls=":", label=r"$\gamma\to0$: standard clamped-free (1.8751)")
ax.plot(gammas, (3 / gammas) ** 0.25, "--",
        label=r"$\gamma\to\infty$ asymptote: $\beta_1L\approx(3/\gamma)^{1/4}$")
ax.set_xlabel(r"Mass ratio $\gamma=M/(mL)$")
ax.set_ylabel(r"$\beta_1 L$ (fundamental)")
ax.legend(fontsize=8)
ax.set_title("Cantilever with tip mass: fundamental eigenvalue vs. mass ratio")
plt.show()
<Figure size 700x420 with 1 Axes>

Comments:

  • As γ→0\gamma\to0 (no tip mass), we recover the standard clamped-free result β1L=1.8751\beta_1L=1.8751.

  • As γ→∞\gamma\to\infty (tip mass dominant), β1L→0\beta_1L\to0: the beam’s own mass becomes negligible and the system behaves like a simple mass-spring oscillator with the cantilever’s static tip stiffness k=3EI/L3k=3EI/L^3, giving ω1=3EI/(ML3)→0\omega_1=\sqrt{3EI/(ML^3)}\to0 as M→∞M\to\infty — exactly the asymptote plotted above, confirming the beam-with-tip-mass eigenvalue problem smoothly bridges the two textbook limits.