DC gain of a transfer function

The k in zpk is not the same as the dc gain. Given transfer function $\frac{num(s)}{den(s)}$, we write the tf in the form $k\frac{(s-z_1)(s-z_2)\dots}{(s-p₁)(s-p₂)\dots}$ where $z_{i}$ are the zeros of the numerator polynomial and $p_{i}$ are the zeros of the denominator polynomial.

The number which remains in the front, is the $k$. Sometimes called system gain, not to confuse it with dc gain.

In your example, the tf in zpk is simply $3 \frac{1}{(s-p_1)(s-p_2)}$ Since numerator polynomial is 1. There are only 2 poles. Hence $k=3$.

The dcgain, is step output at $t=\infty$. This is found as follows, using final value theorem

ClearAll[s, w];
tf = 3/(s^2 - s + 5);
stepOutput = tf * LaplaceTransform[UnitStep[t], t, s];
Limit[s stepOutput, s -> 0]

Mathematica graphics

btw, matlab has separate function called dcgain, as well as the zpk as Mathematica. Here is result from Matlab which agrees with Mathematica's

>> clear all
>> s=tf('s');
>> sys=3/(s^2-s+5);
>> dcgain(sys)

    0.6000

>> [z,p,k] = zpkdata(sys);
>> k

     3

You can see that dcgain is not the same as the $k$ in zpk.


You can use Control`StaticGains

tf = 3/(s^2 - s + 5);
Control`StaticGains[TransferFunctionModel[tf, s]]

{{3/5}}

Or use the final value theorem

Limit[tf, s -> 0]

3/5

Nasser's answer already explains why StaticGains (or dc gain) is not the same as the gains in Control`ZeroPoleGainModel. The former is a system property, the latter is just an algebraic construct.


Another way to determine the dc gain:

tf = TransferFunctionModel[3/(s^2 - s + 5), s];
{a, b, c, d} = Normal@StateSpaceModel[tf];
dcgain = -c.Inverse[a].b + d

{{3/5}}