---
title: Linearization and stability of equilibria
heading: Using the Jacobian to read a nonlinear system near rest
eyebrow: A8 · Lesson 41 · Linearization
xp: 40
---

::: hook
Most real systems are nonlinear: a pendulum's restoring torque goes as $\sin\theta$, a transistor's current as an exponential, a population's growth as a product of predator and prey. Their equations rarely have formulas for solutions. But near an equilibrium, any smooth system looks linear, and lesson 40's trace-and-determinant picture tells you what the linear system does. The tool that does the linearizing is the **Jacobian**, the matrix of partial derivatives, and in most cases it predicts correctly whether the real system settles, spirals or escapes.
:::

::: play
- The arrows show the flow of a damped pendulum, $\dot\theta = \omega$, $\dot\omega = -c\omega - \sin\theta$; the curves trace solutions forward in time.
- Near $\theta = 0$ the pendulum hangs down: trajectories spiral in. Near $\theta = \pi$ it's upside down: trajectories approach along one direction and leave along another, a saddle.
- Set $c = 0$. The spirals at the bottom become closed loops: with no friction, the linearization's prediction (a center) needs the full nonlinear system to confirm.
:::

```sim plot
view: flow
x: x = -4..7
y: y = -3..3
slider: c = 0..1 step 0.05 = 0.3
dx: y
dy: -c*y - sin(x)
start: 2.5, 0 | forward
start: 3.0, 0.4 | forward
start: -2, 2.4 | forward
start: 3.3, -0.4 | forward
grid: 16
readout: trace at the bottom = -c | digits: 3
readout: damped frequency at the bottom = sqrt(1 - c^2/4) | digits: 4
```

::: predict
## Upside down, the pendulum's linearization has determinant $-1$. What kind of equilibrium is that?

- [ ] A stable spiral
- [ ] A center
- [x] A saddle
- [ ] An unstable spiral

::: reveal
A saddle. A negative determinant means real eigenvalues of opposite signs, whatever the trace. One direction leads in, which is how a perfectly aimed swing can come to rest upside down, and the other leads out, which is why any error in that aim makes it fall. Saddles are the boundaries between basins: here they separate swings that go over the top from those that don't.
:::
:::

::: nameit
## The Jacobian

For $\dot x = f(x, y)$, $\dot y = g(x, y)$, an equilibrium $(x^*, y^*)$ has $f = g = 0$. Near it, with $u = x - x^*$ and $v = y - y^*$, the first-order Taylor expansion gives

$$\begin{bmatrix}\dot u\\\dot v\end{bmatrix} \approx J\begin{bmatrix}u\\v\end{bmatrix}, \qquad J = \begin{bmatrix}\partial f/\partial x & \partial f/\partial y\\\partial g/\partial x & \partial g/\partial y\end{bmatrix}_{(x^*, y^*)}$$

## When the linearization tells the truth

If no eigenvalue of $J$ has zero real part (a **hyperbolic** equilibrium), the nonlinear system near the equilibrium behaves like the linear one: nodes stay nodes, spirals stay spirals, saddles stay saddles (the Hartman–Grobman theorem). Classify with the trace $T$ and determinant $D$ of $J$:
- $D < 0$: saddle;
- $D > 0$, $T < 0$: stable (spiral if $T^2 < 4D$, node otherwise);
- $D > 0$, $T > 0$: unstable.

If $T = 0$ with $D > 0$, the linearization is a center, and the nonlinear terms decide: closed orbits, slow spirals in, or slow spirals out.

## In circuits

- **A latch** of two cross-coupled inverters with gain $A$ has a saddle at the balanced point. Its unstable eigenvalue $(A - 1)/\tau$ sets how fast a small imbalance grows to a full logic level, the regeneration time that governs metastability.
- **An oscillator** has an unstable equilibrium surrounded by a limit cycle (lesson 42): linearizing shows the start-up growth rate.
- **Bias points** of transistor circuits are equilibria too, and small-signal analysis is exactly this linearization.
:::

::: example
## Classify the equilibria of the damped pendulum $\ddot\theta + 0.5\dot\theta + \sin\theta = 0$.

::: solution
1. **Jacobian.** With $\omega = \dot\theta$: $f = \omega$ and $g = -0.5\omega - \sin\theta$, so
   $$J = \begin{bmatrix}0 & 1\\-\cos\theta & -0.5\end{bmatrix}$$
2. **At $(0, 0)$.** $T = -0.5$ and $D = 1$, with $T^2 < 4D$: a stable spiral, ringing at
   $$\sqrt{1 - 0.0625} = 0.968\ \text{rad/s}$$
3. **At $(\pi, 0)$.** $\cos\pi = -1$, so $D = -1$: a saddle, with eigenvalues
   $$\frac{-0.5 \pm \sqrt{4.25}}{2}$$
   which are 0.781 and $-1.281$.

