Calculate power gains for a sample 2-port network.

**Calculate the transducer power gain of the network**

**Calculate the available power gain of the network**

Note that, as expected, the available power gain is larger than the transducer power gain, `Gt`

. The two become identical when `Gt`

is measured with a matched load impedance:

**Calculate the operating power gain of the network**

Note that, as expected, the operating power gain is larger than the transducer power gain, `Gt`

. The two become identical when `Gt`

is measured with a matched source impedance:

**Calculate the maximum available power gain of the network**

Note that, as expected, the maximum available power gain is larger than the available power gain `Ga`

, the transducer power gain, `Gt`

, and the operating power gain, `Gp`

. They all become identical when measured with simultaneously matched source and load impedances:

zl_matched_sim = 33.6758 + 91.4816i

That impedance can be also obtained directly using:

zl_matched_sim = 33.6758 + 91.4816i

When the scattering parameters represent a network that is *not* unconditionally stable, there is no set of source and load impedances that provide simultaneous matching. In this case, the maximum available power is infinite, but truly meaningless because the network is unstable.

To make the previously defined network conditionally stable, it is enough to increase the magnitude of the backward propagation scattering parameter, `s12`

:

To verify that the network is conditionally stable, check that the stability factor, *K*, is smaller than 1:

An attempt to calculate the maximum available gain of the network yields a NaN:

Instead, the maximum stable gain, ${\mathit{G}}_{\mathrm{msg}}$, should be used.

**Calculate the maximum stable power gain of the network**

Gmsg_cond_stable = 62.0000

The maximum stable power gain is only meaningful when the network is not unconditionally stable.