mathematics//graph theory//three-tank network
The three-tank network is a worked example that connects balance, Laplacian, capacity, modes and a random walk in one computable case. Three open tanks share the same reference level. Pipes exist only between 1 and 2, and between 2 and 3, each with conductance \(1\,\mathrm m^2/\mathrm s\). The flow is linear, with no pumps, leaks, hydraulic inertia or atmospheric pressure differences.
The three-tank network is a worked example that connects balance, Laplacian, capacity, modes and a random walk in one computable case. Three open tanks share the same reference level. Pipes exist only between 1 and 2, and between 2 and 3, each with conductance 1 m2/s1,\mathrm m^2/\mathrm s1m2/s. The flow is linear, with no pumps, leaks, hydraulic inertia or atmospheric pressure differences.
The mechanism becomes a matrix directly. With levels hih_ihi in meters, the flows are q12=h1−h2q_{12}=h_1-h_2q12=h1−h2 and q23=h2−h3q_{23}=h_2-h_3q23=h2−h3, numerically in cubic meters per second, and the numerical matrices are these:
W=[010101010],D=diag(1,2,1),L=[1−10−12−10−11].\ca{W}=\begin{bmatrix}0&1&0\\1&0&1\\0&1&0\end{bmatrix},\quad \cb{D}=\operatorname{diag}(1,2,1),\quad \cc{L}=\begin{bmatrix}1&-1&0\\-1&2&-1\\0&-1&1\end{bmatrix}.W=010101010,D=diag(1,2,1),L=1−10−12−10−11.
The weights in green, the degrees in blue, the Laplacian in copper, the storage in violet. The graph Laplacian converts levels into net outflows; the capacities convert those flows into level velocities.
Tanks of equal section give three plain modes. For areas ai=1 m2a_i=1,\mathrm m^2ai=1m2 the numerical equation is h˙=−Lh\dot h=-\cc{L}hh˙=−Lh in seconds. From h(0)=(3,0,0)T mh(0)=(3,0,0)^{\mathsf T},\mathrm mh(0)=(3,0,0)Tm a total volume of 3 m33,\mathrm m^33m3 is conserved and the final level is 1 m1,\mathrm m1m everywhere. The eigen-patterns, unnormalized, are v1=(1,1,1)Tv_1=(1,1,1)^{\mathsf T}v1=(1,1,1)T, v2=(1,0,−1)Tv_2=(1,0,-1)^{\mathsf T}v2=(1,0,−1)T, v3=(1,−2,1)Tv_3=(1,-2,1)^{\mathsf T}v3=(1,−2,1)T, with rates 000, 111 and 3 s−13,\mathrm s^{-1}3s−1. The solution, with ttt in seconds and heights in meters, is this:
h(t)=v1+32e−tv2+12e−3tv3.h(t)=v_1+\tfrac32e^{-t}v_2+\tfrac12e^{-3t}v_3.h(t)=v1+23e−tv2+21e−3tv3.
The first mode keeps the common level. The second corrects the difference between the ends. The third corrects a pattern where the middle tank differs from both ends, and it vanishes three times faster than the second.
Doubling the central capacity with the same pipes changes the dynamics. Now M=diag(1,2,1) m2\cd{M}=\operatorname{diag}(1,2,1),\mathrm m^2M=diag(1,2,1)m2: neither the topology nor the pipe conductances change, but the dynamics does, h˙=−M−1Lh\dot h=-\cd{M}^{-1}\cc{L}hh˙=−M−1Lh. The initial volume is still 3 m33,\mathrm m^33m3 and the total area is now 4 m24,\mathrm m^24m2, so the final common level is 0.75 m0.75,\mathrm m0.75m. The numerical rates are 000, 111 and 2 s−12,\mathrm s^{-1}2s−1, and one solution is this:
h(t)=34(1,1,1)T+32e−t(1,0,−1)T+34e−2t(1,−1,1)T.h(t)=\tfrac34(1,1,1)^{\mathsf T}+\tfrac32e^{-t}(1,0,-1)^{\mathsf T}+\tfrac34e^{-2t}(1,-1,1)^{\mathsf T}.h(t)=43(1,1,1)T+23e−t(1,0,−1)T+43e−2t(1,−1,1)T.
The fast mode also changes shape. The spectrum of L\cc{L}L alone no longer gives the rates: M\cd{M}M has to be included (nodal capacity).
areas1.0, 1.0, 1.0 m² total volume3.00 m³ final level1.00 m rates0.00, 1.00, 3.00 1/s Three tanks joined by two pipes level out by M ḣ = −L h. t = 0 s: (3.00, 0.00, 0.00) m; t = 0.5 s: (2.02, 0.78, 0.20) m; t = 1 s: (1.58, 0.95, 0.47) m; t = 3 s: (1.07, 1.00, 0.93) m. The volume is conserved, so every level ends at the area-weighted mean of the initial levels.
Play the equal tanks, then switch to Middle doubled: the levels now meet at 0.75 m instead of 1 m, and the fast rate falls from 3 to 2.
A random walk can run on the same connectivity. Reading the weights as jump preferences (Markov chain) gives this transition matrix:
P=D−1W=[0101/201/2010].P=\cb{D}^{-1}\ca{W}=\begin{bmatrix}0&1&0\\1/2&0&1/2\\0&1&0\end{bmatrix}.P=D−1W=01/2010101/20.
Its stationary distribution is π=(1/4,1/2,1/4)T\pi=(1/4,1/2,1/4)^{\mathsf T}π=(1/4,1/2,1/4)T: not a vector of levels but a distribution of occupation. From p0=(1,0,0)Tp_0=(1,0,0)^{\mathsf T}p0=(1,0,0)T the first step concentrates the probability in the center and the second spreads it to the ends, and the alternation continues. A stationary distribution exists, but this walk is periodic and does not converge from that start. The lazy walk Plazy=(I+P)/2P_{\mathrm{lazy}}=(I+P)/2Plazy=(I+P)/2 keeps π\piπ and removes the periodicity; its eigenvalues are 111, 1/21/21/2 and 000 (spectral gap).
The two readings share the connectivity and nothing more. The level dynamics uses a physical balance and capacities; the walk uses per-step probabilities. With double central capacity the final volumes are in proportion 1:2:11:2:11:2:1, coinciding with π\piπ here because capacity and degree happen to be proportional in their respective units. It is not a universal identity between volume and probability.
The rates come from the balance equation; the matrices from adjacency and degree; the solution from modes. Values, decompositions and comparisons were built and checked algebraically and numerically for this note.