---
title: Nonlinear systems and limit cycles
heading: How an oscillator decides its own amplitude
eyebrow: A8 · Lesson 42 · Nonlinear systems
xp: 50
---

::: hook
A linear oscillator with a little gain grows forever; with a little loss it dies. Yet every real oscillator, from a crystal clock to a guitar amplifier squealing with feedback, settles at one particular amplitude and holds it, whatever it started from. No linear system can do that. The amplitude is set by a nonlinearity: gain that falls as the signal grows. The resulting closed orbit in the phase plane, attracting every nearby trajectory, is a **limit cycle**, and the van der Pol equation, first written to describe a vacuum-tube oscillator, is its classic example.
:::

::: play
- The van der Pol oscillator, $\ddot x - \mu(1 - x^2)\dot x + x = 0$, in the phase plane with $y = \dot x$.
- One trajectory starts tiny, near the origin; another starts large. Where do they both end up?
- Raise $\mu$. The cycle changes shape from nearly a circle to slow climbs and sudden jumps (relaxation oscillation).
:::
:::

```sim plot
view: flow
x: x = -4..4
y: y = -6..6
slider: mu = 0.1..3 step 0.1 = 0.5
dx: y
dy: mu*(1 - x^2)*y - x
start: 0.1, 0 | forward
start: 3.5, 4 | forward
grid: 16
readout: growth rate at the origin = mu/2 | digits: 3
```

::: predict
## Near the origin the van der Pol oscillator behaves like $\ddot x - \mu\dot x + x = 0$. What does a tiny starting disturbance do?

- [x] Grows: the origin is an unstable spiral
- [ ] Dies away
- [ ] Stays the same size forever
- [ ] Jumps straight to a large value

::: reveal
It grows. The linearization has trace $\mu > 0$, so the origin is an unstable spiral, and noise swells into oscillation, which is exactly what makes the oscillator start. Far from the origin, $1 - x^2$ is negative and the "damping" becomes real damping, shrinking big swings. Between the two there's a closed orbit that both kinds of trajectory approach.
:::
:::

::: nameit
## Equilibria and linearization

For $\dot x = f(x, y)$, $\dot y = g(x, y)$, an **equilibrium** has $f = g = 0$. Near it, the system behaves like the linear one with the **Jacobian** matrix

$$J = \begin{bmatrix}\partial f/\partial x & \partial f/\partial y\\\partial g/\partial x & \partial g/\partial y\end{bmatrix}$$

evaluated at the equilibrium. Classify with lesson 40's trace and determinant. Saddles, nodes and spirals carry over to the nonlinear system; a linear **center** can't be trusted, since the nonlinear terms may turn it into a slow spiral either way.

## The pendulum

$\ddot\theta + \frac{g}{L}\sin\theta = 0$, with $x = \theta$, $y = \dot\theta$:

- at $\theta = 0$, $J = \begin{bmatrix}0 & 1\\-g/L & 0\end{bmatrix}$: a center, oscillating at $\sqrt{g/L}$ for small swings;
- at $\theta = \pi$ (balanced upside down), $J = \begin{bmatrix}0 & 1\\g/L & 0\end{bmatrix}$: a saddle, falling away at rate $\sqrt{g/L}$.

## Limit cycles

A **limit cycle** is an isolated closed orbit. Stable ones attract their neighbors, so the system settles into the same oscillation from any nearby start. That's how real oscillators fix their amplitude. Linear systems can't have them: their closed orbits (centers) come in continuous families, and scaling any solution gives another.

For van der Pol with small $\mu$, the limit cycle is nearly a circle of radius 2 with period close to $2\pi$, and the energy pumped in near the origin ($|x| < 1$) balances the energy removed farther out over each cycle. Electronic oscillators use the same principle with a gain that falls as amplitude rises, such as a lamp or a diode limiter in a Wien-bridge oscillator.
:::

::: example
## A pendulum 1 m long: find its small-swing period and how fast it falls from upside down.

::: solution
1. **Natural rate.**
   $$\begin{aligned} \sqrt{g/L} &= \sqrt{9.81} \\ &= 3.13\ \text{s}^{-1} \end{aligned}$$
2. **Small swings.** The period is
   $$\begin{aligned} T &= \frac{2\pi}{3.13} \\ &= 2.01\ \text{s} \end{aligned}$$
3. **Upside down.** The saddle's unstable eigenvalue is $+3.13$ s⁻¹: a small tilt grows by a factor of $e$ every 0.32 s.

**Answer:** small swings have a period of 2.01 s, and from upside down a small tilt grows by a factor of $e$ every 0.32 s.
:::
:::

