---
title: Equilibrium points and linearization
heading: Finding equilibria, linearizing nonlinear models with Jacobians, the pendulum hanging and inverted, magnetic levitation, a draining tank, and how far a linear model can be trusted
eyebrow: S9 · Lesson 3 · Equilibrium points and linearization
xp: 50
---

::: hook
Almost every real plant is nonlinear: a pendulum's restoring torque goes as sin θ, a magnet's pull as the square of its current over the square of the gap, a tank drains as the square root of its level. Yet nearly all of control design uses linear models. That works because a controller's job is usually to hold the plant near one operating point, and near any point a smooth nonlinear system behaves like a linear one. This lesson shows how to find that linear model and how to tell when it's no longer good enough.
:::

::: play
- A damped pendulum's phase portrait: angle against angular velocity, with $\ddot\theta = -(g/l)\sin\theta - c\dot\theta$.
- Near θ = 0 the trajectories spiral in like a linear oscillator's. Near θ = ±π, the inverted position, they run away along a saddle: that equilibrium is unstable.
- Start far enough out and the pendulum swings over the top before settling, something no linear model of the bottom equilibrium can show.
:::

```sim plot
view: flow
x: theta = -7..7 rad
y: w = -8..8 rad/s
slider: l = 0.25..2 = 0.5 m
slider: c = 0..1 = 0.3
dx: w
dy: -9.81/l*sin(theta) - c*w
start: 1, 0 | label: small swing
start: 0, 7 | label: over the top
heads: on
```

::: predict
## A pendulum 0.5 m long is balanced upside down. If it starts to tip, how fast does the deviation grow?

- [ ] It doubles every 1.4 s, its swinging period
- [x] It doubles about every 0.16 s
- [ ] It doubles every 15 ms
- [ ] It doesn't grow; the upright position is an equilibrium

::: reveal
Linearized about the top, $\ddot{\delta} = (g/l)\delta$, so the deviation grows as $e^{pt}$ with $p = \sqrt{9.81/0.5}$ = 4.43 s⁻¹: it doubles every ln 2/4.43 = 0.156 s. A balancing controller has to act well within that time.
:::
:::

::: nameit
## Equilibria

For $\dot{x} = f(x, u)$, an **equilibrium** $(x_0, u_0)$ has $f(x_0, u_0) = 0$: with that input held, the state stays put.

## Linearization

Write $x = x_0 + \delta x$, $u = u_0 + \delta u$ and keep the first-order terms of the Taylor series:

$$\delta\dot{x} = A\,\delta x + B\,\delta u, \qquad A = \frac{\partial f}{\partial x}\Big|_0, \quad B = \frac{\partial f}{\partial u}\Big|_0$$