**Answer:** $(0, 0)$ is a stable spiral ringing at 0.968 rad/s, and $(\pi, 0)$ is a saddle with eigenvalues 0.781 and −1.281.
:::
:::

::: example
## Find the small oscillations of predator and prey, $\dot x = x(2 - y)$, $\dot y = y(x - 1)$, around their coexistence point.

::: solution
1. **Coexistence point.** The equilibrium with both nonzero is $x = 1$, $y = 2$.
2. **Jacobian there.**
   $$\begin{aligned} J &= \begin{bmatrix}2 - y & -x\\y & x - 1\end{bmatrix}_{(1, 2)} \\ &= \begin{bmatrix}0 & -1\\2 & 0\end{bmatrix} \end{aligned}$$
3. **Classify.** $T = 0$ and $D = 2$: a linear center, with frequency $\sqrt2$ and period
   $$\frac{2\pi}{\sqrt2} = 4.44$$
4. **The nonlinear orbits.** For this system the nonlinear orbits really are closed (a conserved quantity proves it), and small cycles have this period; large ones take longer.

**Answer:** small oscillations circle $(1, 2)$ at frequency $\sqrt2$, with period 4.44.
:::
:::

::: example
## A latch is two inverters with gain $A$ = 3 and time constant $\tau$ = 10 ps. How fast does it resolve a 1 µV imbalance?

::: solution
1. **Jacobian at the balanced point.** With $\tau\dot x_1 = -x_1 + A\tanh x_2$ and $\tau\dot x_2 = -x_2 + A\tanh x_1$,
   $$J = \frac1\tau\begin{bmatrix}-1 & A\\A & -1\end{bmatrix}$$
   with eigenvalues $\frac{-1 \pm A}{\tau}$.
2. **Growth rate.** The difference $x_1 - x_2$ grows at
   $$\frac{A - 1}{\tau} = 2 \times 10^{11}\ \text{s}^{-1}$$
   a time constant of 5 ps.
3. **Time to resolve.** To grow from 1 µV to about 1 V takes
   $$\begin{aligned} t &= 5\ \text{ps} \times \ln 10^6 \\ &= 69\ \text{ps} \end{aligned}$$
4. **Metastability.** The smaller the starting imbalance, the longer the wait, without limit: that's metastability.

**Answer:** it takes about 69 ps to grow a 1 µV imbalance to about 1 V.
:::
:::

::: check
given: c = 0.4 | 0.6 | 1
answer: sqrt(1 - c^2/4)
unit: rad/s
tolerance: 0.5%

## At what frequency does the pendulum $\ddot\theta + \given{c}\dot\theta + \sin\theta = 0$ ring near the bottom?

::: right
Right. $J$ has $T = -c$ and $D = 1$, so $\omega_d = \sqrt{1 - c^2/4}$ = {answer}.
:::

::: misses
- [1] That's the undamped frequency; damping lowers it slightly.
- [sqrt(1 - c^2)] The eigenvalues are $\frac{-c \pm \sqrt{c^2 - 4}}{2}$: the imaginary part is $\sqrt{1 - c^2/4}$.
- [any] Not yet. Find the eigenvalues of $\begin{bmatrix}0 & 1\\-1 & -c\end{bmatrix}$.
:::
:::

::: check
given: a = 1 | 2 | 4; c = 1 | 3
answer: sqrt(a*c)
unit: rad/s
tolerance: 0.5%

## Predator and prey obey $\dot x = x(\given{a} - y)$ and $\dot y = \given{c}y(x - 1)$. At what angular frequency do small cycles around the coexistence point go?

::: right
Right. At $(1, a)$, $J = \begin{bmatrix}0 & -1\\ca & 0\end{bmatrix}$, so $\omega = \sqrt{ac}$ = {answer}.
:::

::: misses
- [sqrt(a + c)] The determinant of $J$ is the product $ac$.
- [any] Not yet. Find the equilibrium with both nonzero and its Jacobian.
:::
:::

::: check
given: A = 2 | 3 | 5; tau = 5 | 20
answer: tau/(A - 1)
unit: ps
tolerance: 0.5%

## A latch has inverter gain {A} and time constant {tau} ps. What is its regeneration time constant?

::: right
Right. The unstable eigenvalue is $\frac{A - 1}{\tau}$, so the time constant is {answer}.
:::

::: misses
- [tau/A] The $-1$ from each inverter's own decay subtracts from the gain.
- [tau/(A + 1)] That's the stable mode, where the two outputs move together.
- [any] Not yet. Linearize at the balanced point.
:::
:::

::: check
kind: choice

