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 (exercises). Continuous Systems — Rods & Beams

ISAE-SUPAERO

🟩 Complete every # TODO. Solution: 06_ContinuousSystems_RodsAndBeams.ipynb.

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

Exercise (handwritten) — rods, separation of variables

🟥 Write u(x,t)=g(x)f(t)u(x,t)=g(x)f(t) in utt=c2uxxu_{tt}=c^2u_{xx}, separate into two ODEs, and show that for a fixed-free rod (u(0,t)=0u(0,t)=0, ux(L,t)=0u_x(L,t)=0) the natural frequencies are ωn=βnc\omega_n=\beta_nc with βnL=(2n−1)π/2\beta_nL=(2n-1)\pi/2.

🟩 Plot the first 3 mode shapes gn(x)=sin⁡(βnx)g_n(x)=\sin(\beta_nx).

c, L = 1.0, 1.0
n_modes = 3
beta_n = ...  # TODO: array of beta_n*L for n=1,2,3
omega_n = ...  # TODO

x = np.linspace(0, L, 300)
fig, ax = plt.subplots()
for n in range(n_modes):
    g = ...  # TODO
    ax.plot(x, g / np.max(np.abs(g)), label=f"mode {n+1}")
ax.legend()
plt.show()

Exercise “Characteristic.m” — clamped-free beam eigenvalues

🟩 Solve cos⁡βLcosh⁡βL=−1\cos\beta L\cosh\beta L=-1 both visually (plot cos⁡βL\cos\beta L vs. −1/cosh⁡βL-1/\cosh\beta L) and numerically (scipy.optimize.brentq) for the first three roots. Compare to βL=1.8751, 4.6941, 7.8548\beta L = 1.8751,\ 4.6941,\ 7.8548.

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 ...  # TODO: cos(bl)*cosh(bl) + 1


roots = []
for lo, hi in [(1, 3), (4, 5), (7, 8)]:
    r = ...  # TODO: brentq(...)
    roots.append(r)

print(roots)

Exercise “EX9” — mode shapes for a real cantilever

🟩 For ρ=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},Pa, compute AA, II, m=ρAm=\rho A, the natural frequencies ωi=βi2EI/m\omega_i=\beta_i^2\sqrt{EI/m} (compare to 88.6, 555.2, 1554.7 rad/s), and plot the first three normalized mode shapes using

W(x)∝(cosh⁡βx−cos⁡βx)−σ(sinh⁡βx−sin⁡βx),σ=sinh⁡βL−sin⁡βLcosh⁡βL+cos⁡βLW(x) \propto (\cosh\beta x-\cos\beta x) - \sigma(\sinh\beta x-\sin\beta x), \qquad \sigma=\frac{\sinh\beta L-\sin\beta L}{\cosh\beta L+\cos\beta L}
rho, L_beam, b, t_beam, E = 2750.0, 0.340, 0.022, 0.002, 7e10
A = ...  # TODO
I = ...  # TODO
m = ...  # TODO

betaL_roots = np.array(roots)
beta = ...  # TODO
omega = ...  # TODO
print(omega)


def W_mode(x, beta, L):
    sigma = ...  # TODO
    return ...  # TODO


x = np.linspace(0, L_beam, 300)
# TODO: plot the 3 mode shapes

Homework 7 — free-free beam & cantilever with a tip mass

🟦 Part 1. For a free-free beam (W′′=W′′′=0W''=W'''=0 at both ends), show the characteristic equation is cos⁡βLcosh⁡βL=1\cos\beta L\cosh\beta L=1 and find the first four non-trivial roots (compare to 4.730, 7.853, 10.996, 14.137).

def char_eq_ff(bl):
    return ...  # TODO


roots_ff = []
for lo, hi in [(4, 5), (7, 8), (10, 11), (14, 15)]:
    roots_ff.append(...)  # TODO
print(roots_ff)

🟦 Part 2. For a clamped-free beam with a tip point mass MM (no rotary inertia), the natural boundary conditions at x=Lx=L are EI W′′(L)=0EI\,W''(L)=0 and EI W′′′(L)=−Mω2W(L)EI\,W'''(L)=-M\omega^2W(L).

🟩 Using sympy, build 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, eliminate C1,C2C_1,C_2 via the clamped conditions at x=0x=0, form the 2×22\times2 determinant of the two x=Lx=L conditions, and non-dimensionalize with λ=βL\lambda=\beta L, γ=M/(mL)\gamma=M/(mL). Then find how the fundamental root λ1\lambda_1 varies with γ\gamma, and check the two limits: γ→0\gamma\to0 (plain clamped-free, λ1=1.8751\lambda_1=1.8751) and γ→∞\gamma\to\infty (a simple oscillator, λ1≈(3/γ)1/4\lambda_1\approx(3/\gamma)^{1/4}, from ω1=3EI/(ML3)\omega_1=\sqrt{3EI/(ML^3)}).

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 = ...  # TODO: general clamped-free solution with C1=-C3, C2=-C4
Wpp_full = sp.diff(W_full, x_s, 2)
Wppp_full = sp.diff(W_full, x_s, 3)

eqM = ...  # TODO
eqV = ...  # TODO

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())

lam, gam = sp.symbols("lambda gamma", positive=True)
char_expr = ...  # TODO: non-dimensionalize (remember m_s is an arbitrary positive scale)

# TODO: lambdify, scan gamma in [1e-6, 100], find the fundamental root for each, and plot
# against the two limiting cases