1 / 17
Chapter 4 · Systems of DEs

Applications: Two-Tank Systems & Engineering

Where Systems of DEs Meet the Real World
Dr. Mohamed Mabrok · Qatar University

Why Applications Matter

🧪

Chemical Engineering

Mixing tanks, concentration dynamics, and chemical reactions governed by conservation laws.
$$\frac{dh_i}{dt} = \text{inflow} - \text{outflow}$$
⚙️

Mechanical Engineering

Coupled springs, vibrations, and oscillatory systems with energy transfer.
$$m_ix_i'' + \text{forces} = 0$$

Electrical Engineering

Multi-loop circuits, coupled inductors, and resonance phenomena.
$$\sum V = 0 \text{ (Kirchhoff)}$$
The Common Thread
All governed by: $\mathbf{x}' = A\mathbf{x} + \mathbf{b}(t)$ — systems of first-order linear DEs!

The Two-Tank System

Physical Setup
Tank 1: Gets external inflow $Q_{\text{in}}$, drains to Tank 2 at rate proportional to height ($k_1 h_1$)
Tank 2: Receives flow from Tank 1, drains out at rate proportional to its height ($k_2 h_2$)
The Coupling: The outflow from Tank 1 is the inflow to Tank 2 — $k_1 h_1$ appears in BOTH equations!
Key Insight
This is not two independent ODEs. The system is coupled — what happens in Tank 1 directly affects Tank 2.

Governing Equations (Derivation)

Conservation of Mass
$$A_1 \frac{dh_1}{dt} = Q_{\text{in}} - k_1 h_1$$
$$A_2 \frac{dh_2}{dt} = k_1 h_1 - k_2 h_2$$
where $A_i$ = tank area, $k_i$ = valve coefficients, $h_i$ = height, $Q_{\text{in}}$ = external inflow rate
Matrix Form
$$\frac{d}{dt}\begin{pmatrix} h_1 \\ h_2 \end{pmatrix} = \begin{pmatrix} -k_1/A_1 & 0 \\ k_1/A_2 & -k_2/A_2 \end{pmatrix} \begin{pmatrix} h_1 \\ h_2 \end{pmatrix} + \begin{pmatrix} Q_{\text{in}}/A_1 \\ 0 \end{pmatrix}$$
Lower-triangular matrix: Tank 1 is independent, Tank 2 depends on Tank 1.

Eigenvalue Analysis: Stability & Steady State

Eigenvalues (Lower Triangular)
$$\lambda_1 = -\frac{k_1}{A_1}, \quad \lambda_2 = -\frac{k_2}{A_2}$$
Both ALWAYS NEGATIVE because $k_i, A_i > 0$. The system is always STABLE!
Steady State
$$h_1^* = \frac{Q_{\text{in}}}{k_1}, \quad h_2^* = \frac{Q_{\text{in}}}{k_2}$$
Steady state depends on valve coefficients, NOT tank areas. Areas only affect how fast we reach it.
Worked Example

Example 1: Fill from Empty

Parameters
$A_1 = A_2 = 2$ m², $k_1 = k_2 = 0.5$ m²/s, $Q_{\text{in}} = 1$ m³/s, $h_1(0) = h_2(0) = 0$
STEP 1 Find eigenvalues
$$\lambda_1 = \lambda_2 = -0.25 \text{ (repeated!)}$$
STEP 2 Tank 1 is independent
$$h_1(t) = 2(1 - e^{-0.25t})$$
STEP 3 Tank 2 with input from Tank 1
$$h_2(t) = 2 - 2e^{-0.25t} - 0.5te^{-0.25t}$$
Physical Insight
Tank 1 reaches steady state ($h_1^* = 2$ m) first. Tank 2 lags behind, approaching the same steady state as Tank 1 fills it faster than it drains.
Worked Example

Example 2: Drainage

