---
title: Bifurcations
heading: When turning a knob changes what a system can do
eyebrow: A8 · Lesson 10 · Bifurcations
xp: 40
---

::: hook
Lesson 9 found a system's equilibria and their stability for fixed parameters. Real systems have knobs: a gain, a bias current, a supply voltage. Turn one slowly and the equilibria slide around, but at certain values something qualitative happens: two equilibria collide and vanish, or one splits into three. These are **bifurcations**, and they explain why a latch has two states, why a Schmitt trigger switches at different thresholds going up and going down, and why a system near a tipping point responds more and more sluggishly.
:::

::: play
- The curve is $f(y) = ry - y^3$, the rate in $\dot y = ry - y^3$. Equilibria are where it crosses zero.
- With $r < 0$ there's one crossing, at 0, and it's stable: the curve slopes down there.
- Raise $r$ past 0. The origin's slope turns positive, so it becomes unstable, and two new stable equilibria appear at $\pm\sqrt r$: a pitchfork.
:::

```sim plot
view: graph
x: y = -2.5..2.5
y: rate = -3..3
slider: r = -2..2 step 0.05 = -0.5
plot: r*y - y^3 | label: f(y) = ry − y³
plot: 0 | dashed | color: ch2 | label: zero
readout: number of equilibria = 1 + 2*step(r) | digits: 1
readout: outer equilibria at ± = sqrt(r*step(r)) | digits: 4
```

::: predict
## In $\dot y = r + y^2$, what happens to the equilibria as $r$ rises from $-1$ to $+1$?

- [ ] They move apart
- [x] Two equilibria approach each other, merge at $r = 0$, and disappear
- [ ] One equilibrium splits into two
- [ ] Nothing changes: there are always two

::: reveal
They merge and vanish. For $r < 0$ the equilibria are $y = \pm\sqrt{-r}$: $-\sqrt{-r}$ stable, $+\sqrt{-r}$ unstable. At $r = 0$ they meet at $y = 0$, and for $r > 0$, $r + y^2$ is never zero, so every solution runs off to infinity. This is a **saddle-node** bifurcation, the most common way equilibria are born or destroyed.
:::
:::

::: nameit
## Bifurcations

In $\dot y = f(y, r)$, an equilibrium $y^*$ can only change stability or disappear where $\frac{\partial f}{\partial y} = 0$ there: where the linearization's time constant becomes infinite. Three standard forms, each the simplest equation with that behavior:

| Name | Normal form | What happens as $r$ passes 0 |
|---|---|---|
| Saddle-node | $\dot y = r + y^2$ | two equilibria merge and disappear |
| Transcritical | $\dot y = ry - y^2$ | two equilibria cross and swap stability |
| Pitchfork | $\dot y = ry - y^3$ | one stable equilibrium becomes unstable and two stable ones appear |

A **bifurcation diagram** plots the equilibria against $r$, solid where stable and dashed where unstable.

## Critical slowing down

Near a bifurcation, $f'(y^*)$ is close to zero, so the time constant $1/|f'(y^*)|$ is long: the system recovers slowly from small disturbances. For the pitchfork's outer equilibria, $f'(\pm\sqrt r) = r - 3r = -2r$, so the time constant is $\frac{1}{2r}$, growing without bound as $r \to 0$.

## Hysteresis

A latch with gain $A$ and input $u$, $\dot y = -y + A\tanh y + u$, has two stable states when $A > 1$. Raising $u$ eventually makes the lower state disappear in a saddle-node bifurcation, and the output jumps up; lowering $u$ makes it jump back, but at a different threshold. Between the thresholds, the state depends on history. That's a Schmitt trigger. The thresholds are where $f = 0$ and $f' = 0$ together: $\cosh^2y = A$, giving

$$u^* = \pm\left(A\sqrt{1 - 1/A} - \cosh^{-1}\sqrt A\right)$$
:::

::: example
## Find the equilibria of $\dot y = r + y^2$ for $r = -4$, and what happens at $r = 0$.

::: solution
1. **Equilibria at $r = -4$.**
   $$-4 + y^2 = 0$$
   gives $y = \pm 2$.
2. **Stability.** The slope $f'(y) = 2y$ is $-4$ at $y = -2$ (stable, time constant 0.25) and $+4$ at $y = 2$ (unstable).
3. **As $r$ rises toward 0.** The two move toward each other as $\pm\sqrt{-r}$, and their slopes shrink as $\mp2\sqrt{-r}$.
4. **At $r = 0$ and beyond.** They merge at 0 with slope 0, and for any positive $r$ there's no equilibrium at all.

**Answer:** at $r = -4$, $y = -2$ is stable and $y = 2$ is unstable; at $r = 0$ they merge at 0, and for $r > 0$ there are none.
:::
:::

::: example
## For $\dot y = ry - y^3$ with $r = 0.5$, find the stable equilibria and their time constant.

::: solution
1. **Equilibria.**
   $$y(r - y^2) = 0$$
   gives $y = 0$ and $y = \pm\sqrt{0.5} = \pm0.707$.
2. **Stability.** The slope $f' = r - 3y^2$ is $0.5$ at the origin (unstable) and $0.5 - 1.5 = -1$ at $\pm0.707$ (stable).
3. **Time constant.**
   $$\begin{aligned} \tau &= \frac{1}{2r} \\ &= 1 \end{aligned}$$
4. **Near the bifurcation.** At $r = 0.05$ it would be 10: the closer to the bifurcation, the longer the system takes to settle after a nudge.

