See how coupled differential equations emerge from interconnected physical systems
Two tanks are connected by pipes. Liquid flows into Tank 1 from an external source, from Tank 1 to Tank 2 through a connecting pipe, and out of Tank 2 through a drain. The flow rates depend on the liquid levels, creating a coupled system of differential equations.
Let $h_1(t)$ and $h_2(t)$ be the liquid levels (in meters) in Tank 1 and Tank 2 respectively:
where:
The key insight: The term $k_1 h_1$ appears in both equations — it is the outflow of Tank 1 and the inflow of Tank 2. This shared term is what couples the two equations. You cannot solve for $h_2(t)$ without knowing $h_1(t)$ first, because Tank 2's inflow depends on Tank 1's level.
Dividing both equations by their respective areas and writing in matrix form:
This is exactly the form $\mathbf{x}' = \mathbf{A}\mathbf{x} + \mathbf{b}$ studied in Chapter 4. The eigenvalues of $\mathbf{A}$ determine the system's behavior.
Since $\mathbf{A}$ is lower-triangular, the eigenvalues are the diagonal entries:
Both eigenvalues are always negative (since $k_1, k_2, A_1, A_2 > 0$), so the system is always stable — both tank levels eventually reach steady state.
Setting $dh_1/dt = 0$ and $dh_2/dt = 0$:
Notice: the steady-state levels depend only on the inflow rate and the respective valve coefficients — not on the tank areas (areas only affect how fast steady state is reached).
Watch both tanks fill and drain in real time. Adjust parameters, then press Play to see the coupled dynamics unfold — notice how Tank 2 responds to Tank 1's level.
The beauty of this system is that the two tanks are not independent. Let's trace the chain of cause and effect:
If you tried to solve Tank 2's equation $A_2 h_2' = k_1 h_1 - k_2 h_2$ by itself, you'd be stuck: the right side contains $h_1(t)$, which is unknown. You must solve the system simultaneously — this is exactly the problem Chapter 4 addresses using matrix methods, eigenvalues, and eigenvectors.
This two-tank system has one-way (cascade) coupling: Tank 1 affects Tank 2, but Tank 2 does not affect Tank 1. Mathematically, the matrix $\mathbf{A}$ is lower-triangular, meaning Tank 1's equation is independent. In more complex systems (e.g., tanks connected by bidirectional pipes), you get two-way coupling where every equation depends on every variable.
Tank 1's equation is a first-order linear ODE with constant coefficients:
With $h_1(0) = 0$, the solution is:
Substituting $h_1(t)$ into Tank 2's equation:
This has a repeated eigenvalue $\lambda = -0.25$. Using integrating factors or the matrix exponential with $h_2(0) = 0$:
As $t \to \infty$: $h_1^* = Q_{\text{in}}/k_1 = 1/0.5 = 2$ m and $h_2^* = Q_{\text{in}}/k_2 = 1/0.5 = 2$ m.
Key observation: Tank 1 reaches steady state before Tank 2 — try it in the simulator above!
With $Q_{\text{in}} = 0$, the system becomes $\mathbf{x}' = \mathbf{A}\mathbf{x}$ (no forcing term):
Repeated eigenvalue $\lambda = -0.25$. Eigenvector for $\lambda$: $\mathbf{v}_1 = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$. Generalized eigenvector: $\mathbf{v}_2 = \begin{pmatrix} 4 \\ 0 \end{pmatrix}$.
Applying $h_1(0) = 4, h_2(0) = 3$: $c_2 = 1$ and $c_1 = 3$.
Fascinating behavior: Tank 2's level initially rises (because fluid pours in from Tank 1) before eventually draining. The term $t \cdot e^{-0.25t}$ creates a transient "bump." Try this scenario in the simulator!
With $A_1 = A_2 = 2$, $Q_{\text{in}} = 1$, filling from empty:
The eigenvalue ratio $|\lambda_1/\lambda_2| = 4$ tells us Tank 1 responds 4 times faster than Tank 2. This separation of timescales is common in coupled systems.
The smaller drain valve ($k_2 = 0.25$) causes Tank 2 to fill much higher! This demonstrates how valve sizing directly determines the operating levels.
Click each problem to reveal the step-by-step solution.
Step 1: Form the system matrix:
Step 2: Since $\mathbf{A}$ is lower-triangular, the eigenvalues are the diagonal entries:
Step 3: Interpret: Both negative → stable. Tank 1 responds 6× faster than Tank 2 ($|\lambda_1/\lambda_2| = 6$).
Step 1: The system matrix and repeated eigenvalue:
Step 2: Tank 1 is independent: $h_1' = -h_1$, so $h_1(t) = 3e^{-t}$.
Step 3: Tank 2: $h_2' = h_1 - h_2 = 3e^{-t} - h_2$. This is a first-order linear ODE.
Step 4: Using an integrating factor $e^t$:
With $h_2(0)=0$: $C=0$. Therefore:
Step 5: Tank 2 peaks at $t=1$ where $h_2(1) = 3/e \approx 1.10$ m, then decays.
Section 4.1 (Matrices): The system matrix $\mathbf{A}$ encodes all the physics — tank areas, valve coefficients, and connectivity. Reading the matrix tells you the system's structure.
Section 4.2 (Homogeneous Systems): The drain scenario ($Q_{\text{in}}=0$) gives $\mathbf{x}' = \mathbf{A}\mathbf{x}$. Eigenvalues determine decay rates; eigenvectors determine the independent modes. Repeated eigenvalues (equal valve ratios) produce the $te^{\lambda t}$ terms.
This simulator: Lets you see the abstract mathematics come to life. The eigenvalues control how fast the levels change. The coupling term connects one equation to the other. The steady state is found by setting derivatives to zero.