## An equilibrium's Jacobian has trace 0 and determinant 4. What can you conclude about the nonlinear system?

- [ ] It's a center: orbits are closed
- [ ] It's stable
- [ ] It's unstable
- [x] The linearization can't decide; the nonlinear terms do

::: right
Right. Purely imaginary eigenvalues make the equilibrium non-hyperbolic. Small nonlinear terms can turn the linear center into a slow spiral in either direction, or leave the orbits closed.
:::

::: misses
- [1] That's what the linear system does, but the nonlinear terms can break the closed orbits.
- [2] With zero trace, the linear part neither decays nor grows; stability depends on terms the linearization drops.
- [3] Same problem: the nonlinear terms decide.
:::
:::

::: check
kind: parts
given: a = 1 | 2; b = 2 | 3

## The system $\dot x = y$, $\dot y = \given{a}x - x^3 - \given{b}y$ has an equilibrium at $x = \sqrt{\given{a}}$, $y = 0$.

::: part
answer: -2*a
tolerance: 0.5%

### What is $\partial g/\partial x$ there, with $g = ax - x^3 - by$?

::: misses
- [a] Include the $-3x^2$ from $x^3$: $a - 3a = -2a$.
- [any] $a - 3x^2$ at $x^2 = a$.
:::
:::

::: part
answer: 2*a
tolerance: 0.5%

### What is the determinant of $J$?

::: misses
- [any] $J = \begin{bmatrix}0 & 1\\-2a & -b\end{bmatrix}$.
:::
:::
:::

::: check
kind: derivation
vars: c = 0..2

## Linearize the pendulum $\dot\theta = \omega$, $\dot\omega = -\sin\theta - c\omega$ at the top, $(\pi, 0)$.

::: step
answer: 1

### What is $\partial(-\sin\theta)/\partial\theta$ at $\theta = \pi$?
:::

::: step
answer: (-c + sqrt(c^2 + 4))/2

### $J = \begin{bmatrix}0 & 1\\1 & -c\end{bmatrix}$. What is its positive eigenvalue?
:::

::: right
Right. A positive eigenvalue at the top: any small tilt grows, at a rate that friction slows but never stops.
:::
:::

::: check
kind: python

## For the double well $\ddot x = x - x^3 - 0.3\dot x$, compute the Jacobian at each equilibrium $x = -1, 0, 1$ (with $\dot x = 0$), find its eigenvalues with `np.linalg.eigvals`, and set `kinds` to a list of `"saddle"`, `"stable spiral"` or `"stable node"` for each.

```python starter
import numpy as np

kinds = ["saddle", "saddle", "saddle"]
print(kinds)
```

```python solution
import numpy as np

kinds = []
for x0 in (-1, 0, 1):
    J = np.array([[0.0, 1.0], [1 - 3 * x0**2, -0.3]])
    lam = np.linalg.eigvals(J)
    if np.all(np.abs(lam.imag) < 1e-12) and lam.real.min() < 0 < lam.real.max():
        kinds.append("saddle")
    elif np.any(np.abs(lam.imag) > 1e-12):
        kinds.append("stable spiral" if np.all(lam.real < 0) else "unstable spiral")
    else:
        kinds.append("stable node" if np.all(lam.real < 0) else "unstable node")
print(kinds)
```

```python tests
assert kinds == ["stable spiral", "saddle", "stable spiral"], f"The valleys are stable spirals and the hump is a saddle; got {kinds}."
```

::: right
Right. Two stable spirals and a saddle between them: the signature of a bistable system.
:::
:::

::: explain
## A circuit designer computes a transistor amplifier's small-signal gain. In what sense is that a linearization at an equilibrium?

::: model
With its DC sources on and no signal, the amplifier settles to a bias point: every node voltage and branch current constant, an equilibrium of the circuit's nonlinear equations. A small signal moves the circuit slightly away from it. Expanding each device's nonlinear characteristic to first order around the bias point replaces it with its slope, a transconductance or a small-signal resistance, which are exactly the entries of the Jacobian. The small-signal circuit is the linearized system, and its gain, poles and stability hold for signals small enough that the neglected curvature doesn't matter. Large signals leave that region, which is where distortion and clipping come from.
:::
:::

::: practice

::: check
given: c = 0..1.9
answer: sqrt(1 - c^2/4)
tolerance: 0.5%

## Ringing frequency of the pendulum near the bottom with damping {c}?

::: misses
- [any] $\sqrt{1 - c^2/4}$.
:::
:::

::: check
given: A = 1.5..10; tau = 1..100
answer: tau/(A - 1)
tolerance: 0.5%

## Regeneration time constant for gain {A}, $\tau$ = {tau}?

::: misses
- [any] $\frac{\tau}{A - 1}$.
:::
:::
:::
