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.

1 (exercises). Single-Degree-of-Freedom Systems — Free Vibration

ISAE-SUPAERO

🟩 Code exercise. Complete every # TODO cell below during the lesson. The fully worked solution is in 01_SDOF_FreeVibration.ipynb — try not to peek until you’re done!

Recall the free-vibration EoM mx¨+cx˙+kx=0m\ddot{x}+c\dot{x}+kx=0, with ωn=k/m\omega_n=\sqrt{k/m}, ζ=c/(2km)\zeta = c/(2\sqrt{km}), and the three regimes:

  • Overdamped (ζ>1\zeta>1): x(t)=Aes1t+Bes2tx(t)=Ae^{s_1 t}+Be^{s_2 t}

  • Critically damped (ζ=1\zeta=1): x(t)=e−ωnt(A+Bt)x(t)=e^{-\omega_n t}(A+Bt)

  • Underdamped (0<ζ<10<\zeta<1): x(t)=e−ζωnt(Ccos⁡ωdt+Dsin⁡ωdt)x(t)=e^{-\zeta\omega_n t}(C\cos\omega_d t+D\sin\omega_d t), ωd=ωn1−ζ2\omega_d=\omega_n\sqrt{1-\zeta^2}

SDOF system
import numpy as np
import matplotlib.pyplot as plt
from scipy.integrate import solve_ivp
import sympy as sp

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

Exercise 1 — implement sdof_free_response

🟩 Complete the function below so that it returns the analytic free response x(t)x(t) for any value of ζ\zeta (handle the three cases explicitly), given mm, cc, kk, x0x_0, v0v_0.

def sdof_free_response(t, m, c, k, x0, v0):
    """Analytic free response of m*x'' + c*x' + k*x = 0. Complete the three branches below."""
    wn = np.sqrt(k / m)
    zeta = c / (2 * np.sqrt(k * m))
    delta = zeta**2 - 1

    if zeta > 1:  # overdamped
        s1 = ...  # TODO
        s2 = ...  # TODO
        A = ...  # TODO: use x0, v0, s1, s2
        B = ...  # TODO
        x = ...  # TODO
    elif np.isclose(zeta, 1.0):  # critically damped
        A = ...  # TODO
        B = ...  # TODO
        x = ...  # TODO
    else:  # underdamped
        wd = ...  # TODO
        C = ...  # TODO
        D = ...  # TODO
        x = ...  # TODO
    return x

Exercise 2 — plot the three damping regimes

🟩 Using m=1m=1, k=1k=1, x0=1x_0=1, v0=0v_0=0, plot the free response for ζ=0.05, 0.3, 1.0, 1.8\zeta = 0.05,\ 0.3,\ 1.0,\ 1.8 on the same axes, t∈[0,20]t\in[0,20],s.

m, k = 1.0, 1.0
x0, v0 = 1.0, 0.0
t = np.linspace(0, 20, 1000)
wn = np.sqrt(k / m)

fig, ax = plt.subplots()
for zeta, label in [(0.05, r"underdamped, $\zeta=0.05$"),
                     (0.3, r"underdamped, $\zeta=0.3$"),
                     (1.0, r"critically damped, $\zeta=1$"),
                     (1.8, r"overdamped, $\zeta=1.8$")]:
    c = ...  # TODO: relate c to zeta, k, m
    x = ...  # TODO: call sdof_free_response
    ax.plot(t, x, label=label)

ax.axhline(0, color="k", lw=0.6)
ax.set_xlabel("Time [s]")
ax.set_ylabel("x(t)")
ax.set_title("SDOF free response for the three damping regimes")
ax.legend()
plt.show()

Exercise 3 — cross-check with numerical integration

🟩 Write the state-space right-hand side sdof_ode(t, y, m, c, k) with y=[x,x˙]y=[x,\dot x] and integrate it with solve_ivp for ζ=0.1\zeta=0.1. Compare with the analytic solution on the same plot.

def sdof_ode(t, y, m, c, k):
    x, v = y
    xdot = ...  # TODO
    vdot = ...  # TODO
    return [xdot, vdot]


zeta = 0.1
c = 2 * zeta * np.sqrt(k * m)
sol = ...  # TODO: solve_ivp(...)

x_analytic = sdof_free_response(t, m, c, k, x0, v0)

fig, ax = plt.subplots()
ax.plot(t, x_analytic, label="Analytic")
# TODO: plot sol.y[0] vs t as a dashed line labeled "solve_ivp (numerical)"
ax.set_xlabel("Time [s]")
ax.set_ylabel("x(t)")
ax.legend()
plt.show()

Exercise 4 — symbolic check (the “Ex0” review)

🟥 Handwritten / symbolic exercise. Use sympy.dsolve to solve mx¨+cx˙+kx=0m\ddot x + c\dot x + kx = 0 symbolically with initial conditions x(0)=x0x(0)=x_0, x˙(0)=v0\dot x(0)=v_0, and compare the structure of the result with your hand derivation.

t_sym, m_s, c_s, k_s, x0_s, v0_s = sp.symbols("t m c k x0 v0")
x = sp.Function("x")

ode = ...  # TODO: sp.Eq(...)
sol_sym = ...  # TODO: sp.dsolve(...)
sol_sym

Homework 1 (blue box)

🟦 Homework.

  1. Make sure the symbolic review above runs and matches your hand derivation.

  2. Derive the logarithmic decrement δlog⁡=ln⁡[x(t1)/x(t1+Td)]\delta_{\log} = \ln[x(t_1)/x(t_1+T_d)] for an underdamped system, show that δlog⁡=2πζ/1−ζ2\delta_{\log} = 2\pi\zeta/\sqrt{1-\zeta^2}, and invert it to estimate ζ\zeta from two successive measured peaks.

  3. Code it: for ζtrue=0.05\zeta_{\text{true}}=0.05, generate the free response, locate two successive peaks one damped period Td=2π/ωdT_d=2\pi/\omega_d apart, compute δlog⁡\delta_{\log} numerically, and recover an estimate of ζ\zeta. Check it matches ζtrue\zeta_{\text{true}}.

zeta_true = 0.05
c = 2 * zeta_true * np.sqrt(k * m)
wd = ...  # TODO
Td = ...  # TODO

t_fine = np.linspace(0, 20, 20000)
x_fine = sdof_free_response(t_fine, m, c, k, x0=1.0, v0=0.0)

# TODO: find the index of the first peak i1 (t < Td) and the index i2 nearest to t1+Td
i1 = ...
t1 = t_fine[i1]
i2 = ...

delta_log = ...  # TODO
zeta_est = ...  # TODO

print(f"True zeta        = {zeta_true:.4f}")
print(f"Log decrement    = {delta_log:.4f}")
print(f"Estimated zeta   = {zeta_est:.4f}")