Case Study 1 — Two Coupled Tanks: Mixing, Equilibrium, and the Meaning of a Zero Eigenvalue

Field: chemical / environmental engineering (and, structurally identical, compartmental biology and economics). This study cashes in §37.3–37.8 on a system you can picture entirely without physics: brine flowing between two tanks. It is the canonical "compartment model," and the same matrix governs pollutants spreading between connected lakes, a drug moving between blood and tissue, money flowing between two accounts, and a nutrient cycling between two populations.

The problem: salt sloshing between two tanks

Picture two tanks connected by pipes, each holding a fixed volume of well-stirred brine. Salt water is pumped from tank 1 into tank 2 and back again. Let $x_1(t)$ and $x_2(t)$ be the amounts of salt (in kilograms) in the two tanks. The rate at which salt leaves a tank is proportional to how much is there (because the water is well-mixed, the outflow carries the current concentration), and what leaves one tank arrives in the other. Suppose tank 1 loses salt at rate $3x_1$ and gains $1\cdot x_2$ from tank 2, while tank 2 loses $1\cdot x_2$ and gains $3x_1$. Then the amounts change according to $$ x_1' = -3x_1 + x_2, \qquad x_2' = 3x_1 - x_2, $$ which is exactly the linear system $\mathbf{x}' = A\mathbf{x}$ with $$ A = \begin{bmatrix} -3 & 1 \\ 3 & -1 \end{bmatrix}. $$ The question every engineer asks of such a setup: where does it end up? Pour all the salt into tank 1 and walk away — how does it redistribute, and to what final state? This is a stability-and-equilibrium question, and §37.7 told us the answer lives in the eigenvalues of $A$.

Notice the special structure of the columns: each column of $A$ sums to zero ($-3+3=0$ and $1-1=0$). That is not an accident of our numbers — it is the mathematical signature of a conservation law. Whatever salt leaves one tank arrives in the other; none is created or destroyed. The total salt $x_1+x_2$ is constant in time. We will see this conservation appear, unmistakably, as an eigenvalue of exactly zero.

Finding the eigenvalues — and a zero among them

The characteristic polynomial (Chapter 24) is $$ \det(A-\lambda I) = (-3-\lambda)(-1-\lambda) - (1)(3) = \lambda^2 + 4\lambda + 3 - 3 = \lambda^2 + 4\lambda = \lambda(\lambda + 4). $$ So the eigenvalues are $\lambda_1 = 0$ and $\lambda_2 = -4$. One negative eigenvalue and one zero eigenvalue — a combination that does not fit the clean "stable node" picture, and the deviation is the whole point of this study.

The zero eigenvalue is the conservation law made visible. Recall the mode formula: the solution is $\mathbf{x}(t) = c_1 e^{0\cdot t}\mathbf{v}_1 + c_2 e^{-4t}\mathbf{v}_2 = c_1\mathbf{v}_1 + c_2 e^{-4t}\mathbf{v}_2$. The $\lambda=0$ mode does not decay and does not grow — $e^{0\cdot t}=1$ for all time — so it represents a frozen, conserved component of the state. The $\lambda=-4$ mode decays rapidly. As $t\to\infty$, the decaying mode vanishes and only the conserved mode survives: the system settles to the constant state $c_1\mathbf{v}_1$.

Let us find the eigenvectors. For $\lambda_2 = -4$: solve $(A+4I)\mathbf{v}=\mathbf{0}$, i.e. $\begin{bmatrix} 1 & 1 \\ 3 & 3\end{bmatrix}\mathbf{v}=\mathbf{0}$, giving $\mathbf{v}_2 = (1, -1)$ — a direction in which the two tanks are out of balance (salt in one, anti-salt in the other), which is exactly the imbalance that decays. For $\lambda_1=0$: solve $A\mathbf{v}=\mathbf{0}$, i.e. $\begin{bmatrix} -3 & 1 \\ 3 & -1\end{bmatrix}\mathbf{v}=\mathbf{0}$, giving $-3v_1+v_2=0$, so $v_2=3v_1$ and $\mathbf{v}_1 = (1, 3)$. This is the equilibrium distribution: at steady state, tank 2 holds three times the salt of tank 1, because tank 1 pumps out three times as fast as tank 2 does, so the balance point is shifted toward the slower-draining tank.

The eigenvector of the zero eigenvalue is the equilibrium shape; the eigenvector of the negative eigenvalue is the imbalance that relaxes away. Stability theory hands you both the destination and the road to it.

It is worth dwelling on why the two tanks settle in a 1-to-3 ratio rather than splitting the salt evenly. Intuition might suggest that mixing should homogenize — equal salt in each tank. But the flow is asymmetric: tank 1 empties at rate $3$ while tank 2 empties at rate $1$. At equilibrium the two flows must balance, $3x_1 = x_2$ (what leaves tank 1 equals what leaves tank 2, since nothing accumulates), which forces $x_2 = 3x_1$. The faster-draining tank holds less salt at steady state, because it cannot retain what it so eagerly pumps away. This is the equilibrium eigenvector $(1,3)$ speaking, and it is a small but genuine lesson: the steady state of a flow system is set by the ratios of the rates, not by any naive notion of "fairness" or "evenness." Reading the $\lambda=0$ eigenvector is reading those ratios directly.

