# Reading Track. Oscillators, Linear and Nonlinear
Three notes from last year's course, written to be worked through with code open. They start from the mass-spring system you have seen before, make the numerical methods honest by checking energy, and then add one term to Hooke's law and watch the whole picture change. Python, R, and MATLAB implementations sit side by side in every numerical section.
> [!info]- Who this is for
> Anyone whose model is "something that pushes back when displaced." Crowds near a barrier, a decision variable pulled toward a threshold, a building or a bridge under load, a vocal tract or an instrument body, a network of neurons that synchronize, a pendulum, a spring. The linear theory is the case where the push-back is proportional and everything can be solved by hand. The nonlinear theory is what happens when it isn't, and it is where resonance, frequency that depends on amplitude, multiple equilibria, and eventually chaos come from. Prerequisites are a first course in ODEs and a willingness to run code.
## The sequence
1. [[Oscillators - Linear versus Nonlinear with Numerical and Symbolic Techniques|Numerical Methods for Nonlinear Oscillators. From Hookean Springs to Chaos]]. The hub. It states the canonical equation $m\ddot y + \gamma\dot y + ky = f(t)$, lays out the module structure, and previews damping and driving, routes to chaos, and the pendulum comparison. Modules 3 through 5 are outlined but not yet written. Read this first for the map.
2. [[Oscillators - Review of Hookean (Linear) Theory|Review of the Mass-Spring System with Hookean Spring]]. The linear theory in full. The undamped, underdamped, critically damped, and overdamped cases from the discriminant $\Delta = \gamma^2 - 4km$; energy and the phase plane; the driven oscillator, resonance, and beats; the LRC circuit analogy. Then the numerical half. Forward Euler, backward Euler, and RK4 applied to the same system, with energy conservation as the verification tool that tells you which scheme is lying and by how much, and a convergence study of error against timestep.
3. [[Oscillators - Bridge to Nonlinearity|The Bridge to Nonlinearity]]. Start from the exact pendulum $mL\ddot\theta + \gamma L\dot\theta + mg\sin\theta = f(t)$, expand $\sin\theta$, keep the cubic term, and arrive at the Duffing oscillator $\ddot y + \gamma\dot y + k_1 y + k_3 y^3 = f(t)$. Hard versus soft springs, the nonlinear Hamiltonian and its energy surfaces, critical points and the separatrix, the amplitude-dependent frequency shift by perturbation expansion, harmonic generation, exact solutions by elliptic functions, and the pendulum approximations compared numerically. It ends with what is lost when superposition goes.
## Where it touches the course
- The three damping cases in note 2 are a phase-line story in two dimensions. The discriminant is the bifurcation parameter.
- Energy conservation as a numerical check is the same discipline as the sanity checks we ask of any model, applied to the integrator instead of the equations.
- The frequency-amplitude relationship in note 3 is a Fourier statement. A nonlinear oscillator driven at one frequency answers at several, which is the harmonic generation section, and it is why the Days 7 through 10 tools matter for anything that vibrates.
- The forward-Euler scheme in note 2 is the Day 4 finite difference run forward in time. Same idea, opposite direction.
<!--
Related. [[MATH310F26 - Reading Track - Stochastic Differential Equations]] for the case where the forcing $f(t)$ is noise. [[MATH310F26 - Reading Track - Why You Hear What You Hear]] for oscillators as sound sources (Chapters 9 through 11 there are resonance, damped and driven oscillation, and impulse response).