# Mason's gain formula

**Mason's gain formula** (MGF) is a method for finding the transfer function of a linear signal-flow graph (SFG). The formula was derived by Samuel Jefferson Mason^{[1]} and is named after its discoverer. MGF is an alternate method to finding the transfer function algebraically by labeling each signal, writing down the equation for how that signal depends on other signals, and then solving the multiple equations for the output signal in terms of the input signal. MGF provides a step by step method to obtain the transfer function from a SFG. Often, MGF can be determined by inspection of the SFG. The method can easily handle SFGs with many variables and loops including loops with inner loops. MGF comes up often in the context of control systems and digital filters because control systems and digital filters are often represented by SFGs.

## Formula

The gain formula is as follows:

where:

- Δ = the determinant of the graph.
*y*_{in}= input-node variable*y*_{out}= output-node variable*G*= complete gain between*y*_{in}and*y*_{out}*N*= total number of forward paths between*y*_{in}and*y*_{out}*G*_{k}= gain of the*k*th forward path between*y*_{in}and*y*_{out}*L*_{i}= loop gain of each closed loop in the system*L*_{i}*L*_{j}= product of the loop gains of any two non-touching loops (no common nodes)*L*_{i}*L*_{j}*L*_{k}= product of the loop gains of any three pairwise nontouching loops- Δ
_{k}= the cofactor value of Δ for the*k*^{th}forward path, with the loops touching the*k*^{th}forward path removed. *

### Procedure

To use this technique,

- Make a list of all forward paths, and their gains, and label these
*G*_{k}. - Make a list of all the loops and their gains, and label these
*L*_{i}(for*i*loops). Make a list of all pairs of non-touching loops, and the products of their gains (*L*_{i}*L*_{j}). Make a list of all pairwise non-touching loops taken three at a time (*L*_{i}*L*_{j}*L*_{k}), then four at a time, and so forth, until there are no more. - Compute the determinant Δ and cofactors Δ
_{k}. - Apply the formula.

## Examples

### Circuit containing two-port

The transfer function from **V _{in}** to

**V**is desired.

_{2}There is only one forward path:

There are three loops:

### Digital IIR biquad filter

Digital filters are often diagramed as signal flow graphs.

### Servo

The signal flow graph has six loops. They are:

There is one forward path:

The forward path touches all the loops therefore the co-factor

And the gain from input to output is

## Equivalent matrix form

Mason's rule can be stated in a simple matrix form. Assume is the transient matrix of the graph where is the sum transmittance of branches from node *m* toward node *n*. Then, the gain from node *m* to node *n* of the graph is equal to , where

Mason's Rule is also particularly useful for deriving the z-domain transfer function of discrete networks that have inner feedback loops embedded within outer feedback loops (nested loops). If the discrete network can be drawn as a signal flow graph, then the application of Mason's Rule will give that network's z-domain H(z) transfer function.

## Complexity and Computational Applications

Mason's Rule can grow factorially, because the enumeration of paths in a directed graph grows thusly. To see this consider the complete directed graph on vertices, having an edge between every pair of vertices. There is a path form to for each of the permutations of the intermediate vertices. Thus Gaussian elimination is more efficient in the general case.

Yet Mason's rule characterizes the transfer functions of interconnected systems in a way which is simultaneously algebraic and combinatorial, allowing for general statements and other computations in algebraic systems theory. While numerous inverses occur during Gaussian eliminiation, Mason's rule naturally collects these into a single quasi-inverse. General form is

Where as described above, is a sum of cycle products, each of which typically falls into an ideal (for example, the strictly causal operators). Fractions of this form form a subring of the rational function field. This observation carries over to the noncommutative case,^{[2]} even though Mason's rule itself must then be replaced by Riegle's rule.

## See also

## Notes

## References

- {{#invoke:citation/CS1|citation

|CitationClass=book }}

- {{#invoke:citation/CS1|citation

|CitationClass=book }}