Parameters
$Q_{\text{in}} = 0$ (no external input), $h_1(0) = 4$ m, $h_2(0) = 3$ m, same tank parameters as before.
STEP 1 Tank 1 simple decay
$$h_1(t) = 4e^{-0.25t}$$
STEP 2 Tank 2 — surprising result!
$$h_2(t) = (3 + t)e^{-0.25t}$$
The Fascinating Behavior
Tank 2 initially rises before draining! The term $te^{-0.25t}$ creates a "bump." Initially, inflow from Tank 1 exceeds Tank 2's outflow, so it fills momentarily. Then, as Tank 1 empties faster, Tank 2 starts draining.
Worked Example

Example 3: Separation of Timescales

Parameters
$k_1 = 1$, $k_2 = 0.25$, $A_1 = A_2 = 2$, $Q_{\text{in}} = 1$. Distinct valve coefficients!
STEP 1 Find eigenvalues
$$\lambda_1 = -0.5, \quad \lambda_2 = -0.125$$
STEP 2 Timescale ratio
$$\frac{\lambda_1}{\lambda_2} = 4 \text{ — Tank 1 responds 4 times faster!}$$
STEP 3 Steady states
$$h_1^* = 1 \text{ m}, \quad h_2^* = 4 \text{ m}$$
Insight
Small drain valve in Tank 2 allows it to fill much higher. Tank 1 reaches equilibrium quickly, then Tank 2 slowly fills to its steady state.

Coupled Spring-Mass System

Physical Setup
Two masses connected by three springs: left wall — $k_1$ — mass 1 — $k_2$ — mass 2 — $k_3$ — right wall
Force Balance
$$m_1 x_1'' = -k_1 x_1 + k_2(x_2 - x_1) = -(k_1+k_2)x_1 + k_2 x_2$$
$$m_2 x_2'' = -k_2(x_2 - x_1) - k_3 x_2 = k_2 x_1 - (k_2+k_3)x_2$$
The middle spring $k_2$ couples the two equations — it creates the coupling term!
Convert to First-Order System
Let $x_1, v_1 = x_1', x_2, v_2 = x_2'$ (4 variables). The system becomes $\mathbf{x}' = A\mathbf{x}$ with $A \in \mathbb{R}^{4 \times 4}$. Eigenvalues from $A$ determine if motion is oscillatory or decays.

Normal Modes of Vibration

Simplified Case
$m_1 = m_2 = 1$, $k_1 = k_3 = 2$, $k_2 = 1$. Analyze the 2×2 displacement system.
STEP 1 System matrix
$$A = \begin{pmatrix} -3 & 1 \\ 1 & -3 \end{pmatrix}$$
STEP 2 Find eigenvalues
$$\lambda_1 = -2, \quad \lambda_2 = -4$$
STEP 3 Eigenvectors (normal modes)
$$\mathbf{v}_1 = \begin{pmatrix} 1 \\ 1 \end{pmatrix} \text{ (in-phase)}, \quad \mathbf{v}_2 = \begin{pmatrix} 1 \\ -1 \end{pmatrix} \text{ (out-of-phase)}$$
Physical Interpretation
In-phase mode: Both masses move together (lower frequency). Out-of-phase mode: Masses move opposite (higher frequency). These are the two independent ways the system can vibrate!

RLC Circuit Systems

Multi-Loop Circuits
Apply Kirchhoff's voltage law ($\sum V = 0$) to each loop. Shared components (resistors, inductors) couple the equations.
For Two-Loop Circuits
Let $i_1, i_2$ be the loop currents. Kirchhoff gives:
$$L_1 i_1' + R_1 i_1 + M i_2' = V_1(t)$$
$$L_2 i_2' + R_2 i_2 + M i_1' = V_2(t)$$
The mutual inductance $M$ couples the loops. The system matrix encodes the circuit topology.
Eigenvalues Determine Behavior
Real eigenvalues → exponential decay (overdamped). Complex eigenvalues → oscillation (underdamped). The real part determines if energy grows or decays.

Population Dynamics: Predator-Prey

