@@ -65,8 +65,6 @@ def testMarkovSignature(self, matarrayout, matarrayin):
65
65
markov (Y , U , m )
66
66
67
67
# Make sure markov() returns the right answer
68
- # forced response can return wrong shape until gh-488 is merged
69
- @pytest .mark .xfail
70
68
@pytest .mark .parametrize ("k, m, n" ,
71
69
[(2 , 2 , 2 ),
72
70
(2 , 5 , 5 ),
@@ -81,7 +79,7 @@ def testMarkovResults(self, k, m, n):
81
79
# m = number of Markov parameters
82
80
# n = size of the data vector
83
81
#
84
- # Values should match exactly for n = m, otherewise you get a
82
+ # Values * should* match exactly for n = m, otherewise you get a
85
83
# close match but errors due to the assumption that C A^k B =
86
84
# 0 for k > m-2 (see modelsimp.py).
87
85
#
@@ -108,7 +106,10 @@ def testMarkovResults(self, k, m, n):
108
106
Mcomp = markov (Y , U , m )
109
107
110
108
# Compare to results from markov()
111
- np .testing .assert_array_almost_equal (Mtrue , Mcomp )
109
+ # experimentally determined probability to get non matching results
110
+ # with rtot=1e-6 and atol=1e-8 due to numerical errors
111
+ # for k=5, m=n=10: 0.015 %
112
+ np .testing .assert_allclose (Mtrue , Mcomp , rtol = 1e-6 , atol = 1e-8 )
112
113
113
114
def testModredMatchDC (self , matarrayin ):
114
115
#balanced realization computed in matlab for the transfer function:
@@ -219,4 +220,3 @@ def testBalredMatchDC(self, matarrayin):
219
220
np .testing .assert_array_almost_equal (rsys .B , Brtrue , decimal = 4 )
220
221
np .testing .assert_array_almost_equal (rsys .C , Crtrue , decimal = 4 )
221
222
np .testing .assert_array_almost_equal (rsys .D , Drtrue , decimal = 4 )
222
-
0 commit comments