Algorithm Search⌘K

Theoremcore

Mason's gain formula

Also called Mason's rule.

The gain of a signal-flow graph from a source to a node equals the sum over forward paths of the path gain times the determinant of the loops off the path, divided by the graph determinant.

Mason's gain formula gives the gain from an input to an output of a linear signal-flow graph directly from the drawing. One lists the forward paths from the input to the output, the loops, and which loops do not touch each other, and the formula combines their gains into one fraction. In control it turns a block diagram with several feedback loops into a transfer function in one step, and in circuit theory it gives transfer functions as formulas in the element values. The formula is a combinatorial form of Cramer's rule for the node equations of the graph.

Statement

Setting. A signal-flow graph has nodes x1,…,xnx_1, \dots, x_n, one source node uu with no incoming edges, and a gain on each edge, with parallel edges merged. The node equations are (I−W)x=b u(I - W)x = b\,u, where wijw_{ij} is the gain of the edge xj→xix_j \to x_i and bib_i the gain of the edge u→xiu \to x_i. A loop is a closed path with no repeated node, and two subgraphs touch if they have a common node. The determinant of a graph is

Δ=1−∑aLa+∑a,bLaLb−∑a,b,cLaLbLc+⋯ ,\Delta = 1 - \sum_a L_a + \sum_{a,b} L_a L_b - \sum_{a,b,c} L_a L_b L_c + \cdots,

where LaL_a is the gain of loop aa, and the jj-th sum runs over the sets of jj loops that touch none of each other.

Theorem (Mason, 1956). If Δ≠0\Delta \ne 0, the gain from uu to a node y=xty = x_t is

T=yu=1Δ∑kPk Δk,T = \frac{y}{u} = \frac{1}{\Delta} \sum_k P_k\, \Delta_k,

where PkP_k is the gain of the kk-th forward path from uu to yy, and Δk\Delta_k is the determinant of the graph that is left when the nodes of the kk-th path are removed (so Δk\Delta_k uses only the loops that do not touch that path). Moreover Δ=det⁡(I−W)\Delta = \det(I - W).

In plain words

Draw every route from the input to the output and multiply the gains along each route. Then look at the feedback loops. The bottom of the fraction starts at one, takes away each loop gain, adds back the product for each pair of loops that share no node, takes away the product for each such triple, and so on. Each route on top gets the same kind of correction, but only from the loops that do not cross that route. The answer is the corrected sum of the routes divided by the bottom. The bottom is the same for every output, and it is zero exactly when the equations of the graph have no unique solution.

Proof

The proof has two claims. The first shows that the determinant of the graph is the matrix determinant. The second gets the gain from the first claim, applied to a larger graph.

Claim 1. det⁡(I−W)=∑S(−1)∣S∣∏L∈Sgain⁡(L)\det(I - W) = \sum_S (-1)^{|S|} \prod_{L \in S} \operatorname{gain}(L), where SS runs over the sets of pairwise disjoint loops, the empty set included. This sum is Δ\Delta.

Proof. By the Leibniz formula, det⁡(I−W)=∑σsgn⁡(σ)∏i(I−W)iσ(i)\det(I - W) = \sum_\sigma \operatorname{sgn}(\sigma) \prod_i (I - W)_{i \sigma(i)} over the permutations σ\sigma of {1,…,n}\{1, \dots, n\}. For σ(i)≠i\sigma(i) \ne i the factor is −wiσ(i)-w_{i\sigma(i)}. For σ(i)=i\sigma(i) = i the factor is 1−wii1 - w_{ii}; expand it as the choice of 11 or −wii-w_{ii}. After the expansion, each term is fixed by σ\sigma and a set FF of fixed points at which −wii-w_{ii} was chosen. Let UU be the set of points moved by σ\sigma, together with FF, and m=∣U∣m = |U|. The term is

sgn⁡(σ) (−1)m∏i∈Uwiσ(i).\operatorname{sgn}(\sigma)\, (-1)^m \prod_{i \in U} w_{i\sigma(i)}.

