Skip to content

ss2tf adds additional wrong zeros #1068

@flor1an42

Description

@flor1an42

I have a DC motor model in Statespace (tf_ss), cast this to a transfer function (tf_1), and compare the poles and zeros with the analytical correct transfer function (tf_2).

The poles are correctly mapped by ss2tf, but the ss2tf adds additional zeros.
This might be a bug?

import numpy as np
import control as ct

Li = 1e-7
k = 1e-3
Rm = 1
Lm = 1e-3

A = np.array([
      [0,       1,         0],
      [0,       0,     k/Li],
      [0, - k/Lm, - Rm/Lm]])
B = np.array([[0], [0], [1/Lm]])
C = np.array([[1, 0, 0]])
D = np.array([[0]])

s = ct.TransferFunction.s

tf_ss = ct.ss(A, B, C, D)
tf_1 = ct.ss2tf(A, B, C, D) 
tf_2 = k/s / ( k**2 + s*Li*(s*Lm + Rm)) 

print(tf_ss.poles())
print(tf_1.poles())
print(tf_2.poles())
# output identical
#[   0.        +0.j  -10.10205144+0.j -989.89794856+0.j]
#[-989.89794856+0.j  -10.10205144+0.j    0.        +0.j]
#[-989.89794856+0.j  -10.10205144+0.j    0.        +0.j]

print(tf_ss.zeros())
print(tf_1.zeros())
print(tf_2.zeros())
# output tf_1 adds zeros ?
#[]
#[120.+6.63177692e+09j 120.-6.63177692e+09j]
#[]

Python 3.12.7
Control Version: 0.10.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions