---
title: Autonomous equations and stability
heading: Where a system settles, without solving it
eyebrow: A8 · Lesson 9 · Autonomous equations
xp: 40
---

::: hook
A memory cell holds a bit because it has two places to come to rest, one for 0 and one for 1, and an unstable balance point between them. Nudge it past the balance point and it snaps to the other side. You can see all of that from the differential equation without solving it: find where the rate of change is zero, then check which way things move nearby. For equations whose rate depends only on the state, not on the clock, that picture tells you nearly everything.
:::

::: play
- A latch's internal voltage obeys $\dot v = -v + A\tanh v$ (time in units of its time constant). The curves start from different voltages.
- With $A$ below 1 every start falls to 0 V. Raise $A$ above 1. Where do the curves go now?
- Start just above and just below 0 V. How long does it take to decide?
:::
:::

```sim plot
view: flow
x: t = 0..8
y: v = -3..3 V
slider: A = 0.5..3 step 0.1 = 2
dx: 1
dy: -v + A*tanh(v)
start: 0, 0.05 | forward
start: 0, -0.05 | forward
start: 0, 2.8 | forward
start: 0, -2.8 | forward
start: 0, 1 | forward
grid: 16
readout: growth rate at 0 V = A - 1 | digits: 3
```

::: predict
## For $\dot y = y(4 - y)$, starting at $y = 1$, where does $y$ end up?

- [ ] At 0
- [x] At 4
- [ ] It grows without limit
- [ ] It oscillates around 4

::: reveal
At 4. Between 0 and 4 the rate $y(4 - y)$ is positive, so $y$ rises; it can't pass 4, where the rate is zero, and above 4 the rate would be negative and push it back. A first-order autonomous equation can't oscillate: on a line, a solution can only move one way until it reaches an equilibrium.
:::
:::

::: nameit
## Autonomous equations

An equation $\dot y = f(y)$, where the rate depends only on $y$, is **autonomous**. Its **equilibria** are the values with $f(y^*) = 0$: start there and you stay there.

## The phase line

Draw the $y$ axis, mark the equilibria, and between them draw an arrow up where $f > 0$ and down where $f < 0$. That **phase line** shows every solution's fate:

- **stable** equilibrium: arrows point toward it on both sides ($f$ goes from $+$ to $-$);
- **unstable**: arrows point away on both sides ($f$ goes from $-$ to $+$);
- **semi-stable**: toward it on one side, away on the other.

## Linearizing near an equilibrium

Near $y^*$, $f(y) \approx f'(y^*)(y - y^*)$, so a small deviation $u = y - y^*$ obeys $\dot u = f'(y^*)u$:

$$u(t) \approx u_0e^{f'(y^*)t}$$

$f'(y^*) < 0$ means stable, with time constant $\frac{1}{|f'(y^*)|}$; $f'(y^*) > 0$ means unstable, with deviations growing by a factor of $e$ every $\frac{1}{f'(y^*)}$.

## The latch

For $\dot v = -v + A\tanh v$, $f'(0) = A - 1$. With $A < 1$, 0 V is the only equilibrium and it's stable. As $A$ passes 1, 0 V turns unstable and two new stable equilibria appear at $\pm v^*$, where $v^* = A\tanh v^*$: a **bifurcation**. Above it, the circuit is bistable, a one-bit memory. A tiny starting offset $\varepsilon$ takes about $\frac{\ln(1/\varepsilon)}{A - 1}$ time constants to resolve, which is why a latch caught exactly at the balance point can hang for a long time (metastability, C7).
:::

::: example
## Analyze the logistic equation $\dot P = rP(1 - P/K)$.

::: solution
1. **Equilibria.** $f(P) = rP(1 - P/K)$ is zero at $P = 0$ and $P = K$.
2. **Arrows on the phase line.** Between them $f > 0$, so arrows point up toward $K$; above $K$, $f < 0$, pointing back down.
3. **Slopes at the equilibria.**
   $$f'(P) = r(1 - 2P/K)$$
   At 0 it's $r > 0$, so 0 is unstable. At $K$ it's $-r$, so $K$ is stable, with time constant $1/r$.

