Linear method for pipe network analysis
1 Learning objectives
- Understand the limitations of the Hardy Cross method
- Motivation for a system-based method
- Learn the linear (node-head) method
- Linearization of nonlinear head loss
- Solve a small pipe network using a matrix approach
2 Motivation
- Hardy Cross method
- Loop-by-loop correction
- Physically intuitive
- Difficult for large systems
- Question
- Can we update the entire network at once from a current guess?
- Idea
- Convert nonlinear equations into linear form
- Solve using linear algebra
3 Governing equations
- Continuity at node \[ \sum Q = 0 \]
- Head loss in pipe \[ h_L = K Q^n \]
- Typical values
- $n = 2$ (Darcy–Weisbach)
- $n \approx 1.852$ (Hazen–Williams)
4 Linearization idea
- Nonlinear relation \[ h_L = K Q^n \]
- Near a current estimate
- Approximate as linear
- Result \[ Q_{ij} \approx C_{ij} (H_i - H_j) + D_{ij} \]
- Interpretation
- Each pipe behaves like a linear resistor
- Coefficient depends on current estimate
5 Linearization using Taylor expansion
5.1 True relation (for $n = 2$)
\[ \DeclareMathOperator{\sgn}{sgn} Q(H_i - H_j) = \sgn(H_i - H_j) \sqrt{\frac{|H_i - H_j|}{K}} \]
Let $\Delta H = H_i - H_j$
\[ Q(\Delta H) = \sgn(\Delta H) \sqrt{\frac{|\Delta H|}{K}} = \frac{\Delta H}{\sqrt{K |\Delta H|}},\quad \Delta H \neq 0 \]
5.2 Taylor expansion about the initial estimate
Let the initial estimate \[ \Delta H_0 = \Delta H_{ij}^{(0)} = H_i^{(0)} - H_j^{(0)} \]
\[ Q(\Delta H) \approx Q(\Delta H_0) + \left.\frac{dQ}{d(\Delta H)}\right|_{\Delta H_0} (\Delta H - \Delta H_0) \]
Compute derivative \[ \frac{dQ}{d(\Delta H)} = \frac{1}{2\sqrt{K |\Delta H|}},\quad \Delta H \neq 0 \]
Evaluate at the current estimate $\Delta H_0$ \[ Q(\Delta H) \approx \frac{\Delta H_0}{\sqrt{K |\Delta H_0|}} + \frac{1}{2\sqrt{K |\Delta H_0|}} (\Delta H - \Delta H_0) \]
5.3 Rearranged form
\[ Q(\Delta H) \approx \frac{1}{2\sqrt{K |\Delta H_0|}} \Delta H + \left(\frac{\Delta H_0}{\sqrt{K |\Delta H_0|}} - \frac{\Delta H_0}{2\sqrt{K |\Delta H_0|}}\right) \]
Simplify the constant term \[ Q(\Delta H) \approx \frac{1}{2\sqrt{K |\Delta H_0|}} \Delta H + \frac{\Delta H_0}{2\sqrt{K |\Delta H_0|}} \]
5.4 Linear approximation used in the method
Define slope \[ C_{ij} = \frac{1}{2\sqrt{K |\Delta H_0|}} \]
Then \[ Q_{ij} \approx C_{ij} (H_i - H_j) + D_{ij} \]
Where \[ D_{ij} = \frac{\Delta H_0}{2\sqrt{K |\Delta H_0|}} \]
Substituting into continuity \[ \sum C_{ij}(H_i - H_j) = -\sum D_{ij} \]
Interpretation
- $\Delta H_0$ is defined per pipe (i–j)
- Left-hand side → matrix (A)
- Right-hand side → includes constants $D_{ij}$ and external demands (if present)
5.5 Key insight
- Linear method = first-order Taylor expansion
- We approximate the nonlinear curve locally
- Update point → recompute slope → repeat
6 Example network
- Nodes
- A: reservoir (known head)
- B: junction
- C: demand node
- Given
- $H_A = 100 \ \text{m}$
- Demand at C: $10 \ \text{L/s}$
- Pipes
- A–B: $K = 2$
- B–C: $K = 1$
- A–C: $K = 3$
6.1 Step 1: Initial guess
- Assume initial heads
- $H_B^{(0)} = 95 \ \text{m}$
- $H_C^{(0)} = 90 \ \text{m}$
- Head differences based on the current estimate
- $\Delta H_{AB}^{(0)} = H_A - H_B^{(0)} = 100 - 95 = 5$
- $\Delta H_{BC}^{(0)} = H_B^{(0)} - H_C^{(0)} = 95 - 90 = 5$
- $\Delta H_{AC}^{(0)} = H_A - H_C^{(0)} = 100 - 90 = 10$
6.2 Step 2: Compute coefficients and constants
- Linearization about the current head difference $H_0$
- $Q(\Delta H) \approx C_{ij}(H_i-H_j) + D_{ij}$
- Coefficient
- $C_{ij} = \frac{1}{2\sqrt{K |\Delta H_0|}}$
- Constant term
- $D_{ij} = \frac{\Delta H_0}{2\sqrt{K|\Delta H_0|}}$
- A–B ($K=2$, $\Delta H_0=5$)
- $C_{AB} = \frac{1}{2\sqrt{2|5|}} \approx 0.158$
- $D_{AB} = \frac{5}{2\sqrt{2|5|}} \approx 0.791$
- B–C ($K=1$, $\Delta H_0=5$)
- $C_{BC} = \frac{1}{2\sqrt{1|5|}} \approx 0.224$
- $D_{BC} = \frac{5}{2\sqrt{1|5|}} \approx 1.118$
- A–C ($K=3$, $\Delta H_0=10$)
- $C_{AC} = \frac{1}{2\sqrt{3|10|}} \approx 0.091$
- $D_{AC} = \frac{10}{2\sqrt{3|10|}} \approx 0.913$
6.3 Step 3: Continuity equations
- Linearized pipe flows
- $Q_{AB} \approx C_{AB}(H_A-H_B) + D_{AB}$
- $Q_{BC} \approx C_{BC}(H_B-H_C) + D_{BC}$
- $Q_{AC} \approx C_{AC}(H_A-H_C) + D_{AC}$
- Node B
- $Q_{AB} - Q_{BC} = 0$
- $C_{AB}(H_A-H_B) + D_{AB} - C_{BC}(H_B-H_C) - D_{BC} = 0$
- $0.158(100-H_B) + 0.791 - 0.224(H_B-H_C) - 1.118 = 0$
- Node C
- $Q_{AC} + Q_{BC} = 10$
- $C_{AC}(H_A-H_C) + D_{AC} + C_{BC}(H_B-H_C) + D_{BC} = 10$
- $0.091(100-H_C) + 0.913 + 0.224(H_B-H_C) + 1.118 = 10$
6.4 Step 4: Matrix form
- Rearranged system
- $-0.382H_B + 0.224H_C = -15.473$
- $0.224H_B - 0.315H_C = -1.131$
- Matrix form \[ \begin{bmatrix} -0.382 & 0.224 \\ 0.224 & -0.315 \end{bmatrix} \begin{bmatrix} H_B \\ H_C \end{bmatrix} = \begin{bmatrix} -15.473 \\ -1.131 \end{bmatrix} \]
- Solve for updated heads after iteration 1
- $H_B^{(1)} \approx 73.09 \ \text{m}$
- $H_C^{(1)} \approx 55.56 \ \text{m}$
- These are updated heads, not yet the final solution
- Use $H_B^{(1)}$ and $H_C^{(1)}$ as the new estimate for the next iteration
7 In-class exercise
- Network (same layout)
- A: reservoir ($H_A = 120 \ \text{m}$)
- B: unknown head
- C: unknown head
- Given
- Demand at C: $8 \ \text{L/s}$
- Pipes
- A–B: $K = 4$
- B–C: $K = 2$
- A–C: $K = 5$
7.1 Step 1: Initial guess
- Assume initial heads
- $H_B^{(0)} = 110 \ \text{m}$
- $H_C^{(0)} = 100 \ \text{m}$
- Head differences based on the current estimate
- $\Delta H_{AB}^{(0)} = H_A - H_B^{(0)} = 120 - 110 = 10$
- $\Delta H_{BC}^{(0)} = H_B^{(0)} - H_C^{(0)} = 110 - 100 = 10$
- $\Delta H_{AC}^{(0)} = H_A - H_C^{(0)} = 120 - 100 = 20$
7.2 Step 2: Compute coefficients and constants
- Linearization about the current head difference $H_0$
- $Q(\Delta H) \approx C_{ij}(H_i-H_j) + D_{ij}$
- Coefficient
- $C_{ij} = \frac{1}{2\sqrt{K |\Delta H_0|}}$
- Constant term
- $D_{ij} = \frac{\Delta H_0}{2\sqrt{K|\Delta H_0|}}$
- A–B ($K=4$, $\Delta H_0=10$)
- $C_{AB} = \frac{1}{2\sqrt{4|10|}} \approx 0.0791$
- $D_{AB} = \frac{10}{2\sqrt{4|10|}} \approx 0.7906$
- B–C ($K=2$, $\Delta H_0=10$)
- $C_{BC} = \frac{1}{2\sqrt{2|10|}} \approx 0.1118$
- $D_{BC} = \frac{10}{2\sqrt{2|10|}} \approx 1.1180$
- A–C ($K=5$, $\Delta H_0=20$)
- $C_{AC} = \frac{1}{2\sqrt{5|20|}} = 0.0500$
- $D_{AC} = \frac{20}{2\sqrt{5|20|}} = 1.0000$
7.3 Step 3: Continuity equations
- Linearized pipe flows
- $Q_{AB} \approx C_{AB}(H_A-H_B) + D_{AB}$
- $Q_{BC} \approx C_{BC}(H_B-H_C) + D_{BC}$
- $Q_{AC} \approx C_{AC}(H_A-H_C) + D_{AC}$
- Node B
- $Q_{AB} - Q_{BC} = 0$
- $C_{AB}(H_A-H_B) + D_{AB} - C_{BC}(H_B-H_C) - D_{BC} = 0$
- $0.0791(120-H_B) + 0.7906 - 0.1118(H_B-H_C) - 1.1180 = 0$
- Node C
- $Q_{AC} + Q_{BC} = 8$
- $C_{AC}(H_A-H_C) + D_{AC} + C_{BC}(H_B-H_C) + D_{BC} = 8$
- $0.0500(120-H_C) + 1.0000 + 0.1118(H_B-H_C) + 1.1180 = 8$
7.4 Step 4: Matrix form
- Rearranged system
- $-0.1909H_B + 0.1118H_C = -9.1646$
- $0.1118H_B - 0.1618H_C = -0.1180$
- Matrix form \[ \begin{bmatrix} -0.1909 & 0.1118 \\ 0.1118 & -0.1618 \end{bmatrix} \begin{bmatrix} H_B \\ H_C \end{bmatrix} = \begin{bmatrix} -9.1646 \\ -0.1180 \end{bmatrix} \]
- Solve for updated heads after iteration 1
- $H_B^{(1)} \approx 81.36 \ \text{m}$
- $H_C^{(1)} \approx 56.95 \ \text{m}$
- These are updated heads, not yet the final solution
- Use $H_B^{(1)}$ and $H_C^{(1)}$ as the new estimate for the next iteration
8 Key points
- Linear method solves the whole network simultaneously
- Unknowns are node heads
- Linearization makes the system solvable using matrices
- One iteration already improves the solution
- Same idea scales to real systems
9 Homework: Linear method for pipe network analysis
Complete the In-class exercise. Show your full work.