**Answer:** the stable equilibria are $y = \pm0.707$, with a time constant of 1.
:::
:::

::: example
## A latch obeys $\dot y = -y + 2\tanh y + u$. At what input does it switch?

::: solution
1. **The condition.** The thresholds are where an equilibrium and its slope vanish together.
2. **Where the slope vanishes.** Set $f' = 0$:
   $$-1 + 2\,\text{sech}^2y = 0$$
   This gives $\cosh y = \sqrt2$, so $y^* = 0.881$, where $\tanh y^* = 0.707$.
3. **Where the equilibrium vanishes too.** $f = 0$ at $y^*$ needs
   $$\begin{aligned} u &= y^* - 2\tanh y^* \\ &= 0.881 - 1.414 \\ &= -0.533 \end{aligned}$$
4. **The two thresholds.** So the high state survives until $u$ falls to $-0.533$, and the low state until $u$ rises to $+0.533$.
5. **Hysteresis.** Between those values the output depends on which way the input came from: a hysteresis band 1.07 wide.

**Answer:** it switches low when $u$ falls to −0.533 and high when $u$ rises to +0.533, a hysteresis band 1.07 wide.
:::
:::

::: check
given: r = -1 | -4 | -9
answer: -sqrt(-r)
tolerance: 0.5%

## Where is the stable equilibrium of $\dot y = \given{r} + y^2$?

::: right
Right. $y = -\sqrt{-r}$ = {answer}, where $f' = 2y < 0$.
:::

::: misses
- [sqrt(-r)] There $f' = 2y > 0$: that one is unstable.
- [any] Not yet. Solve $r + y^2 = 0$ and check the sign of $f'$.
:::
:::

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

## What is the time constant of the stable equilibria of $\dot y = \given{r}y - y^3$?

::: right
Right. $f'(\pm\sqrt r) = -2r$, so the time constant is {answer}.
:::

::: misses
- [1/r] That's the time constant of the unstable origin's growth; at $\pm\sqrt r$ the slope is $-2r$.
- [1/(3*r)] $f' = r - 3y^2$ with $y^2 = r$ is $-2r$.
- [any] Not yet. Evaluate $f'(y) = r - 3y^2$ at $y^2 = r$.
:::
:::

::: check
given: A = 2 | 3 | 5
answer: A*sqrt(1 - 1/A) - ln(sqrt(A) + sqrt(A - 1))
tolerance: 0.5%

## A latch $\dot y = -y + \given{A}\tanh y + u$ switches from low to high when $u$ rises to what value?

::: right
Right. $u^* = A\sqrt{1 - 1/A} - \cosh^{-1}\sqrt A$ = {answer}.
:::

::: misses
- [any] Not yet. Solve $f' = 0$ for $y^*$ ($\cosh^2y^* = A$), then $f(y^*) = 0$ for $u$.
:::
:::

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

## For the transcritical form $\dot y = \given{r}y - y^2$, where is the stable equilibrium?

::: right
Right. $y = r$ = {answer}, where $f' = r - 2y = -r < 0$.
:::

::: misses
- [0] At $y = 0$, $f' = r > 0$: unstable for positive $r$.
- [any] Not yet. Solve $y(r - y) = 0$ and check $f' = r - 2y$.
:::
:::

::: check
kind: parts
given: r = 0.25 | 4 | 9

## Consider $\dot y = \given{r}y - y^3$.

::: part
answer: sqrt(r)
tolerance: 0.5%

### Where is the positive stable equilibrium?

::: misses
- [r] $y^2 = r$.
- [any] Solve $y(r - y^2) = 0$.
:::
:::

::: part
answer: r
tolerance: 0.5%

### At what rate do small disturbances grow away from the origin?

::: misses
- [any] $f'(0) = r$.
:::
:::
:::

::: check
kind: derivation
vars: r = -4..-0.25

## Follow the saddle-node $\dot y = r + y^2$ for $r < 0$.

::: step
answer: -sqrt(-r)

### Where is the stable equilibrium?
:::

::: step
answer: -2*sqrt(-r)

### What is $f'$ there?
:::

::: step
answer: 1/(2*sqrt(-r))

### What is its time constant?
:::

::: right
Right. The time constant $\frac{1}{2\sqrt{-r}}$ grows without bound as $r \to 0$: critical slowing down.
:::
:::

::: explain
## A slowly drifting system takes longer and longer to recover from small disturbances. Why can that warn that a sudden change is coming?

::: model
A system sits at a stable equilibrium, and the speed of its recovery from a nudge is set by the slope $f'(y^*)$, through the time constant $1/|f'(y^*)|$. An equilibrium can only disappear or lose stability where that slope reaches zero, which is exactly where the time constant becomes infinite. So as a parameter drifts toward a bifurcation, recoveries get slower before anything dramatic happens. Engineers watch for it in power grids near voltage collapse and in circuits near a switching threshold; once the slope crosses zero, the equilibrium is gone and the system jumps somewhere else.
:::
:::

::: practice

::: check
given: r = 0.01..10
answer: 1/(2*r)
tolerance: 0.5%

## Time constant of the pitchfork's outer equilibria at $r$ = {r}?

::: misses
- [any] $\frac{1}{2r}$.
:::
:::

::: check
given: A = 1.1..10
answer: A*sqrt(1 - 1/A) - ln(sqrt(A) + sqrt(A - 1))
tolerance: 0.5%

## Schmitt-trigger threshold for gain {A}?

::: misses
- [any] $A\sqrt{1 - 1/A} - \cosh^{-1}\sqrt A$.
:::
:::
:::
