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.

3 (exercises). Duhamel’s Integral, Impulse Response, Base Excitation & Vibration Absorbers

ISAE-SUPAERO

🟩 Complete every # TODO. Solution: 03_Duhamel_Impulse_BaseExcitation.ipynb.

import numpy as np
import matplotlib.pyplot as plt
import control
from scipy.integrate import solve_ivp

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

Exercise — implement the impulse response function

🟩 h(t)=e−ζωntmωdsin⁡(ωdt)h(t) = \dfrac{e^{-\zeta\omega_n t}}{m\omega_d}\sin(\omega_d t), with ωd=ωn1−ζ2\omega_d=\omega_n\sqrt{1-\zeta^2}.

def impulse_response(t, m, zeta, wn):
    wd = ...  # TODO
    return ...  # TODO


m, wn, zeta = 1.0, 1.0, 0.01
t = np.linspace(0, 40, 2000)
fig, ax = plt.subplots()
ax.plot(t, impulse_response(t, m, zeta, wn))
plt.show()

Exercise “Ex2B” — simulate the response to a sine input

🟩 Build sys = control.tf(...) for ζ=0.1\zeta=0.1, m=k=1m=k=1, and use control.forced_response to simulate the response to f(t)=sin⁡(t)f(t)=\sin(t) over 80 s (t=np.linspace(0,80,4000)).

m, k = 1.0, 1.0
zeta = 0.1
c = ...  # TODO
sys = ...  # TODO

t = np.linspace(0, 80, 4000)
f = ...  # TODO

t_out, x_out = ...  # TODO

fig, ax = plt.subplots()
ax.plot(t_out, x_out)
plt.show()

Exercise — cross-check with a direct Duhamel convolution

🟩 Compute h = impulse_response(t, m, zeta, wn) and use numpy.convolve(f, h)[:len(t)]*dt to evaluate the Duhamel integral directly. Compare to x_out above (they should agree once the transient has died out).

dt = t[1] - t[0]
h = ...  # TODO
x_duhamel = ...  # TODO

# TODO: plot x_out and x_duhamel together and print the max difference for t>10s

Exercise — base excitation transmissibility

🟥 Handwritten. Starting from mx¨+c(x˙−y˙)+k(x−y)=0m\ddot x+c(\dot x-\dot y)+k(x-y)=0 with y=Yejωty=Ye^{j\omega t}, derive:

∣XY∣=1+(2ζr)2(1−r2)2+(2ζr)2,∣FTkY∣=r2∣XY∣\left|\frac{X}{Y}\right| = \sqrt{\frac{1+(2\zeta r)^2}{(1-r^2)^2+(2\zeta r)^2}}, \qquad \left|\frac{F_T}{kY}\right| = r^2\left|\frac{X}{Y}\right|

🟩 Then plot both transmissibilities vs. r∈[0.01,4]r\in[0.01,4] for several values of ζ\zeta, and mark the crossover at r=2r=\sqrt2.

r = np.linspace(0.01, 4, 800)
fig, axes = plt.subplots(1, 2, figsize=(11, 4.2))
for zeta in [0.05, 0.1, 0.25, 0.5, 0.7, 1.0]:
    TR = ...  # TODO
    axes[0].plot(r, TR, label=rf"$\zeta={zeta}$")
    axes[1].plot(r, r**2 * TR, label=rf"$\zeta={zeta}$")
plt.show()

Exercise — tuned Dynamic Vibration Absorber

🟩 Complete two_mass_frf (2x2 dynamic-stiffness matrix inversion) for a primary mass mp,kpm_p,k_p with an attached absorber ma,kam_a,k_a (and light damping cac_a), forced harmonically on the primary mass. Tune ωa=ωp\omega_a=\omega_p and show the anti-resonance notch that appears for several mass ratios ma/mpm_a/m_p.

def two_mass_frf(w, mp, kp, ma, ka, cp=0.0, ca=0.0):
    Zp = ...  # TODO
    Za = ...  # TODO
    K11, K12 = ..., ...  # TODO
    K21, K22 = ..., ...  # TODO
    det = ...  # TODO
    Xp = ...  # TODO
    return Xp


mp, kp = 1.0, 1.0
w = np.linspace(0.2, 2.0, 2000)

fig, ax = plt.subplots()
ax.semilogy(w, np.abs(1.0 / (-mp * w**2 + kp)), label="No absorber")
for mass_ratio in [0.05, 0.1, 0.2]:
    ma = mass_ratio * mp
    ka = ...  # TODO: tuned absorber stiffness
    Xp = two_mass_frf(w, mp, kp, ma, ka, cp=0.0, ca=0.02 * ka)
    ax.semilogy(w, np.abs(Xp), label=rf"$m_a/m_p={mass_ratio}$")
ax.legend()
plt.show()