The cycles of σ\sigma on UU, with the points of FF as cycles of length one, are disjoint. A cycle i↦σ(i)↦σ2(i)↦⋯i \mapsto \sigma(i) \mapsto \sigma^2(i) \mapsto \cdots uses the factors wiσ(i),wσ(i)σ2(i),…w_{i\sigma(i)}, w_{\sigma(i)\sigma^2(i)}, \dots, which are the gains of the edges σ(i)→i\sigma(i) \to i, σ2(i)→σ(i)\sigma^2(i) \to \sigma(i), and so on. So the product is not zero exactly when every cycle is a loop of the graph (read backward), and then the product is the product of the loop gains. Conversely, a set of disjoint loops gives exactly one pair (σ,F)(\sigma, F). If the term has cc loops, sgn⁡(σ)=(−1)m−c\operatorname{sgn}(\sigma) = (-1)^{m - c}, because a cycle of length ℓ\ell has sign (−1)ℓ−1(-1)^{\ell - 1} and a cycle of length one has sign +1+1. The total sign is (−1)m−c(−1)m=(−1)c(-1)^{m - c}(-1)^m = (-1)^c. Summing over all terms gives the claim. □\square

Claim 2. Δ T=∑kPkΔk\Delta\, T = \sum_k P_k \Delta_k.

Proof. Make uu an ordinary node x0x_0 and add one edge y→x0y \to x_0 with a gain gg, a free element of the field. The new graph has no source, and its matrix is

I−W′=(1−g etT−bI−W),I - W' = \begin{pmatrix} 1 & -g\, e_t^{\mathsf T} \\ -b & I - W \end{pmatrix},

where ete_t is the tt-th unit vector. Because I−WI - W is invertible, the Schur complement formula gives

