|
11 | 11 | ss2tf |
12 | 12 | from control.lti import evalfr |
13 | 13 | from control.exception import slycot_check |
| 14 | +from control.lti import isctime, isdtime |
14 | 15 | from control.dtime import sample_system |
15 | | -# from control.lti import isdtime |
16 | 16 |
|
17 | 17 |
|
18 | 18 | class TestXferFcn(unittest.TestCase): |
@@ -704,6 +704,21 @@ def test_ss2tf(self): |
704 | 704 | np.testing.assert_almost_equal(sys.num, true_sys.num) |
705 | 705 | np.testing.assert_almost_equal(sys.den, true_sys.den) |
706 | 706 |
|
| 707 | + def test_class_constants(self): |
| 708 | + # Make sure that the 's' variable is defined properly |
| 709 | + s = TransferFunction.s |
| 710 | + G = (s + 1)/(s**2 + 2*s + 1) |
| 711 | + np.testing.assert_array_almost_equal(G.num, [[[1, 1]]]) |
| 712 | + np.testing.assert_array_almost_equal(G.den, [[[1, 2, 1]]]) |
| 713 | + self.assertTrue(isctime(G, strict=True)) |
| 714 | + |
| 715 | + # Make sure that the 'z' variable is defined properly |
| 716 | + z = TransferFunction.z |
| 717 | + G = (z + 1)/(z**2 + 2*z + 1) |
| 718 | + np.testing.assert_array_almost_equal(G.num, [[[1, 1]]]) |
| 719 | + np.testing.assert_array_almost_equal(G.den, [[[1, 2, 1]]]) |
| 720 | + self.assertTrue(isdtime(G, strict=True)) |
| 721 | + |
707 | 722 | def test_printing(self): |
708 | 723 | # SISO, continuous time |
709 | 724 | sys = ss2tf(rss(4, 1, 1)) |
|
0 commit comments