1 2 | | | | a |\/| |\/| b |\/| c |\/| |\/|_________|\/| | \ \ \ \ \ | | 3 /_/_/_/_/ 4 | | | | | |\/| |\/| d |\/| |\/| e | | |\/| 5 6The net inflow of fluid at each node must balance the net outflow, for otherwise fluid would accumulate
a = c + d (fluid flowing into Node 3 = fluid flowing out)
b + c = e (Node 4)
Suppose we know the fluid flows at the top of the network - for
example, suppose a is 10 and b is 12.
Then we have
d = 10 - c and e = 12 + c.Thus if we know one additional flow rate, we can determine the others. For example, if the flow in the
If we know about pressures and resistances in the network, we can easily say more about the flow. The basic law is
Pressure = Resistance x Flow Rate-------- Path ---------- Resistance ---------
a 1
b 2
c 5
d 1
e 1
---------------------------------------------If we measure some of the pressure drops across the network, then we get additional equations from the following principle: The pressure drop from node A to node B equals the sum of the pressure drops along the segments of any path from node A to node B
Path ad: 40 = a + d
Path ace: 30 = a + 5c + e
Path be: 30 = 2b + eThe path bcd gives the equation 40 = 2b - 5c + d, but this equation is just a combination of the three we already have, so we don't gain or lose anything by including it. (Start with the equation for path ad. Use path ace to eliminate a from the equation. Then use path be to eliminate e.)
The pressure drop equations above, combined with the conservation laws yield five equations in five unknowns:
a - c - d = 0
b + c - e = 0
a + d = 40
a + 5c + e = 30
2b + e = 30
If the equations are independent (and they are) they will determine
all five flow rates. This 5x5 system could easily be solved by hand,
but we will use it to illustrate how to solve a linear system in MATLAB.
We could set up the augmented matrix of this system and have MATLAB
do gaussian elimination:
>> M = [ 1 0 -1 -1 0 0;
0 1 1 0 -1 0;
1 0 0 1 0 40;
1 0 5 0 1 30;
0 2 0 0 1 30 ]
>> rref(M)Alternatively, we could view this system in the form Ax = b, define the coefficient matrix A and the vector b in MATLAB and use the backslash operator to solve for the flow rates:
>> A = [1 0 -1 -1 0; 0 1 1 0 -1;
1 0 0 1 0; 1 0 5 0 1;
0 2 0 0 1]
>> b = [ 0; 0; 40; 30; 30]
>> x = A\bRemark: Numerically the backslash method is more efficient so with large matrices it is preferred. The backslash operator in MATLAB uses the LU decomposition of the matrix A to solve the system. The LU decomposition is computed essentially by transforming A into an upper triangular matrix U via elementary row operations (thus starting in the same way as solving by finding the row reduced echelon form for A). Simultaneously this sequence of row operations is used to construct a lower triangular matrix L with the property that A = LU. This system can be easily solved by back-substitution and forward-substitution. When working with systems with thousands of equations, it becomes essential to consider the efficiency of the method, taking advantage of any shortcut that reduces the number of numerical calculations needed to solve.
Consider the network described in the figure below:
1 | | |\/| a b |\/| ____________| | | / / | | 3 __\_\____ 2| | | | | |\/| |\/| c |\/| |\/| h | |_________| | | \ \ | | 4 __/_/____ 5| | | i | | |\/| |\/| d | | | | g |\/| |\/| | |_________| | | 7 / / 6 | | __\_\_______| | | f |\/| e |\/| | | 8Exercise 1 Find the flow rates in the network, assuming that all the resistances are 1 and the pressure drop from top to bottom is also 1.
Exercise 2 Find the flow rates assuming that all the resistances are 1 and the pressure drop from top to bottom is now 2.
Exercise 3 Find the flow rates assuming that the resistance of edge b is 1/2 instead of 1 and the pressure drop is 1.
Exercise 4 Suppose we turn off the resistance in
our network - that is, set them to 0 to describe a superfluid (like liquid
helium near absolute zero). Suppose further that the flow in the
top and out the bottom is zero. Describe all possible fluid flows,
both mathematically and physically.