From [1], transfer functions evaluated at s=0 are NaN when there are both zeros and poles at the origin:
else:
# numerator is zero too: give up
gain[i][j] = np.nan
We could instead check for an excess of zeros (gain 0), of poles (gain +inf or -inf), or equal number of poles and zeros (gain equal to ratio of lowest non-zero coefficients of numerator and denominator: this is the limit of the TF as s->0).
[1]
|
else: |
|
# numerator is zero too: give up |
|
gain[i][j] = np.nan |
From [1], transfer functions evaluated at s=0 are NaN when there are both zeros and poles at the origin:
We could instead check for an excess of zeros (gain 0), of poles (gain +inf or -inf), or equal number of poles and zeros (gain equal to ratio of lowest non-zero coefficients of numerator and denominator: this is the limit of the TF as s->0).
[1]
python-control/control/xferfcn.py
Lines 966 to 968 in 32f13bc