Math Methods · Learn

The Auto-Tuner: ODEs Driven by a Fourier Series

A periodic forcing isn't one frequency, it's a chord. Break it into harmonics, solve for each one separately, then add the answers back up — and discover why one quiet harmonic can shake the whole system.

▶ Play the lab📖 Learn the theory

1The setup

Take the same damped oscillator from the frequency response lab, but instead of driving it with a single sine wave, drive it with any periodic signal $f(t)$:

$$ \ddot x + 2\zeta\omega_n\dot x + \omega_n^2 x = f(t) $$

If $f(t)$ is periodic, it has a Fourier series: $f(t) = \sum_{n=1}^{\infty} b_n \sin(n\omega_0 t)$, a sum of harmonics of the fundamental frequency $\omega_0$.

2Superposition: solve one harmonic at a time

The ODE is linear, so the response to a sum of inputs is the sum of the responses. Each harmonic $b_n\sin(n\omega_0 t)$ is just a plain sinusoid at frequency $n\omega_0$, and its steady-state response is read straight off the transfer function $H(i\omega)$ with frequency ratio $r_n = n\omega_0/\omega_n$:

$$ x_n(t) = b_n\,|H(ir_n)|\,\sin\!\big(n\omega_0 t + \angle H(ir_n)\big), \qquad x(t) = \sum_{n=1}^{\infty} x_n(t) $$

This is Bjorn Poonen's method in §27.2 of his MIT 18.03 notes (linked below): find the Fourier series of the input, solve each harmonic with the usual complex-replacement trick (the Exponential Response Formula), then add up the periodic steady-state pieces.

3Selective resonance

Every harmonic gets its own point on the Bode curve. Most sit far from $r_n=1$ and pass through close to unchanged. But if the fundamental $\omega_0$ is tuned so that some harmonic $n\omega_0$ lands near $\omega_n$, that single term gets the full resonant boost $\approx 1/(2\zeta)$ — and with light damping, a harmonic that was a small fraction of the input can become the dominant term in the output.

SituationWhat happens
All $r_n \ll 1$$x(t)$ tracks $f(t)$ almost exactly — every harmonic keeps up.
One $r_n \approx 1$That harmonic is boosted by $\approx1/(2\zeta)$ and can dominate $x(t)$.
All $r_n \gg 1$Every harmonic rolls off — $x(t)$ is smaller and smoother than $f(t)$.

4Spectral shape matters

A square wave's harmonics fall off only like $1/n$ (and only odd $n$ appear) — its high harmonics stay loud, so it's more likely some harmonic lands near resonance. A triangle wave's harmonics fall like $1/n^2$ — almost everything is in the fundamental, so resonance mostly matters when $\omega_0$ itself is near $\omega_n$. This is the same orthogonality and convergence behavior from the Fourier series page, now feeding directly into a vibrating system instead of just being decomposed and looked at.

▶ In the lab

Pick a waveform, then sweep the fundamental frequency $\omega_0$ and watch the spectrum chart — the colored output bars stay close to the gray input bars until one harmonic crosses resonance, where it suddenly towers over the rest. Open the lab →

Key takeaways

📄 Further reading

Bjorn Poonen's free MIT 18.03 lecture notes (PDF) cover this exact method in §27.2, "Solving an ODE using Fourier series" — building directly on Fourier series (§26) and the Exponential Response Formula from earlier sections.

EngineeringCandy · Learn · the theory behind the playground