Systems of Differential Equations#
A single scalar equation has the familiar solution . The constant is a growth rate: negative means decay to , positive means explosive growth. Many models couple several unknowns at once — concentrations of chemicals, positions of masses on springs, currents in a circuit, or components of a robot state. Those systems are still first-order and linear, but the right-hand side is a matrix times a vector:
Here is the state at time , and is a fixed matrix of constant coefficients. Component-wise this is equations
so each rate depends on every component when is dense. The equations are coupled: you cannot solve for without knowing , and vice versa.
Why eigenvalues enter. Week 10 diagonalized as whenever has independent eigenvectors. Change variables to the eigen-coordinates (so ). Differentiating and substituting:
Because is diagonal, the system for decouples into independent scalar ODEs:
Each eigen-direction evolves on its own, at rate . Transforming back with reassembles the solution in the original coordinates — the whole strategy of this week: diagonalize, solve scalar problems, change back.
Initial condition. The system is first-order, so one vector pins down the solution completely. In eigen-coordinates that means , the vector of coefficients .
The Solution Formula#
Suppose is diagonalizable with eigenvalues and corresponding independent eigenvectors (columns of ). The general solution of is
Each term is one eigen-direction evolving at its own rate ; the constants are fixed by the initial condition:
In matrix form that is , so — solve one linear system once, then the solution is known for every .
Matrix exponential view. The same formula can be written compactly as . When ,
Expanding recovers the sum of above. You do not need the matrix-exponential series for this course — the eigen-sum is the practical formula — but it explains why diagonalization is the natural tool for continuous-time dynamics just as it was for discrete powers in Week 10.
Complex eigenvalues. If a real matrix has a complex conjugate pair , the corresponding complex exponential combines into real solutions that oscillate at frequency while growing or decaying with envelope . The real part still governs stability; the imaginary part sets the oscillation rate.
Stability#
Long-run behavior of every solution is read from the eigenvalues of . Write each eigenvalue as with real part . Then , so:
| Eigenvalues of | Long-run behavior of | Classification |
|---|---|---|
| Every | All terms decay to | Stable (asymptotically stable origin) |
| Some | At least one term grows without bound | Unstable |
| Some , none positive | Oscillation or constants (no decay, no growth from those modes) | Marginally stable / neutrally stable (with care) |
The course rule is a sign check: stable if every eigenvalue has negative real part — every solution decays to ; unstable if any eigenvalue has positive real part, because that single growing mode dominates for large even when the others decay. On the borderline, purely imaginary eigenvalues (, ) produce sustained oscillation — neither decay nor growth — and a pure zero eigenvalue leaves the component along its eigenvector constant.
Preview of Week 12. When is symmetric (real), every eigenvalue is real, so there is no oscillatory pair. Stability then reduces to “are all eigenvalues negative?” Symmetric matrices with nonpositive eigenvalues are a clean special case of the table above; Week 12 develops the spectral theory that makes those eigenvalues especially well-behaved.
Example: A Two-Component System#
Work a full example end to end. Let
Step 1 — eigenvalues. Trace and , so
Eigenvalues: , . Both are real and negative, so the origin is stable — every solution will decay to .
Step 2 — eigenvectors. For :
For :
So
Step 3 — coefficients from .
Step 4 — solution formula.
Check : both components match. As , both exponentials vanish, so , confirming stability from the signs of .
Contrast — an unstable matrix. Replace by :
has eigenvalues and . The same algebra with and produces solutions that grow without bound — unstable. The eigenvectors stay the same; only the signs of the rates flip.
Contrast — pure oscillation. The rotation generator
has eigenvalues . Since , the exponential series collapses to a rotation,
so circles the origin at constant radius — sustained oscillation, neither decay nor growth. Purely imaginary eigenvalues sit on the stability boundary. Linear state-space models of this exact form, , are the backbone of Robot Learning Week 2: Dynamics and State Estimation.
Knowledge check#
A system du/dt = Au has eigenvalues -1 and -3. What is its long-run behavior?
The general solution of du/dt = Au is u(t) = a sum of terms c_i e^{λ_i t} times the corresponding ___ of A.
Browser lab: stable vs unstable systems#
Simulate a stable and an unstable system side by side.
import numpy as np
import matplotlib.pyplot as plt
A_stable = np.array([[-1., 0.], [0., -3.]])
A_unstable = np.array([[1., 0.], [0., 2.]])
def simulate(A, u0, t):
eigvals, eigvecs = np.linalg.eig(A)
c = np.linalg.solve(eigvecs, u0)
U = np.zeros((len(t), 2))
for i, ti in enumerate(t):
U[i] = (eigvecs @ (c * np.exp(eigvals * ti))).real
return U
t = np.linspace(0, 3, 100)
u0 = np.array([1.0, 1.0])
U_stable = simulate(A_stable, u0, t)
U_unstable = simulate(A_unstable, u0, t)
fig, axes = plt.subplots(1, 2, figsize=(10, 4))
axes[0].plot(t, U_stable)
axes[0].set_title("Stable: eigenvalues -1, -3")
axes[1].plot(t, U_unstable)
axes[1].set_title("Unstable: eigenvalues 1, 2")
plt.tight_layout()
plt.show()
print("Notice: the left panel decays toward zero while the right explodes — negative vs positive eigenvalues.")
The left panel decays to zero (negative eigenvalues). The right panel explodes (positive eigenvalues). The lab uses the eigen-sum formula from this lesson: solve , then plot at each .
Done when#
You can set up , solve it as with , and classify stability from the sign of the eigenvalues' real parts. Check it against the browser lab: the left panel decays to zero (eigenvalues ) and the right panel grows without bound (eigenvalues ), and you can state which sign drives each behavior.
Going Deeper#
Further Reading#
- Strang, G. Introduction to Linear Algebra, 6th ed., Chapter 5 — differential equations and the matrix exponential.
- Trefethen, L.N. and Bau, D. Numerical Linear Algebra, SIAM, Chapters 14–15 — matrix exponentials and stability of linear systems.