Skip to content

Commit 537ee0c

Browse files
committed
[xferfcn_test] Add unit test for ss2tf
1 parent 31e6944 commit 537ee0c

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

control/tests/xferfcn_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,16 @@ def test_dcgain_discr(self):
600600
sys = TransferFunction([1,-1], [1], True)
601601
np.testing.assert_equal(sys.dcgain(), 0)
602602

603+
def test_ss2tf(self):
604+
A = np.array([[-4, -1], [-1, -4]])
605+
B = np.array([[1], [3]])
606+
C = np.array([[3, 1]])
607+
D = 0
608+
sys = ss2tf(A, B, C, D)
609+
true_sys = TransferFunction([6., 14.], [1., 8., 15.])
610+
np.testing.assert_almost_equal(sys.num, true_sys.num)
611+
np.testing.assert_almost_equal(sys.den, true_sys.den)
612+
603613

604614
def suite():
605615
return unittest.TestLoader().loadTestsFromTestCase(TestXferFcn)

0 commit comments

Comments
 (0)