Solving the system from a specific start

Pour all $10$ kg of salt into tank 1: $\mathbf{x}(0) = (10, 0)$. Expand this in the eigenbasis, $\mathbf{x}(0) = c_1(1,3) + c_2(1,-1)$. Matching components: $c_1 + c_2 = 10$ and $3c_1 - c_2 = 0$. Adding the equations gives $4c_1 = 10$, so $c_1 = 2.5$ and $c_2 = 7.5$. The complete solution is $$ \mathbf{x}(t) = 2.5\begin{bmatrix} 1 \\ 3 \end{bmatrix} + 7.5\,e^{-4t}\begin{bmatrix} 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 2.5 + 7.5\,e^{-4t} \\ 7.5 - 7.5\,e^{-4t} \end{bmatrix}. $$ Read it as a story. At $t=0$ the formula gives $(2.5+7.5,\, 7.5-7.5) = (10, 0)$ — all the salt in tank 1, as it should. As $t$ grows, the $e^{-4t}$ term collapses, and the state slides toward the equilibrium $(2.5, 7.5)$: a quarter of the salt ends in tank 1, three-quarters in tank 2. The total is always $x_1+x_2 = 10$ — the conserved quantity, frozen by the zero eigenvalue, never changes. The decay rate $4$ means the imbalance shrinks by a factor of $e^{-4}\approx 0.018$ every unit of time, so the system is within $2\%$ of equilibrium after about one time unit.

Let us verify the whole picture numerically — the closed form, the matrix exponential, and the equilibrium — against scipy.

# Coupled tanks: x' = Ax. Eigenvalues 0 (conserved total) and -4 (decaying imbalance).
import numpy as np
from scipy.linalg import expm
A  = np.array([[-3., 1.], [3., -1.]])
x0 = np.array([10., 0.])
print(np.round(np.linalg.eigvals(A), 6))        # [-4.  0.]  -> a zero eigenvalue: conservation

# closed form: 2.5(1,3) + 7.5 e^{-4t}(1,-1)
def x_closed(t):
    return 2.5*np.array([1., 3.]) + 7.5*np.exp(-4*t)*np.array([1., -1.])

for t in [0.0, 0.25, 1.0, 3.0]:
    print(t, np.round(x_closed(t), 6), np.round(expm(A*t) @ x0, 6))
# 0.0  [10. 0.]        [10. 0.]
# 0.25 [5.259096 4.740904] [5.259096 4.740904]
# 1.0  [2.637367 7.362633] [2.637367 7.362633]
# 3.0  [2.500046 7.499954] [2.500046 7.499954]

print(np.round(expm(A*50) @ x0, 6))             # [2.5 7.5]  -> equilibrium
print(np.round((x0 @ np.array([1., 1.])), 6))   # 10.0 total salt, conserved for all t

Every row matches: the closed form and the matrix exponential agree to six decimals at each time, the state marches from $(10,0)$ to the equilibrium $(2.5, 7.5)$, and the total salt stays pinned at $10$. The zero eigenvalue is not a defect or a degeneracy to be feared — it is the algebra correctly reporting that something is conserved, and its eigenvector tells you the proportions of the final mix.

Why this matters far beyond tanks

The phrase "compartment model" hides how universal this structure is. Any situation where a conserved quantity flows between a few interconnected reservoirs, at rates proportional to the amounts present, is governed by exactly this kind of matrix — columns summing to zero, a zero eigenvalue carrying the conservation law, and negative eigenvalues setting the relaxation rates. Swap "salt in tanks" for any of the following and the mathematics is unchanged:

  • Environmental science: a pollutant exchanging between two connected lakes, or carbon cycling between the atmosphere and the ocean surface. The equilibrium eigenvector tells you the steady-state split; the decay eigenvalue tells you how long until the system re-equilibrates after a spill.
  • Pharmacokinetics (medicine): a drug moving between the bloodstream and a tissue compartment (the application we met in §37.4). Here elimination by the kidneys breaks conservation — it adds a negative term that makes all eigenvalues negative, so the drug clears entirely rather than reaching a nonzero equilibrium. The shift from a zero eigenvalue (conserved) to an all-negative spectrum (cleared) is the difference between a closed system and a leaky one.
  • Economics: capital flowing between two sectors or two accounts at proportional rates. A zero eigenvalue means total wealth is conserved and merely redistributes; a positive eigenvalue would mean the total grows (an unstable, inflating system).
  • Ecology: a nutrient (say nitrogen) cycling between a plant population and the soil. The conserved total is the nitrogen in the ecosystem; the eigenvector is the steady-state allocation between living and dead matter.

In each case the diagnostic workflow is identical and is exactly this chapter's: write the flow rates as a matrix $A$, find the eigenvalues, and read off the fate. A zero eigenvalue means a conserved quantity and a nonzero equilibrium; all-negative eigenvalues mean everything drains to zero; a positive eigenvalue means runaway growth. The engineer, the doctor, the economist, and the ecologist are all reading the same spectrum. That is recurring theme #4 of the book — linear algebra is the most applied branch of pure mathematics — in its purest compartmental form: learn to read the eigenvalues of a flow matrix once, and you can predict the long-run behavior of mixing tanks, polluted lakes, dosed patients, and circulating capital, all with the same picture.