---
title: Linear systems and eigenvalues
heading: Solving x′ = Ax with eigenvalues
eyebrow: A8 · Lesson 37 · Linear systems
xp: 40
---

::: hook
A circuit with a capacitor and an inductor has two state variables, the capacitor's voltage and the inductor's current, and its state equation is $\dot{\mathbf{x}} = A\mathbf{x}$. The eigenvalues of $A$ turn out to be exactly the characteristic roots you've been finding all along, and its eigenvectors say how the voltage and current move together in each mode. When the eigenvalues are complex, the circuit rings, and the real and imaginary parts of one complex solution give you the two real ones.
:::

::: play
- The arrows show $\dot{\mathbf{x}} = A\mathbf{x}$ for $A = \begin{bmatrix}0 & 1\\-q & -p\end{bmatrix}$, the state form of $\ddot y + p\dot y + qy = 0$ with $\mathbf{x} = (y, \dot y)$. The curves are trajectories from a few starting states.
- Make $p^2 < 4q$: the trajectories spiral in. Make $p^2 > 4q$: they slide in along straight lines, the eigenvector directions.
- The readouts are the eigenvalues' real part and their imaginary part (zero when they're real).
:::
:::

```sim plot
view: flow
x: y = -3..3
y: v = -3..3
slider: p = 0..5 step 0.1 = 1
slider: q = 0.5..6 step 0.1 = 4
dx: v
dy: -q*y - p*v
start: 2.5, 0 | forward
start: -2.5, 1 | forward
start: 0, 2.8 | forward
start: 1, -2.8 | forward
grid: 16
readout: real part = -p/2 | digits: 3
readout: imaginary part = sqrt(abs(q - p^2/4))*step(q - p^2/4) | digits: 3
```

::: predict
## A circuit's state matrix has eigenvalues $-1 \pm 3j$. What do its trajectories look like?

- [x] Spirals winding into the origin
- [ ] Straight lines into the origin
- [ ] Spirals winding outward
- [ ] Closed loops

::: reveal
Spirals winding in. The imaginary part, 3, makes the state rotate (ringing at 3 rad/s), and the negative real part, $-1$, shrinks it by $e^{-t}$. A positive real part would spiral outward; a zero real part would give closed loops.
:::
:::

::: nameit
## The eigenvalue method

For $\dot{\mathbf{x}} = A\mathbf{x}$, each eigenpair $A\mathbf{v} = \lambda\mathbf{v}$ gives a solution $e^{\lambda t}\mathbf{v}$. With $n$ independent eigenvectors,

$$\mathbf{x}(t) = c_1e^{\lambda_1t}\mathbf{v}_1 + \cdots + c_ne^{\lambda_nt}\mathbf{v}_n$$

and the $c_i$ come from $\mathbf{x}(0)$ (A7, lesson 37).

## State form of a second-order equation

$\ddot y + p\dot y + qy = 0$ with $\mathbf{x} = (y, \dot y)$ becomes

$$\dot{\mathbf{x}} = \begin{bmatrix}0 & 1\\-q & -p\end{bmatrix}\mathbf{x}$$

whose characteristic polynomial is $\lambda^2 + p\lambda + q$: the eigenvalues **are** the characteristic roots. For a series RLC with $\mathbf{x} = (v_C, i_L)$, $A = \begin{bmatrix}0 & 1/C\\-1/L & -R/L\end{bmatrix}$, with trace $-R/L$ and determinant $\frac{1}{LC} = \omega_0^2$.

## Complex eigenvalues

A real matrix's complex eigenvalues come in pairs $\sigma \pm j\omega$ with conjugate eigenvectors. Take one complex solution $e^{(\sigma + j\omega)t}(\mathbf{a} + j\mathbf{b})$. Its real and imaginary parts are two **real** solutions:

$$e^{\sigma t}(\mathbf{a}\cos\omega t - \mathbf{b}\sin\omega t) \qquad e^{\sigma t}(\mathbf{a}\sin\omega t + \mathbf{b}\cos\omega t)$$

## Repeated eigenvalues

If $\lambda$ is repeated but has only one eigenvector $\mathbf{v}$, find $\mathbf{w}$ with $(A - \lambda I)\mathbf{w} = \mathbf{v}$. The second solution is $e^{\lambda t}(t\mathbf{v} + \mathbf{w})$, the system version of $te^{rt}$ from lesson 21.
:::

::: example
## Solve $\ddot y + 2\dot y + 2y = 0$ in state form.

::: solution
1. **Eigenvalues.** $A = \begin{bmatrix}0 & 1\\-2 & -2\end{bmatrix}$ has
   $$\lambda^2 + 2\lambda + 2 = 0$$
   so $\lambda = -1 \pm j$.
2. **Eigenvector.** For $\lambda = -1 + j$, row 1 of $(A - \lambda I)\mathbf{v} = 0$ gives
   $$\mathbf{v} = (1, -1 + j)$$