::: example
## For van der Pol with $\mu = 0.1$, how does an oscillation start?

::: solution
1. **Jacobian at the origin.**
   $$J = \begin{bmatrix}0 & 1\\-1 & 0.1\end{bmatrix}$$
   so $T = 0.1$ and $D = 1$.
2. **Eigenvalues.**
   $$\lambda = 0.05 \pm 0.999j$$
3. **What they mean.** The oscillation starts at about 1 rad/s and its amplitude grows as $e^{0.05t}$, by a factor of $e$ every 20 s, until the nonlinearity catches it near amplitude 2.

**Answer:** it starts at about 1 rad/s with its amplitude growing as $e^{0.05t}$, a factor of $e$ every 20 s, until it levels off near amplitude 2.
:::
:::

::: example
## A spring that stiffens with stretch obeys $\ddot x + x + 0.1x^3 = 0$. Started at $x = 2$, at what frequency does it oscillate?

::: solution
1. **What the cubic does.** The cubic term adds stiffness that grows with amplitude, so the frequency rises above the linear value of 1 rad/s.
2. **Lindstedt estimate.** A first-order perturbation estimate (the Lindstedt method) gives
   $$\begin{aligned} \omega &\approx 1 + \tfrac38\varepsilon A^2 \\ &= 1 + \tfrac38(0.1)(4) \\ &= 1.15\ \text{rad/s} \end{aligned}$$
3. **Compare with simulation.** A numerical simulation gives 1.139 rad/s, about 1% lower: the estimate is good while $\varepsilon A^2$ is small.
4. **Amplitude matters.** Unlike a linear oscillator, this one's period depends on how hard you start it.

**Answer:** it oscillates at 1.139 rad/s by simulation, close to the Lindstedt estimate of 1.15 rad/s.
:::
:::

::: check
given: k = 4 | 9 | 16; c = 0.5 | 1
answer: (-c + sqrt(c^2 + 4*k))/2
tolerance: 0.5%

## A damped pendulum obeys $\dot x = y$, $\dot y = -\given{k}\sin x - \given{c}y$. At the upside-down equilibrium $x = \pi$, what is the positive eigenvalue of the Jacobian?

::: right
Right. $J = \begin{bmatrix}0 & 1\\k & -c\end{bmatrix}$ there, with $\lambda^2 + c\lambda - k = 0$: $\frac{-c + \sqrt{c^2 + 4k}}{2}$ = {answer}.
:::

::: misses
- [sqrt(k)] That's without damping. Damping slows the fall.
- [any] Not yet. Linearize: $\cos\pi = -1$, so $-k\sin x \approx +k(x - \pi)$.
:::
:::

::: check
given: L = 0.25 | 1 | 2
answer: 2*pi*sqrt(L/9.81)
unit: s
tolerance: 0.5%

## What is the small-swing period of a pendulum {L} m long?

::: right
Right. $2\pi\sqrt{L/g}$ = {answer}.
:::

::: misses
- [2*pi*sqrt(9.81/L)] Longer pendulums swing more slowly: $\sqrt{L/g}$.
- [sqrt(L/9.81)] That's $1/\omega$; the period is $2\pi$ times it.
- [any] Not yet. Linearize at $\theta = 0$.
:::
:::

::: check
given: mu = 0.2 | 0.5 | 1
answer: mu/2
tolerance: 0.5%

## At the origin of the van der Pol oscillator with $\mu$ = {mu}, what is the real part of the Jacobian's eigenvalues?

::: right
Right. $J = \begin{bmatrix}0 & 1\\-1 & \mu\end{bmatrix}$ has trace $\mu$, so the real part is $\mu/2$ = {answer}: the oscillation's starting growth rate.
:::

::: misses
- [mu] Each eigenvalue gets half the trace.
- [-mu/2] The $-\mu(1 - x^2)\dot x$ term pumps energy in near the origin: positive.
- [any] Not yet. Half the trace of the Jacobian at 0.
:::
:::

::: check
given: a = 2 | 3; b = 1 | 4
answer: sqrt(a*b)
tolerance: 0.5%

## For $\dot x = x(\given{a} - y)$, $\dot y = y(x - \given{b})$, the equilibrium $(\given{b}, \given{a})$ linearizes to a center. At what angular frequency do nearby orbits go around?

::: right
Right. $J = \begin{bmatrix}0 & -b\\a & 0\end{bmatrix}$ there, with eigenvalues $\pm j\sqrt{ab}$: {answer}.
:::