**Answer:** $P = 0$ is unstable and $P = K$ is stable with time constant $1/r$; solutions between 0 and $K$ rise toward $K$, and solutions above it fall back.
:::
:::

::: example
## For the latch with $A = 2$, find the stable equilibria and their time constant.

::: solution
1. **Find the equilibrium.** Solve $v = 2\tanh v$ by iterating $v \leftarrow 2\tanh v$: it settles at
   $$v^* = 1.915$$
2. **Slope there.**
   $$\begin{aligned} f'(v^*) &= -1 + 2\,\text{sech}^2v^* \\ &= -0.834 \end{aligned}$$
3. **Time constant.** Small upsets die with a time constant of
   $$\begin{aligned} \tau &= \frac{1}{0.834} \\ &= 1.2 \end{aligned}$$
   time units.
4. **The other equilibria.** The other stable state is $-1.915$, and 0 is unstable with $f'(0) = 1$.

**Answer:** the stable equilibria are $v = \pm1.915$, each with a time constant of 1.2 units.
:::
:::

::: example
## Find the equilibria of $\dot y = y^2 - 4$ and decide which are stable.

::: solution
1. **Equilibria.** $f(y) = y^2 - 4$ is zero at $y = \pm2$. Its slope is $f'(y) = 2y$.
2. **At $y = -2$.** $f' = -4 < 0$: stable, and nearby solutions approach it with time constant $\frac14$.
3. **At $y = 2$.** $f' = 4 > 0$: unstable.
4. **The phase line.** $f < 0$ between them, so solutions starting there drift down to $-2$; above 2, $f > 0$ and they run off upward.

**Answer:** $y = -2$ is stable, with time constant $\frac14$, and $y = 2$ is unstable.
:::
:::

::: check
given: a = 3 | 5 | 8
answer: a

## For $\dot y = y(\given{a} - y)$, which equilibrium is stable?

::: right
Right. $f'(y) = a - 2y$ is $-a$ at $y = a$: stable. At 0 it's $+a$: unstable.
:::

::: misses
- [0] At 0, $f' = a > 0$: small positive $y$ grows away from it.
- [any] Not yet. Find the zeros of $f$ and the sign of $f'$ at each.
:::
:::

::: check
given: r = 0.5 | 2 | 0.1
answer: 1/r
tolerance: 0.5%

## For $\dot P = \given{r}P(1 - P/K)$, what is the time constant with which small deviations from $P = K$ die away?

::: right
Right. $f'(K) = -r$, so the time constant is $\frac{1}{r}$ = {answer}.
:::

::: misses
- [r] The time constant is the reciprocal of the rate.
- [any] Not yet. Linearize: compute $f'(K)$.
:::
:::

::: check
given: A = 1.5 | 2 | 3
answer: ln(1000)/(A - 1)
tolerance: 0.5%

## A latch with $\dot v = -v + \given{A}\tanh v$ starts 1 mV from its balance point. Near there, how many time constants does it take for the offset to grow to 1 V?

::: right
Right. Near 0 the offset grows as $e^{(A - 1)t}$, so a factor of 1000 takes $\frac{\ln 1000}{A - 1}$ = {answer}.
:::

::: misses
- [ln(1000)/A] The growth rate is $f'(0) = A - 1$: the $-v$ term fights the gain.
- [any] Not yet. Linearize at 0: $f'(0) = A - 1$.
:::
:::

::: check
given: c = 4 | 9 | 2
answer: -sqrt(c)
tolerance: 0.5%

## For $\dot y = y^2 - \given{c}$, which equilibrium is stable?

::: right
Right. The equilibria are $\pm\sqrt{c}$, and $f'(y) = 2y$ is negative at $-\sqrt c$ = {answer}.
:::

