def test_dlyap(self):
        A = array([[-0.6, 0], [-0.1, -0.4]])
        Q = array([[1, 0], [0, 1]])
        X = dlyap(A, Q)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A, dot(X, A.T)) - X + Q, zeros((2, 2)))

        A = array([[-0.6, 0], [-0.1, -0.4]])
        Q = array([[3, 1], [1, 1]])
        X = dlyap(A, Q)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A, dot(X, A.T)) - X + Q, zeros((2, 2)))
Beispiel #2
0
    def test_dlyap(self):
        A = matrix([[-0.6, 0], [-0.1, -0.4]])
        Q = matrix([[1, 0], [0, 1]])
        X = dlyap(A, Q)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * A.T - X + Q, zeros((2, 2)))

        A = matrix([[-0.6, 0], [-0.1, -0.4]])
        Q = matrix([[3, 1], [1, 1]])
        X = dlyap(A, Q)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * A.T - X + Q, zeros((2, 2)))
    def test_dlyap_g(self):
        A = array([[-0.6, 0],[-0.1, -0.4]])
        Q = array([[3, 1],[1, 1]])
        E = array([[1, 1],[2, 1]])
        X = dlyap(A, Q, None, E)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A @ X @ A.T - E @ X @ E.T + Q,
                                  zeros((2,2)))

        # Make sure that trying to solve with SciPy generates an error
        with pytest.raises(ControlArgument, match="'scipy' not valid"):
            X = dlyap(A, Q, None, E, method='scipy')
    def test_dlyap(self):
        A = matrix([[-0.6, 0],[-0.1, -0.4]])
        Q = matrix([[1,0],[0,1]])
        X = dlyap(A,Q)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * A.T - X + Q, zeros((2,2)))

        A = matrix([[-0.6, 0],[-0.1, -0.4]])
        Q = matrix([[3, 1],[1, 1]])
        X = dlyap(A,Q)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * A.T - X + Q, zeros((2,2)))
    def test_dlyap(self):
        A = array([[-0.6, 0],[-0.1, -0.4]])
        Q = array([[1,0],[0,1]])
        X = dlyap(A,Q)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A,dot(X,A.T))-X+Q,zeros((2,2)))

        A = array([[-0.6, 0],[-0.1, -0.4]])
        Q = array([[3, 1],[1, 1]])
        X = dlyap(A,Q)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A,dot(X,A.T))-X+Q,zeros((2,2)))
Beispiel #6
0
    def test_dlyap_sylvester(self):
        A = 5
        B = matrix([[4, 3], [4, 3]])
        C = matrix([2, 1])
        X = dlyap(A, B, C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * B.T - X + C, zeros((1, 2)))

        A = matrix([[2, 1], [1, 2]])
        B = matrix([[1, 2], [0.5, 0.1]])
        C = matrix([[1, 0], [0, 1]])
        X = dlyap(A, B, C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * B.T - X + C, zeros((2, 2)))
    def test_dlyap_sylvester(self):
        A = 5
        B = matrix([[4, 3], [4, 3]])
        C = matrix([2, 1])
        X = dlyap(A,B,C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * B.T - X + C, zeros((1,2)))

        A = matrix([[2,1],[1,2]])
        B = matrix([[1,2],[0.5,0.1]])
        C = matrix([[1,0],[0,1]])
        X = dlyap(A,B,C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X * B.T - X + C, zeros((2,2)))
    def test_dlyap_sylvester(self):
        A = 5
        B = array([[4, 3], [4, 3]])
        C = array([2, 1])
        X = dlyap(A, B, C)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A, dot(X, B.T)) - X + C, zeros((1, 2)))

        A = array([[2, 1], [1, 2]])
        B = array([[1, 2], [0.5, 0.1]])
        C = array([[1, 0], [0, 1]])
        X = dlyap(A, B, C)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A, dot(X, B.T)) - X + C, zeros((2, 2)))
    def test_dlyap_sylvester(self):
        A = 5
        B = array([[4, 3], [4, 3]])
        C = array([2, 1])
        X = dlyap(A,B,C)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A,dot(X,B.T))-X+C,zeros((1,2)))

        A = array([[2,1],[1,2]])
        B = array([[1,2],[0.5,0.1]])
        C = array([[1,0],[0,1]])
        X = dlyap(A,B,C)
        # print "The solution obtained is ", X
        assert_array_almost_equal(dot(A,dot(X,B.T))-X+C,zeros((2,2)))
Beispiel #10
0
 def test_dlyap_g(self):
     A = matrix([[-0.6, 0], [-0.1, -0.4]])
     Q = matrix([[3, 1], [1, 1]])
     E = matrix([[1, 1], [2, 1]])
     X = dlyap(A, Q, None, E)
     # print("The solution obtained is ", X)
     assert_array_almost_equal(A * X * A.T - E * X * E.T + Q, zeros((2, 2)))
Beispiel #11
0
 def test_dlyap_g(self):
     A = matrix([[-0.6, 0],[-0.1, -0.4]])
     Q = matrix([[3, 1],[1, 1]])
     E = matrix([[1, 1],[2, 1]])
     X = dlyap(A,Q,None,E)
     # print("The solution obtained is ", X)
     assert_array_almost_equal(A * X * A.T - E * X * E.T + Q, zeros((2,2)))
Beispiel #12
0
 def test_dlyap_g(self):
     A = array([[-0.6, 0], [-0.1, -0.4]])
     Q = array([[3, 1], [1, 1]])
     E = array([[1, 1], [2, 1]])
     X = dlyap(A, Q, None, E)
     # print("The solution obtained is ", X)
     assert_array_almost_equal(
         A.dot(X).dot(A.T) - E.dot(X).dot(E.T) + Q, zeros((2, 2)))
 def test_dlyap_g(self):
     A = array([[-0.6, 0], [-0.1, -0.4]])
     Q = array([[3, 1], [1, 1]])
     E = array([[1, 1], [2, 1]])
     X = dlyap(A, Q, None, E)
     # print "The solution obtained is ", X
     assert_array_almost_equal(dot(A,dot(X,A.T))-dot(E,dot(X,E.T))+Q, \
                                   zeros((2,2)))
 def test_dlyap_g(self):
     A = array([[-0.6, 0],[-0.1, -0.4]])
     Q = array([[3, 1],[1, 1]])
     E = array([[1, 1],[2, 1]])
     X = dlyap(A,Q,None,E)
     # print "The solution obtained is ", X
     assert_array_almost_equal(dot(A,dot(X,A.T))-dot(E,dot(X,E.T))+Q, \
                                   zeros((2,2)))
    def test_dlyap_sylvester(self):
        A = 5
        B = array([[4, 3], [4, 3]])
        C = array([2, 1])
        X = dlyap(A,B,C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A * X @ B.T - X + C, zeros((1,2)))

        A = array([[2, 1], [1, 2]])
        B = array([[1, 2], [0.5, 0.1]])
        C = array([[1, 0], [0, 1]])
        X = dlyap(A, B, C)
        # print("The solution obtained is ", X)
        assert_array_almost_equal(A @ X @ B.T - X + C, zeros((2,2)))

        # Make sure that trying to solve with SciPy generates an error
        with pytest.raises(ControlArgument, match="'scipy' not valid"):
            X = dlyap(A, B, C, method='scipy')