::: misses
- [a*b] Take the square root of the determinant.
- [any] Not yet. Compute the Jacobian at $(b, a)$.
:::
:::

::: check
given: k = 1..9 int
answer: -2*k

## For the one-variable system $\dot x = \given{k}(x - x^3)$, what is $f'$ at the equilibrium $x = 1$?

::: right
Right. $f' = k(1 - 3x^2) = -2k$ = {answer}: stable, with time constant $\frac{1}{2k}$.
:::

::: misses
- [k] At $x = 0$, $f' = k$; at $x = 1$ it's $k(1 - 3)$.
- [any] Not yet. Differentiate $k(x - x^3)$ and evaluate at 1.
:::
:::

::: check
kind: choice

## Why can't a linear system have a limit cycle?

- [x] If a closed orbit exists, every scaled copy is also one, so none can be isolated
- [ ] Linear systems can't oscillate
- [ ] Linear systems are always stable
- [ ] Limit cycles need three variables

::: right
Right. Scaling a solution of a linear system gives another solution, so closed orbits come in whole families (a center) and none attracts its neighbors.
:::

::: misses
- [2] Linear systems with complex eigenvalues oscillate; what they can't do is pick an amplitude.
- [4] Two variables are enough; van der Pol has two.
- [any] What happens when you multiply a solution of a linear system by 2?
:::
:::

::: check
kind: parts
given: L = 0.5 | 1 | 2

## A pendulum is {L} m long ($g$ = 9.81 m/s²).

::: part
answer: 2*pi*sqrt(L/9.81)
unit: s
tolerance: 0.5%

### What is its small-swing period?

::: misses
- [sqrt(L/9.81)] That's $1/\omega_0$; the period is $2\pi$ times it.
- [any] $T = 2\pi\sqrt{L/g}$.
:::
:::

::: part
answer: sqrt(9.81/L)
unit: s⁻¹
tolerance: 0.5%

### Near the inverted position, at what rate does a small tilt grow?

::: misses
- [any] Linearizing about $\theta = \pi$ gives $\ddot\phi = \frac gL\phi$.
:::
:::
:::

::: check
kind: derivation
vars: e = 0.01..0.3, A = 0.5..2

## Estimate the frequency of $\ddot x + x + ex^3 = 0$ started at amplitude $A$.

::: step
answer: 1 + 3*e*A^2/8

### What does the first-order estimate $1 + \frac38\varepsilon A^2$ give?
:::

::: step
answer: 2*pi/(1 + 3*e*A^2/8)

### What period does that imply?
:::

::: right
Right. A hardening spring speeds up with amplitude; a softening one ($\varepsilon < 0$) slows down.
:::
:::

::: explain
## Explain how the van der Pol oscillator settles at a definite amplitude, whatever it starts from.

::: model
The term $-\mu(1 - x^2)\dot x$ acts like damping whose sign depends on the size of $x$. Where $|x| < 1$ it's negative damping, so small oscillations gain energy and grow. Where $|x| > 1$ it's ordinary damping, so large swings lose energy and shrink. An orbit that's too small gains more than it loses each cycle and grows; one that's too large loses more than it gains and shrinks. In between is a single orbit where the gain and loss over a cycle balance exactly, and every nearby trajectory is drawn to it: the limit cycle, near amplitude 2 for small $\mu$.
:::
:::

::: practice

::: check
given: L = 0.25 | 0.5 | 1 | 2 | 3 | 4
answer: sqrt(9.81/L)
unit: s⁻¹
tolerance: 0.5%

## A pendulum {L} m long is balanced upside down. At what rate does a small tilt grow, in s⁻¹?

::: misses
- [sqrt(L/9.81)] Short pendulums fall faster: $\sqrt{g/L}$.
- [any] The saddle's positive eigenvalue, $\sqrt{g/L}$.
:::
:::

::: check
given: mu = 0.05 | 0.1 | 0.2 | 0.25 | 0.4 | 0.5
answer: 1/(mu/2)
unit: s
tolerance: 0.5%

## A van der Pol oscillator with $\mu$ = {mu} starts from tiny noise. What is the time constant of its growing envelope, in its own time units?

::: misses
- [1/mu] The growth rate is $\mu/2$.
- [any] $\frac{1}{\mu/2}$.
:::
:::

::: check
given: k = 1..9 int
answer: k

## For $\dot x = \given{k}(x - x^3)$, what is $f'$ at the equilibrium $x = 0$?

::: misses
- [-2*k] That's at $x = \pm 1$.
- [any] $k(1 - 3x^2)$ at 0.
:::
:::
:::
