TExcelTAD
Home › Control Systems & Automation › Signal-Flow Graphs and Mason's Gain Rule

Signal-Flow Graphs and Mason's Gain Rule

Block-diagram reduction works by rearranging pictures one step at a time, and with three interlocking loops and a feedforward path it becomes a page of error-prone sketches. A signal-flow graph (SFG) is the same information stripped to nodes and arrows, and Mason's gain rule reads the overall transfer function straight off it, in one formula. It is also the natural way to see why some loops interact and others do not, and it is how many circuit-analysis and filter-synthesis texts derive transfer functions of op-amp networks.

From block diagram to graph

In a signal-flow graph:

  • every signal is a node (a dot);
  • every block is a directed branch with its transfer function as the gain;
  • a node equals the sum of all branches entering it (so summing junctions disappear: a subtraction becomes a branch gain with a minus sign), and it sends its value along every branch leaving it.
1 G1 G2 G3 1 -H1 -H2 -H3 G4 R x1 x2 x3 x4 Y

The graph above has an input RR, an output YY, three feedback branches and one feedforward branch G4G_4 from x1x_1 straight to the output. Some vocabulary:

Term Meaning in the figure
forward path a path from input to output that visits no node twice: P1=G1G2G3P_1 = G_1 G_2 G_3 (via x1…x4x_1 \dots x_4), P2=G4P_2 = G_4 (via x1x_1 and YY)
loop a closed path visiting no node twice: L1=−G1H1L_1 = -G_1 H_1, L2=−G3H2L_2 = -G_3 H_2, L3=−G1G2G3H3L_3 = -G_1 G_2 G_3 H_3
touching two loops (or a loop and a path) share at least one node
non-touching they share none: here only L1L_1 (nodes x1,x2x_1, x_2) and L2L_2 (nodes x3,x4x_3, x_4)

Mason's rule

T=YR=∑kPk ΔkΔ,Δ=1−∑Li+∑LiLj−∑LiLjLk+…T = \frac{Y}{R} = \frac{\sum_k P_k\,\Delta_k}{\Delta}, \qquad \Delta = 1 - \sum L_i + \sum L_i L_j - \sum L_i L_j L_k + \dots
  • ∑Li\sum L_i: all individual loop gains; ∑LiLj\sum L_i L_j: products of all pairs of non-touching loops; then triples of mutually non-touching loops, with alternating signs.
  • Δk\Delta_k: the same determinant built only from the loops that do not touch path kk (1 if every loop touches it).