det⁡(I−W′)=det⁡(I−W) (1−g etT(I−W)−1b)=Δ (1−g T),\det(I - W') = \det(I - W)\,\bigl(1 - g\, e_t^{\mathsf T}(I - W)^{-1} b\bigr) = \Delta\,(1 - g\,T),

since T=etT(I−W)−1bT = e_t^{\mathsf T}(I - W)^{-1} b is the tt-th node value for u=1u = 1.

Now compute the same determinant with Claim 1 on the new graph. The only edge into x0x_0 is y→x0y \to x_0. So a loop of the new graph either avoids x0x_0, and then it is a loop of the old graph, or it passes through x0x_0, and then it is a forward path PkP_k from uu to yy closed by the edge y→x0y \to x_0, with gain gPkg P_k. Two loops through x0x_0 touch, so a set of disjoint loops has at most one of them. The sets with none give Δ\Delta. The sets with the loop gPkg P_k add to it any set of disjoint old loops that do not touch PkP_k, and they give (−1) gPk Δk(-1)\, g P_k\, \Delta_k. So

det⁡(I−W′)=Δ−g∑kPkΔk.\det(I - W') = \Delta - g \sum_k P_k \Delta_k.

Both expressions are polynomials of degree at most one in gg, and they are equal as polynomials, so the coefficients of gg agree: ΔT=∑kPkΔk\Delta T = \sum_k P_k \Delta_k. □\square

With Δ≠0\Delta \ne 0, Claim 2 gives the formula, and Claim 1 gives Δ=det⁡(I−W)\Delta = \det(I - W). This proves the theorem.

A worked example. Take the nodes a,b,c,da, b, c, d, the source uu, and the edges u→1au \xrightarrow{1} a, a→G1ba \xrightarrow{G_1} b, b→−H1ab \xrightarrow{-H_1} a, b→G2cb \xrightarrow{G_2} c, c→G3dc \xrightarrow{G_3} d, d→−H2cd \xrightarrow{-H_2} c and u→G4cu \xrightarrow{G_4} c, with the output dd. The loops are a→b→aa \to b \to a with gain −G1H1-G_1 H_1 and c→d→cc \to d \to c with gain −G3H2-G_3 H_2. They do not touch, so

Δ=1+G1H1+G3H2+G1H1G3H2=(1+G1H1)(1+G3H2).\Delta = 1 + G_1 H_1 + G_3 H_2 + G_1 H_1 G_3 H_2 = (1 + G_1 H_1)(1 + G_3 H_2).

The forward path u→a→b→c→du \to a \to b \to c \to d has gain G1G2G3G_1 G_2 G_3 and touches both loops, so Δ1=1\Delta_1 = 1. The forward path u→c→du \to c \to d has gain G4G3G_4 G_3 and does not touch the first loop, so Δ2=1+G1H1\Delta_2 = 1 + G_1 H_1. Hence

T=G1G2G3+G4G3(1+G1H1)(1+G1H1)(1+G3H2).T = \frac{G_1 G_2 G_3 + G_4 G_3 (1 + G_1 H_1)}{(1 + G_1 H_1)(1 + G_3 H_2)}.

With G1=2G_1 = 2, H1=0.5H_1 = 0.5, G2=3G_2 = 3, G3=4G_3 = 4, H2=0.25H_2 = 0.25 and G4=1G_4 = 1, this gives Δ=4\Delta = 4, the numerator 24+8=3224 + 8 = 32 and T=8T = 8. Solving the four node equations by Gaussian elimination gives d=8d = 8 for u=1u = 1 as well.

Consequences

  • The block diagram rules. Each rule of block diagram reduction is a small case. Two blocks in series form one path with no loop, so T=G1G2T = G_1 G_2. Two blocks in parallel form two paths, so T=G1+G2T = G_1 + G_2. A negative feedback loop has the path GG and the loop −GH-GH, so T=G/(1+GH)T = G/(1 + GH).
  • The closed-loop characteristic equation. For a graph whose gains are transfer functions, Δ(s)=0\Delta(s) = 0 is the characteristic equation of the interconnection, and Δ\Delta is the same for every input and output. So all closed-loop transfer functions of one diagram share the denominator Δ\Delta, up to cancellations.
  • Symbolic analysis. The formula gives the transfer function as an explicit sum of products of the gains. Symbolic circuit analysis uses this to show how each element value enters a circuit's response.
  • Cost (a measurement of the count). The number of loops can grow exponentially with the number of nodes. In the complete directed graph on nn nodes, the number of loops of length at least 2 is ∑k=2n(nk)(k−1)!\sum_{k=2}^{n} \binom{n}{k}(k - 1)!, which is 84 for n=5n = 5, 1,112,073 for n=10n = 10 and about 3.49×10173.49 \times 10^{17} for n=20n = 20. Gaussian elimination solves the same node equations in O(n3)O(n^3) arithmetic operations. So the formula is a tool for small graphs and for formulas, not a numeric algorithm for large ones.

Tightness

  • The products of nontouching loops are needed. In the worked example, the sum of the single loops alone gives 1+1+1=31 + 1 + 1 = 3 in place of Δ=4\Delta = 4, and then TT would be wrong. Only when every two loops touch is Δ=1−∑aLa\Delta = 1 - \sum_a L_a.
  • The cofactor Δk\Delta_k is needed. With Δ2=1\Delta_2 = 1 in place of 1+G1H11 + G_1 H_1, the example gives 28/4=728/4 = 7, not 8. A path that misses a loop is still multiplied by that loop's factor.
  • The hypothesis Δ≠0\Delta \ne 0 cannot be dropped. A node xx with a self-loop of gain 1 and an edge u→1xu \xrightarrow{1} x gives x=x+ux = x + u, which has no solution for u≠0u \ne 0. Here Δ=0\Delta = 0 and the formula has no meaning.
  • Linearity cannot be dropped. The proof uses the determinant of the node equations, so it fails for a graph with a product or a saturation at a node.

History

Samuel J. Mason, at the Research Laboratory of Electronics of MIT, introduced signal-flow graphs in a 1953 paper on feedback theory, with the node equations and rules to reduce a graph step by step. His 1956 paper, "Further properties of signal flow graphs", gave the general gain formula and its proof by the expansion of the determinant of the node equations; it also appeared in 1955 as an MIT Research Laboratory of Electronics technical report. Control textbooks teach the formula as "Mason's rule", as the hand method for diagrams with several loops.

References

  1. Samuel J. Mason, Feedback theory, further properties of signal flow graphs, Proceedings of the IRE 44(7), 1956, pp. 920 to 926 (the general gain formula and its proof by the expansion of a determinant)
  2. Samuel J. Mason, Feedback theory, some properties of signal flow graphs, Proceedings of the IRE 41(9), 1953, pp. 1144 to 1156 (the graphs, their node equations and their reduction rules)
  3. Gene F. Franklin, J. David Powell and Abbas Emami-Naeini, Feedback Control of Dynamic Systems, eighth edition, Pearson, 2019, Section 3.2.3, Mason's Rule and the Signal Flow Graph (an online section)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/D9D5KK/text.yaml