Lotka-Volterra Equations
$$\frac{dx}{dt} = \alpha x - \beta xy$$
$$\frac{dy}{dt} = \delta xy - \gamma y$$
$x$ = prey population, $y$ = predator population. Products $xy$ couple the equations.
Near Equilibrium (Linearization)
At equilibrium $x^* = \gamma/\delta, y^* = \alpha/\beta$, linearize to get:
$$\frac{d}{dt}\begin{pmatrix} x - x^* \\ y - y^* \end{pmatrix} = \begin{pmatrix} 0 & -\beta x^* \\ \delta y^* & 0 \end{pmatrix} \begin{pmatrix} x - x^* \\ y - y^* \end{pmatrix}$$
Eigenvalues
Purely imaginary eigenvalues! This means populations cycle — they don't approach equilibrium. This is the famous predator-prey oscillation.

Modeling Strategy: From Physics to Matrix Form

Five-Step Process
Step 1: Identify state variables. What changes over time? (heights, positions, currents, populations...)
Step 2: Write conservation/balance laws. Apply physical principles (mass balance, force, voltage, etc.) to each variable.
Step 3: Identify couplings. Which variables affect each other? These create off-diagonal entries.
Step 4: Write $\mathbf{x}' = A\mathbf{x} + \mathbf{b}$. Convert to matrix form with constant coefficient matrix $A$.
Step 5: Compute eigenvalues & eigenvectors. Predict long-term behavior: stable? oscillatory? growing?
Complete Worked Example

Two-Tank System with ICs

Problem
$A_1 = 1$, $A_2 = 3$, $k_1 = 2$, $k_2 = 1$, $Q_{\text{in}} = 0$ (no external input), $h_1(0) = 6$ m, $h_2(0) = 2$ m. Solve the system.
STEP 1 Write the system
$$A = \begin{pmatrix} -2 & 0 \\ 2/3 & -1/3 \end{pmatrix}$$
STEP 2 Find eigenvalues
$$\lambda_1 = -2, \quad \lambda_2 = -1/3$$
STEP 3-4 Find eigenvectors & build general solution
$$\mathbf{x}(t) = C_1 e^{-2t} \begin{pmatrix} 1 \\ 1 \end{pmatrix} + C_2 e^{-t/3} \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$
STEP 5 Apply initial conditions
$$h_1(t) = 6e^{-2t}, \quad h_2(t) = 6e^{-2t} + (2 - 6)e^{-t/3} = 6e^{-2t} - 4e^{-t/3}$$

Connecting Math to Physics

Mathematical Features
Negative eigenvalues: System returns to equilibrium (stable)
Eigenvalue magnitudes: Rate of decay. Larger magnitude = faster decay
Eigenvectors: Independent modes of behavior. Show how state variables move together
Complex eigenvalues: System oscillates while decaying or growing
Engineering Implications
Valve sizing: Choose $k_i$ to control response speed
Avoid resonance: In mechanical systems, keep driving frequency away from natural frequencies
Stability design: Ensure all eigenvalues have negative real parts (BIBO stable)
Time constants: $\tau = -1/\lambda$ tells you settling time

Common Modeling Mistakes

Watch Out For...

Key Takeaways

Two-Tank Systems

One-way coupling (lower-triangular). Always stable (negative eigenvalues). Steady state depends on valve sizes, not tank areas.

Spring-Mass & Circuits

Coupling through shared components. Normal modes from eigenvectors. Frequency from eigenvalues. Can oscillate or decay.

Universal Method

Model → Matrix $A$ → Eigenvalues/vectors → Predict behavior. Works for any coupled system!
The Big Picture
Systems of DEs are everywhere in engineering: tanks, springs, circuits, populations, chemical reactions, and more. The eigenvalue method is your universal tool for understanding how ANY coupled system behaves. Learn this, and you can analyze almost any real-world phenomenon!
Next Up
Exam Review — bringing everything together across all of Chapter 4. You now know how to model, solve, and interpret systems of DEs in context!
🔊 Voice