The rule is the solution of the graph's linear node equations by Cramer's rule, organised so you never write the equations down (Cramer's rule is the underlying idea).

Worked example: three loops and a bypass

Given: the graph above with G1=10s+1G_1 = \frac{10}{s + 1}, G2=1G_2 = 1, G3=5s+5G_3 = \frac{5}{s + 5}, H1=0.5H_1 = 0.5, H2=1H_2 = 1, H3=0.2H_3 = 0.2, G4=0.1G_4 = 0.1.

Find: T(s)=Y/RT(s) = Y/R, its DC gain and poles.

Solve:

  • Loops: L1=−G1H1L_1 = -G_1 H_1, L2=−G3H2L_2 = -G_3 H_2, L3=−G1G2G3H3L_3 = -G_1 G_2 G_3 H_3. One non-touching pair: L1L2=G1H1G3H2L_1 L_2 = G_1 H_1 G_3 H_2.
  • Δ=1+G1H1+G3H2+G1G2G3H3+G1H1G3H2\Delta = 1 + G_1 H_1 + G_3 H_2 + G_1 G_2 G_3 H_3 + G_1 H_1 G_3 H_2.
  • P1=G1G2G3P_1 = G_1 G_2 G_3 touches every loop: Δ1=1\Delta_1 = 1. P2=G4P_2 = G_4 passes through x1x_1, so it touches L1L_1 and L3L_3, but not L2L_2: Δ2=1−L2=1+G3H2\Delta_2 = 1 - L_2 = 1 + G_3 H_2.
  • T=G1G2G3+G4(1+G3H2)ΔT = \frac{G_1 G_2 G_3 + G_4(1 + G_3 H_2)}{\Delta}. Substituting and clearing the denominators (s+1)(s+5)(s + 1)(s + 5):
Δ (s+1)(s+5)=(s+1)(s+5)+5(s+5)+5(s+1)+10+25=s2+16s+70\Delta\,(s + 1)(s + 5) = (s + 1)(s + 5) + 5(s + 5) + 5(s + 1) + 10 + 25 = s^2 + 16 s + 70
T(s)=50+0.1(s+1)(s+10)s2+16s+70=0.1 (s2+11s+510)s2+16s+70T(s) = \frac{50 + 0.1(s + 1)(s + 10)}{s^2 + 16 s + 70} = \frac{0.1\,(s^2 + 11 s + 510)}{s^2 + 16 s + 70}
  • DC gain 51/70=0.72951/70 = 0.729; poles from s2+16s+70=0s^2 + 16 s + 70 = 0: s=−8±j6=−8±j2.449 rad/ss = -8 \pm j\sqrt{6} = -8 \pm j2.449\ \text{rad/s}, a well-damped complex pair (ζ=8/70=0.956\zeta = 8/\sqrt{70} = 0.956). The loops have turned two real open-loop poles into a complex pair.

Check: SymPy solves the five node equations directly (no Mason) and compares the two results.

python · try it yourself
import sympy as sp

s, R = sp.symbols("s R")
x1, x2, x3, x4, Y = sp.symbols("x1 x2 x3 x4 Y")
G1, G2, G3 = 10 / (s + 1), 1, 5 / (s + 5)
H1, H2, H3, G4 = sp.Rational(1, 2), 1, sp.Rational(1, 5), sp.Rational(1, 10)

# each node = sum of the branches entering it
eqs = [sp.Eq(x1, R - H1 * x2 - H3 * x4),
       sp.Eq(x2, G1 * x1),
       sp.Eq(x3, G2 * x2 - H2 * x4),
       sp.Eq(x4, G3 * x3),
       sp.Eq(Y, x4 + G4 * x1)]
sol = sp.solve(eqs, [x1, x2, x3, x4, Y], dict=True)[0]
T_nodes = sp.factor(sp.simplify(sol[Y] / R))

L1, L2, L3 = -G1 * H1, -G3 * H2, -G1 * G2 * G3 * H3
Delta = 1 - (L1 + L2 + L3) + L1 * L2
T_mason = sp.factor(sp.simplify((G1 * G2 * G3 * 1 + G4 * (1 - L2)) / Delta))
print("node equations:", T_nodes)
print("Mason's rule:  ", T_mason)
print("equal:", sp.simplify(T_nodes - T_mason) == 0, "  DC gain:", T_mason.subs(s, 0),
      "=", f"{float(T_mason.subs(s, 0)):.4f}")
print("poles:", ", ".join(f"{complex(p).real:.3f} {complex(p).imag:+.3f}j" for p in sp.solve(sp.denom(T_mason), s)))
node equations: (s**2 + 11*s + 510)/(10*(s**2 + 16*s + 70))
Mason's rule:   (s**2 + 11*s + 510)/(10*(s**2 + 16*s + 70))
equal: True   DC gain: 51/70 = 0.7286
poles: -8.000 -2.449j, -8.000 +2.449j

Solving node equations is what a computer does; Mason's rule is what a person does on paper, and it shows structure: the factor 1+G3H21 + G_3 H_2 on the bypass term says that loop L2L_2, which the bypass never enters, acts on the bypass's contribution only through the rest of Δ\Delta (the factor 1+G3H21 + G_3 H_2 partly cancels against its terms in Δ\Delta), while the loops the bypass does touch shape it fully.

Interacting and non-interacting loops

Non-touching loops multiply in Δ\Delta: the term L1L2L_1 L_2 means the two inner loops act independently, each setting its own factor of the characteristic polynomial (Δ≈(1−L1)(1−L2)\Delta \approx (1 - L_1)(1 - L_2) if L3L_3 were absent). Touching loops do not factor: tuning one changes the other. This is the formal version of a practical rule for cascade control: an inner loop should be tuned first and made much faster, so the outer loop sees it as a near-constant gain.

In the lab: a circuit is a signal-flow graph

An op-amp circuit's node equations are a signal-flow graph too. The netlist lab solves an inverting integrator (R1=10 kΩR1 = 10\ \text{k}\Omega into the summing node, C1=100 nFC1 = 100\ \text{nF} from output to summing node, the op-amp a high-gain VCVS) whose output is also fed back to the summing node through R3=10 kΩR3 = 10\ \text{k}\Omega. In the graph, the forward path from the input to the output has gain −1sRC-\frac{1}{sRC}, and the loop through R3R3 has the same gain −1sRC-\frac{1}{sRC}. Mason gives VoutVin=−1/(sRC)1+1/(sRC)=−11+sRC\frac{V_\text{out}}{V_\text{in}} = \frac{-1/(sRC)}{1 + 1/(sRC)} = \frac{-1}{1 + sRC}, a low-pass with DC gain −1-1 and corner 1/(2πRC)=159 Hz1/(2\pi RC) = 159\ \text{Hz}.

0.00.51.0101001k10kf (Hz)|V| (V)|V(out)|phasors at f = 159.0 Hz (magnitude @ phase)V(in)1.00 V @ 0.0 degV(n1)707 nV @ -45.0 degV(out)707 mV @ 135.0 degI(V1)100 uA @ -180.0 degI(R1)100 uA @ 0.0 degI(R3)70.7 uA @ 135.0 degI(C1)70.7 uA @ 45.0 degI(E1)100 uA @ 0.0 deg

Guided lab: check a reduced transfer function on a breadboard

Hand calculation. Build the circuit of the lab with one op-amp (half a TL072 or similar), 10 kΩ10\ \text{k}\Omega resistors and a 100 nF100\ \text{nF} capacitor. Mason predicts ∣Vout/Vin∣=1/2=0.707\lvert V_\text{out}/V_\text{in} \rvert = 1/\sqrt{2} = 0.707 at 159 Hz159\ \text{Hz} with a phase of 180∘−45∘=135∘180^\circ - 45^\circ = 135^\circ (inverted low-pass), and ∣H∣=1/1+102=0.0995\lvert H \rvert = 1/\sqrt{1 + 10^2} = 0.0995 at 1.59 kHz1.59\ \text{kHz}.

Simulation. The lab shows V(out)=707.5 mVV(\text{out}) = 707.5\ \text{mV} at 135.0∘135.0^\circ for 159 Hz159\ \text{Hz}; slide to 1590 Hz1590\ \text{Hz} and it shows 99.60 mV99.60\ \text{mV} at 95.7∘95.7^\circ (the small difference from 0.09950.0995 is because 159 Hz159\ \text{Hz} is not exactly 1/(2πRC)=159.15 Hz1/(2\pi RC) = 159.15\ \text{Hz}).

What you would measure. ±12 V\pm 12\ \text{V} (or ±5 V\pm 5\ \text{V}) bench supply with current limits of 50 mA50\ \text{mA}, a function generator at 1 V1\ \text{V} peak, a two-channel scope. Expect the corner within about 5 %5\,\% of 159 Hz159\ \text{Hz} (1 %1\,\% resistors, 5 %5\,\% capacitor), the gain at 1.59 kHz1.59\ \text{kHz} within ±0.5 dB\pm 0.5\ \text{dB} of −20 dB-20\ \text{dB}.

Hazards and safe setup. Low-voltage split supply, current-limited; power the op-amps before applying the signal; check polarity of any electrolytic decoupling capacitors.

Pitfalls

  • Counting a "loop" that visits a node twice (it is two loops).
  • Forgetting a loop created by a feedforward branch that lands upstream of a feedback pickoff.
  • Using Δk=1\Delta_k = 1 by habit: check, for each path, which loops it misses.
  • Writing a subtraction as a node instead of a −1-1 (or −H-H) branch gain.

Practice

  1. A single loop: forward GG, feedback −H-H. Apply Mason's rule.
  2. Two non-touching loops L1=−0.5L_1 = -0.5, L2=−0.2L_2 = -0.2 and one forward path of gain 4 that touches both. Find TT.
  3. In the worked example, what would TT be if G4=0G_4 = 0?
Answer
  1. P1=GP_1 = G, L1=−GHL_1 = -GH, Δ=1+GH\Delta = 1 + GH, Δ1=1\Delta_1 = 1: T=G1+GHT = \frac{G}{1 + GH}.
  2. Δ=1+0.5+0.2+0.1=1.8\Delta = 1 + 0.5 + 0.2 + 0.1 = 1.8; T=4/1.8=2.22T = 4/1.8 = 2.22.
  3. T=G1G2G3Δ=50s2+16s+70T = \frac{G_1 G_2 G_3}{\Delta} = \frac{50}{s^2 + 16 s + 70}, DC gain 0.7140.714.

Test yourself

In Mason's rule, Δk\Delta_k for a forward path that touches every loop is

  1. 0
  2. 1
  3. Δ\Delta
  4. the path gain

Which products appear in Δ\Delta with a plus sign?

  1. all pairs of loops
  2. pairs of non-touching loops
  3. pairs of touching loops
  4. forward-path gains

Loops L1L_1 and L2L_2 do not touch and there are no other loops. Then Δ\Delta equals

  1. 1−L1−L21 - L_1 - L_2
  2. (1−L1)(1−L2)(1 - L_1)(1 - L_2)
  3. 1+L1L21 + L_1 L_2
  4. L1L2L_1 L_2

The DC gain of the worked example's T(s)T(s) is

  1. 0.714
  2. 0.729
  3. 1.000
  4. 7.29