The eigenvalues of A are the poles of the linear model. Any in the right half-plane mean the equilibrium is unstable, and the nonlinear system is too (Lyapunov's indirect method); eigenvalues on the imaginary axis leave the question to the nonlinear terms.

## Three plants

- **Pendulum** $ml^2\ddot\theta = -mgl\sin\theta - b\dot\theta + \tau$: about the bottom, $\omega_n = \sqrt{g/l}$; about the top, poles at $\pm\sqrt{g/l}$.
- **Magnetic levitation** $m\ddot{x} = mg - ki^2/x^2$ (x the gap): equilibrium $ki_0^2/x_0^2 = mg$, linear model $\delta\ddot{x} = \frac{2g}{x_0}\delta x - \frac{2g}{i_0}\delta i$, poles at $\pm\sqrt{2g/x_0}$.
- **Draining tank** $A\dot{h} = q_\text{in} - c\sqrt{h}$: outflow changes by $\frac{c}{2\sqrt{h_0}}\delta h$, so the level responds with time constant $\tau = 2Ah_0/q_0$.

## How far to trust it

The model is good while the neglected terms stay small. For the pendulum, sin θ ≈ θ is 0.5% off at 10°, 2.1% at 20° and 4.7% at 30°.
:::

::: example
## A magnetic levitation rig holds a steel ball 10 mm below an electromagnet. How fast is the open-loop instability?

::: solution
1. **Open-loop poles.**
   $$\begin{aligned} s &= \pm\sqrt{2g/x_0} \\ &= \pm\sqrt{2 \times 9.81/0.01} \\ &= \pm 44.3\ \text{s}^{-1} \end{aligned}$$
2. **Doubling time.** A disturbance doubles every 15.6 ms.
3. **What the loop needs.** The controller needs a loop bandwidth of well over 44 rad/s, and a sensor and amplifier fast enough to support it.
4. **Effect of the gap.** Halving the gap makes the pole √2 times faster.

**Answer:** the poles sit at ±44.3 s⁻¹, so a disturbance doubles every 15.6 ms.
:::
:::

::: example
## A tank of area 0.5 m² drains through a valve and holds 1 m of water with an inflow of 0.01 m³/s. How quickly does its level respond to small changes in inflow?

::: solution
1. **Linearize the outflow.** At equilibrium $q_0 = c\sqrt{h_0}$, and a small change in level changes the outflow by
   $$\delta q = \frac{q_0}{2h_0}\,\delta h$$
2. **Level equation.** It's a first-order system:
   $$A\,\delta\dot{h} = \delta q_\text{in} - \frac{q_0}{2h_0}\delta h$$
3. **Time constant.**
   $$\begin{aligned} \tau &= \frac{2Ah_0}{q_0} \\ &= \frac{2 \times 0.5 \times 1}{0.01} \\ &= 100\ \text{s} \end{aligned}$$
4. **Fuller tanks.** A tank running fuller responds more slowly.

**Answer:** the level follows small changes in inflow with a 100 s time constant.
:::
:::

::: example
## A heat sink at 400 K radiates to surroundings at 300 K with emissivity 0.9 and area 0.01 m². What thermal resistance does radiation add for small changes in temperature?

::: solution
1. **Radiated power.**
   $$P = \epsilon\sigma A(T^4 - T_a^4)$$
2. **Slope at $T_0$.**
   $$\begin{aligned} \frac{dP}{dT} &= 4\epsilon\sigma AT_0^3 \\ &= 4 \times 0.9 \times 5.67 \times 10^{-8} \\ &\quad \times 0.01 \times 400^3 \\ &= 0.131\ \text{W/K} \end{aligned}$$
3. **Thermal resistance.** That slope is an incremental thermal resistance, in parallel with convection:
   $$\begin{aligned} R &= \frac{1}{0.131\ \text{W/K}} \\ &= 7.7\ \text{K/W} \end{aligned}$$
4. **Why the model drifts.** Because the slope grows as $T_0^3$, the same sink is a better radiator when hot, and a linear model made at one temperature drifts at another.

**Answer:** radiation adds an incremental thermal resistance of 7.7 K/W, in parallel with convection.
:::
:::

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

## What's the small-swing period of a pendulum {l} m long?

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

::: misses
- [sqrt(l/9.81)] Multiply by 2π for the period.
- [any] Not yet. Linearize: $\omega_n = \sqrt{g/l}$.
:::
:::

::: check
given: l = 0.2 | 0.5 | 1.5
answer: 1000*ln(2)/sqrt(9.81/l)
unit: ms
tolerance: 0.5%

## A pendulum {l} m long is balanced upright. How long does a small tilt take to double?

::: right
Right. The unstable pole is $\sqrt{g/l}$, so doubling takes ln 2 divided by it: {answer} ms.
:::

::: misses
- [1000/sqrt(9.81/l)] That's the time to grow by a factor of e.
- [any] Not yet. The linearized model at the top has a pole at $+\sqrt{g/l}$.
:::
:::

::: check
given: x = 2 | 5 | 10 | 20
answer: sqrt(2*9.81/(x*1e-3))
unit: rad/s
tolerance: 0.5%

## A maglev rig holds its ball {x} mm from the magnet. Where's its unstable pole?

::: right
Right. $\sqrt{2g/x_0}$ = {answer} rad/s.
:::

::: misses
- [sqrt(9.81/(x*1e-3))] The force goes as $1/x^2$, which brings a factor of 2.
- [any] Not yet. Differentiate $g - ki^2/(mx^2)$ with respect to x at equilibrium.
:::
:::

::: check
given: A = 0.2 | 1 | 3; h = 0.5 | 2; q = 0.005 | 0.02
answer: 2*A*h/q
unit: s
tolerance: 0.5%

## A tank of area {A} m² holds {h} m with a steady flow of {q} m³/s through a valve. What's its linearized time constant?

::: right
Right. $2Ah_0/q_0$ = {answer} s.
:::

::: misses
- [A*h/q] The square-root law halves the outflow's sensitivity, doubling the time constant.
- [any] Not yet. Linearize $c\sqrt{h}$ about $h_0$.
:::
:::

::: check
given: d = 5 | 15 | 25 | 40
answer: 100*(d*pi/180/sin(d*pi/180) - 1)
unit: %
tolerance: 1%

## At {d}°, how far (as a percentage) does θ overstate sin θ?

::: right
Right. {answer}%.
:::

::: misses
- [any] Not yet. Compare θ in radians with sin θ.
:::
:::

::: check
given: n = 1.2 | 2; I = 0.1 | 1 | 10
answer: n*25.85/I
unit: Ω
tolerance: 0.5%

## A diode with ideality factor {n} is biased at {I} mA at 300 K. What's its small-signal resistance?

::: right
Right. $nV_T/I$ = {answer} Ω: the slope of the exponential at the operating point.
:::

::: misses
- [25.85/I] Include the ideality factor.
- [any] Not yet. Differentiate $I_Se^{V/nV_T}$.
:::
:::

::: check
kind: parts
given: x = 5 | 10 | 20; i = 0.5 | 1 | 2

## A magnetic levitation rig holds its ball {x} mm from the magnet with {i} A of coil current.

::: part
answer: sqrt(2*9.81/(x*1e-3))
unit: rad/s
tolerance: 0.5%

### Where is its unstable pole?

::: misses
- [sqrt(9.81/(x*1e-3))] The force goes as $1/x^2$, which brings a factor 2.
- [any] $\sqrt{2g/x_0}$.
:::
:::

::: part
answer: 2*9.81/i
unit: m/s²/A
tolerance: 0.5%

### How strongly does a current change accelerate the ball, in m/s² per ampere?

::: misses
- [any] $2g/i_0$ per ampere.
:::
:::
:::

::: check
kind: derivation
vars: g = 1..30, l = 0.05..5

## A pendulum of length l under gravity g.

::: step
answer: sqrt(g/l)

### What is its natural frequency hanging down?
:::

::: step
answer: sqrt(g/l)

### Where is the unstable pole when it's balanced upright?
:::

::: step
answer: ln(2)/sqrt(g/l)

### How long does a small tilt take to double?
:::

::: right
Right. The same $\sqrt{g/l}$ sets the swing below and the fall above: short pendulums are hard to balance.
:::
:::

::: explain
## Why can a linear model be trusted to decide whether an equilibrium is unstable?

::: model
Near an equilibrium the nonlinear terms in the dynamics are of second order in the deviation, so for small enough deviations they are swamped by the linear terms. If the linear model has a pole in the right half-plane, a small deviation along that mode grows exponentially, and while it's still small the nonlinear terms can't stop it, so the true system leaves the neighborhood too. Likewise, if every pole is in the left half-plane, small deviations decay before the nonlinear terms matter. Only when a pole sits exactly on the imaginary axis is the linear model silent, because then the small nonlinear terms decide whether the motion grows or decays.
:::
:::

::: practice

::: check
given: l = 0.1 | 0.8 | 3
answer: 2*pi*sqrt(l/9.81)
unit: s
tolerance: 0.5%

## Small-swing period of a {l} m pendulum?

::: misses
- [any] $2\pi\sqrt{l/g}$.
:::
:::

::: check
given: x = 3 | 8 | 15
answer: sqrt(2*9.81/(x*1e-3))
unit: rad/s
tolerance: 0.5%

## Maglev unstable pole at a {x} mm gap?

::: misses
- [any] $\sqrt{2g/x_0}$.
:::
:::

::: check
given: A = 0.5 | 2; h = 1 | 4; q = 0.01 | 0.05
answer: 2*A*h/q
unit: s
tolerance: 0.5%

## Tank time constant: area {A} m², level {h} m, flow {q} m³/s?

::: misses
- [any] $2Ah_0/q_0$.
:::
:::
:::