::: misses
- [sqrt(c)] There $f' = 2\sqrt c > 0$: unstable.
- [any] Not yet. Find the sign of $f'(y) = 2y$ at each equilibrium.
:::
:::

::: check
given: a = 0 | 1 | 2
answer: a + 2

## $\dot y = (y - \given{a})(y - \given{a} - 2)(y - \given{a} - 4)$ has three equilibria. Which one is stable?

::: right
Right. The signs of $f$ go $-, +, -, +$ across the three zeros, so the middle one, {answer}, has arrows pointing in from both sides.
:::

::: misses
- [a] Just above it $f > 0$: solutions move away.
- [a + 4] Just above it $f > 0$: unstable.
- [any] Not yet. Check the sign of $f$ between the equilibria.
:::
:::

::: check
kind: choice

## What kind of equilibrium is $y = 0$ for $\dot y = y^2$?

- [ ] Stable
- [ ] Unstable
- [x] Semi-stable: approached from below, left from above
- [ ] Not an equilibrium

::: right
Right. $y^2 \ge 0$, so $y$ always rises: from below it climbs toward 0, from above it climbs away.
:::

::: misses
- [1] Above 0 solutions move away.
- [2] Below 0 solutions move toward it.
- [any] Draw the arrows on each side.
:::
:::

::: check
kind: parts
given: c = 4 | 9 | 16

## Consider $\dot y = y^2 - \given{c}$.

::: part
answer: -sqrt(c)
tolerance: 0.5%

### Which equilibrium is stable?

::: misses
- [sqrt(c)] There $f' = 2y > 0$: unstable.
- [any] Stable where $f'(y) = 2y < 0$.
:::
:::

::: part
answer: 1/(2*sqrt(c))
tolerance: 0.5%

### What is the time constant of approach to it?

::: misses
- [any] $1/|f'| = \frac{1}{2\sqrt c}$.
:::
:::
:::

::: check
kind: derivation
vars: r = 0.2..2, K = 10..100

## Linearize the logistic equation $\dot P = rP(1 - P/K)$ at its equilibria.

::: step
answer: r

### What is $f'(0)$?
:::

::: step
answer: -r

### What is $f'(K)$?
:::

::: right
Right. Growth at rate $r$ near 0 and recovery at rate $r$ near $K$: 0 is unstable and $K$ is stable.
:::
:::

::: explain
## Why can't a solution of a first-order autonomous equation $\dot y = f(y)$ oscillate?

::: model
The rate $\dot y$ depends only on the current value of $y$. To oscillate, $y$ would have to pass the same value twice, once going up and once going down, but at that value the equation gives a single rate with a single sign. So a solution moves in one direction only, until it approaches an equilibrium where $f = 0$ or runs off to infinity. Oscillation needs at least two state variables, like the voltage and current in an LC circuit.
:::
:::

::: practice

::: check
given: K = 20 | 50 | 100 | 200 | 500 | 1000
answer: K

## For $\dot P = 0.3P(1 - P/\given{K})$, starting at $P = 1$, where does $P$ end up?

::: misses
- [0] 0 is unstable; any positive start grows away.
- [any] The stable equilibrium.
:::
:::

::: check
given: k = 2 | 5; Ta = 20 | 30
answer: 1/k
tolerance: 0.5%

## A body cools as $\dot T = -\given{k}(T - \given{Ta})$. What is the time constant of its approach to {Ta}?

::: misses
- [k] Reciprocal of the rate.
- [any] $f'(T_a) = -k$.
:::
:::

::: check
given: A = 0.1 | 0.25 | 0.4 | 0.6 | 0.8 | 0.9
answer: 1/(1 - A)
tolerance: 0.5%

## A latch with gain $A$ = {A}, below 1, has 0 V as its only equilibrium. What is its time constant there, in units of the circuit's?

::: misses
- [1/A] The rate is $f'(0) = A - 1$.
- [any] $\frac{1}{|A - 1|}$.
:::
:::
:::
