@@ -461,6 +461,7 @@ def testMinreal(self):
461461 hr = (s + 1 )/ (s ** 2 + s + 1 )
462462 np .testing .assert_array_almost_equal (hm .num [0 ][0 ], hr .num [0 ][0 ])
463463 np .testing .assert_array_almost_equal (hm .den [0 ][0 ], hr .den [0 ][0 ])
464+ np .testing .assert_equal (hm .dt , hr .dt )
464465
465466 def testMinreal2 (self ):
466467 """This one gave a problem, due to poly([]) giving simply 1
@@ -474,12 +475,24 @@ def testMinreal2(self):
474475 hr = 6205 / (s ** 2 + 8 * s + 1241 )
475476 np .testing .assert_array_almost_equal (H2b .num [0 ][0 ], hr .num [0 ][0 ])
476477 np .testing .assert_array_almost_equal (H2b .den [0 ][0 ], hr .den [0 ][0 ])
478+ np .testing .assert_equal (H2b .dt , hr .dt )
477479
478480 def testMinreal3 (self ):
479481 """Regression test for minreal of tf([1,1],[1,1])"""
480482 g = TransferFunction ([1 ,1 ],[1 ,1 ]).minreal ()
481483 np .testing .assert_array_almost_equal (1.0 , g .num [0 ][0 ])
482484 np .testing .assert_array_almost_equal (1.0 , g .den [0 ][0 ])
485+ np .testing .assert_equal (None , g .dt )
486+
487+ def testMinreal4 (self ):
488+ """Check minreal on discrete TFs."""
489+ T = 0.01
490+ z = TransferFunction ([1 , 0 ], [1 ], T )
491+ h = (z - 1.00000000001 )* (z + 1.0000000001 )/ ((z ** 2 - 1 ))
492+ hm = h .minreal ()
493+ hr = TransferFunction ([1 ], [1 ], T )
494+ np .testing .assert_array_almost_equal (hm .num [0 ][0 ], hr .num [0 ][0 ])
495+ np .testing .assert_equal (hr .dt , hm .dt )
483496
484497 @unittest .skipIf (not slycot_check (), "slycot not installed" )
485498 def testMIMO (self ):
0 commit comments