def test_properties(self):
        # Test setters/getters for cross class properties.
        # This implicitly tests to_ss() and to_tf()

        # Getters
        s = ZerosPolesGain(0, 1, 1, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            assert_equal(s.num, [1, 0])
            assert_equal(s.den, [1, -1])
            assert_equal(s.A, 1)
            assert_equal(s.B, 1)
            assert_equal(s.C, 1)
            assert_equal(s.D, 1)

        # state space setters
        s2 = ZerosPolesGain([2], [6], 3, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            s2.A = 1
            s2.B = 1
            s2.C = 1
            s2.D = 1
            self._compare_systems(s, s2)

        # tf setters
        s2 = ZerosPolesGain([2], [5], 3, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            s2.num = [1, 0]
            s2.den = [1, -1]
            self._compare_systems(s, s2)
Exemple #2
0
    def test_properties(self):
        # Test setters/getters for cross class properties.
        # This implicitly tests to_ss() and to_tf()

        # Getters
        s = ZerosPolesGain(0, 1, 1, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            assert_equal(s.num, [1, 0])
            assert_equal(s.den, [1, -1])
            assert_equal(s.A, 1)
            assert_equal(s.B, 1)
            assert_equal(s.C, 1)
            assert_equal(s.D, 1)

        # state space setters
        s2 = ZerosPolesGain([2], [6], 3, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            s2.A = 1
            s2.B = 1
            s2.C = 1
            s2.D = 1
            self._compare_systems(s, s2)

        # tf setters
        s2 = ZerosPolesGain([2], [5], 3, dt=0.05)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore", DeprecationWarning)
            s2.num = [1, 0]
            s2.den = [1, -1]
            self._compare_systems(s, s2)