3. **Real solutions.** So $\mathbf{a} = (1, -1)$ and $\mathbf{b} = (0, 1)$, and the real solutions are
   $$\begin{aligned} &e^{-t}(\cos t, -\cos t - \sin t) \\ &e^{-t}(\sin t, \cos t - \sin t) \end{aligned}$$
4. **The familiar pair.** The first component of each, $e^{-t}\cos t$ and $e^{-t}\sin t$, is the familiar pair.

**Answer:** $\lambda = -1 \pm j$, and the real solutions are $e^{-t}(\cos t, -\cos t - \sin t)$ and $e^{-t}(\sin t, \cos t - \sin t)$.
:::
:::

::: example
## Solve $\dot{\mathbf{x}} = \begin{bmatrix}-2 & 1\\0 & -2\end{bmatrix}\mathbf{x}$ with $\mathbf{x}(0) = (0, 1)$.

::: solution
1. **Eigenvalue and eigenvector.** The only eigenvalue is $-2$, with eigenvector $\mathbf{v} = (1, 0)$.
2. **Generalized eigenvector.** Solve $(A + 2I)\mathbf{w} = \mathbf{v}$:
   $$\mathbf{w} = (0, 1)$$
3. **Second solution.**
   $$e^{-2t}(t\mathbf{v} + \mathbf{w}) = e^{-2t}(t, 1)$$
   It already matches $\mathbf{x}(0)$.
4. **Check.** $\dot x_2 = -2x_2$ and $\dot x_1 = -2x_1 + x_2$.

**Answer:** $\mathbf{x} = e^{-2t}(t, 1)$.
:::
:::

::: example
## Solve $\dot{\mathbf{x}} = \begin{bmatrix}0 & 1\\-4 & 0\end{bmatrix}\mathbf{x}$ with $\mathbf{x}(0) = (1, 0)$.

::: solution
1. **Eigenvalues.** They solve $\lambda^2 + 4 = 0$:
   $$\lambda = \pm 2j$$
   pure imaginary, so the motion neither grows nor decays.
2. **Solve it.** This is $\ddot x = -4x$ in state form, and with $x(0) = 1$, $\dot x(0) = 0$:
   $$\begin{aligned} x_1 &= \cos 2t \\ x_2 &= \dot x_1 \\ &= -2\sin 2t \end{aligned}$$
3. **The phase plane.** In the phase plane the state goes round the ellipse
   $$x_1^2 + \frac{x_2^2}{4} = 1$$
   once every $\pi$ seconds.

**Answer:** $x_1 = \cos 2t$ and $x_2 = -2\sin 2t$, going round the ellipse once every $\pi$ seconds.
:::
:::

::: check
given: L = 10 | 100; C = 1 | 10
answer: 1/(L*1e-3*C*1e-6)
tolerance: 0.5%

## A series RLC has state matrix $\begin{bmatrix}0 & 1/C\\-1/L & -R/L\end{bmatrix}$ with $L$ = {L} mH and $C$ = {C} µF. What is its determinant, in s⁻²?

::: right
Right. $\frac{1}{LC} = \omega_0^2$ = {answer}.
:::

::: misses
- [1/sqrt(L*1e-3*C*1e-6)] That's $\omega_0$; the determinant is its square.
- [any] Not yet. $0 \cdot (-R/L) - (1/C)(-1/L)$.
:::
:::

::: check
given: p = 2 | 4; q = 5 | 13
answer: -p/2

## What is the real part of the eigenvalues of $\begin{bmatrix}0 & 1\\-\given{q} & -\given{p}\end{bmatrix}$?

::: right
Right. $\lambda^2 + p\lambda + q = 0$ has complex roots here, with real part $-p/2$ = {answer}.
:::

::: misses
- [p/2] The trace is $-p$, so the real part is negative.
- [-p] Each eigenvalue gets half the trace.
- [any] Not yet. Half the trace.
:::
:::

::: check
given: p = 2 | 4; q = 5 | 13
answer: sqrt(q - p^2/4)
tolerance: 0.5%

## What is the imaginary part (in size) of the eigenvalues of $\begin{bmatrix}0 & 1\\-\given{q} & -\given{p}\end{bmatrix}$?

::: right
Right. $\sqrt{q - p^2/4}$ = {answer}: the ringing frequency in rad/s.
:::

::: misses
- [sqrt(q)] That's $\omega_0$; damping lowers the ringing frequency.
- [any] Not yet. Solve $\lambda^2 + p\lambda + q = 0$.
:::
:::

::: check
given: t = 0.5 | 1.5 | 2
answer: t*exp(-2*t)
tolerance: 0.5%

## For $\dot{\mathbf{x}} = \begin{bmatrix}-2 & 1\\0 & -2\end{bmatrix}\mathbf{x}$ with $\mathbf{x}(0) = (0, 1)$, what is $x_1(\given{t})$?

::: right
Right. $x_1 = te^{-2t}$ = {answer}.
:::

::: misses
- [exp(-2*t)] That's $x_2$. $x_1$ is driven by $x_2$ and starts at 0.
- [any] Not yet. $\mathbf{x} = e^{-2t}(t, 1)$.
:::
:::

::: check
given: s = 0.5 | 2; w = 3 | 10
answer: 1/s
tolerance: 0.5%

## A circuit's eigenvalues are $-\given{s} \pm j\given{w}$. What is the time constant of its ringing's envelope?

::: right
Right. The envelope is $e^{-\sigma t}$, with time constant $1/\sigma$ = {answer}.
:::

::: misses
- [1/w] The imaginary part sets the ringing, not the decay.
- [any] Not yet. $1/|\text{Re}\,\lambda|$.
:::
:::

::: check
kind: choice

## A system's eigenvalues are $2 \pm j$. What do its trajectories do?

- [ ] Spiral inward
- [x] Spiral outward
- [ ] Move along straight lines
- [ ] Circle at constant radius

::: right
Right. A positive real part grows the state by $e^{2t}$ while the imaginary part rotates it: an unstable oscillator.
:::

::: misses
- [1] Inward needs a negative real part.
- [4] Constant radius needs a zero real part.
- [any] Look at the sign of the real part.
:::
:::

::: check
kind: parts
given: w = 2 | 3; t = 0.3 | 1

## Solve $\dot{\mathbf{x}} = \begin{bmatrix}0 & 1\\-\given{w}^2 & 0\end{bmatrix}\mathbf{x}$ with $\mathbf{x}(0) = (1, 0)$.

::: part
answer: cos(w*t)
tolerance: 0.5%

### What is $x_1$ at $t$ = {t}?

::: misses
- [any] $\ddot x_1 = -\omega^2x_1$ with $x_1(0) = 1$.
:::
:::

::: part
answer: -w*sin(w*t)
tolerance: 0.5%

### What is $x_2$?

::: misses
- [-sin(w*t)] $x_2 = \dot x_1$, which brings a factor $\omega$.
- [any] Differentiate $x_1$.
:::
:::
:::

::: check
kind: derivation
vars: a = 0.5..3, t = 0..3

## Solve $\dot{\mathbf{x}} = \begin{bmatrix}-a & 1\\0 & -a\end{bmatrix}\mathbf{x}$ with $\mathbf{x}(0) = (0, 1)$.

::: step
answer: exp(-a*t)

### What is $x_2$?
:::

::: step
answer: t*exp(-a*t)

### $\dot x_1 = -ax_1 + x_2$. What is $x_1$?
:::

::: right
Right. The repeated eigenvalue with one eigenvector gives the $te^{-at}$ term.
:::
:::

::: explain
## Why do the eigenvalues of the state matrix of $\ddot y + p\dot y + qy = 0$ equal the roots of its characteristic equation?

::: model
Both come from looking for solutions that grow as $e^{\lambda t}$. In the state form, $e^{\lambda t}\mathbf{v}$ solves $\dot{\mathbf{x}} = A\mathbf{x}$ exactly when $\lambda$ is an eigenvalue, a root of $\det(A - \lambda I) = \lambda^2 + p\lambda + q$. In the single equation, $e^{\lambda t}$ solves it exactly when $\lambda^2 + p\lambda + q = 0$. It's the same polynomial, because the state form is the same equation written as two first-order ones: the first component of the eigenvector solution is the scalar solution, and the second is its derivative.
:::
:::

::: practice

::: check
given: R = 10 | 100; L = 10 | 50
answer: -R/(L*1e-3)
unit: s⁻¹
tolerance: 0.5%

## What is the trace of the series RLC state matrix for $R$ = {R} Ω and $L$ = {L} mH, in s⁻¹?

::: misses
- [-R/L] Use henries.
- [any] $-R/L$.
:::
:::

::: check
given: p = 5 | 7; q = 4 | 6
answer: (-p - sqrt(p^2 - 4*q))/2
tolerance: 0.5%

## What is the faster eigenvalue of $\begin{bmatrix}0 & 1\\-\given{q} & -\given{p}\end{bmatrix}$?

::: misses
- [(-p + sqrt(p^2 - 4*q))/2] That's the slower one.
- [any] The root further from zero.
:::
:::

::: check
given: s = 1 | 3; w = 2 | 4; t = 0.2 | 0.5
answer: exp(-s*t)*cos(w*t)
tolerance: 0.5%

## A system with eigenvalues $-\given{s} \pm j\given{w}$ has a real solution $y = e^{-\sigma t}\cos\omega t$. What is $y$ at $t$ = {t}?

::: misses
- [any] Evaluate $e^{-\sigma t}\cos\omega t$.
:::
:::
:::
