@@ -89,10 +89,10 @@ def test_ss2io(self, tsys):
8989 # Create an input/output system from the linear system
9090 linsys = tsys .siso_linsys
9191 iosys = ct .ss2io (linsys )
92- np .testing .assert_array_equal (linsys .A , iosys .A )
93- np .testing .assert_array_equal (linsys .B , iosys .B )
94- np .testing .assert_array_equal (linsys .C , iosys .C )
95- np .testing .assert_array_equal (linsys .D , iosys .D )
92+ np .testing .assert_allclose (linsys .A , iosys .A )
93+ np .testing .assert_allclose (linsys .B , iosys .B )
94+ np .testing .assert_allclose (linsys .C , iosys .C )
95+ np .testing .assert_allclose (linsys .D , iosys .D )
9696
9797 # Try adding names to things
9898 iosys_named = ct .ss2io (linsys , inputs = 'u' , outputs = 'y' ,
@@ -104,10 +104,10 @@ def test_ss2io(self, tsys):
104104 assert iosys_named .find_state ('x0' ) is None
105105 assert iosys_named .find_state ('x1' ) == 0
106106 assert iosys_named .find_state ('x2' ) == 1
107- np .testing .assert_array_equal (linsys .A , iosys_named .A )
108- np .testing .assert_array_equal (linsys .B , iosys_named .B )
109- np .testing .assert_array_equal (linsys .C , iosys_named .C )
110- np .testing .assert_array_equal (linsys .D , iosys_named .D )
107+ np .testing .assert_allclose (linsys .A , iosys_named .A )
108+ np .testing .assert_allclose (linsys .B , iosys_named .B )
109+ np .testing .assert_allclose (linsys .C , iosys_named .C )
110+ np .testing .assert_allclose (linsys .D , iosys_named .D )
111111
112112 def test_iosys_unspecified (self , tsys ):
113113 """System with unspecified inputs and outputs"""
@@ -1132,14 +1132,14 @@ def test_lineariosys_statespace(self, tsys):
11321132 assert isinstance (iosys_siso , ct .StateSpace )
11331133
11341134 # Make sure that state space functions work for LinearIOSystems
1135- np .testing .assert_array_equal (
1135+ np .testing .assert_allclose (
11361136 iosys_siso .pole (), tsys .siso_linsys .pole ())
11371137 omega = np .logspace (.1 , 10 , 100 )
11381138 mag_io , phase_io , omega_io = iosys_siso .frequency_response (omega )
11391139 mag_ss , phase_ss , omega_ss = tsys .siso_linsys .frequency_response (omega )
1140- np .testing .assert_array_equal (mag_io , mag_ss )
1141- np .testing .assert_array_equal (phase_io , phase_ss )
1142- np .testing .assert_array_equal (omega_io , omega_ss )
1140+ np .testing .assert_allclose (mag_io , mag_ss )
1141+ np .testing .assert_allclose (phase_io , phase_ss )
1142+ np .testing .assert_allclose (omega_io , omega_ss )
11431143
11441144 # LinearIOSystem methods should override StateSpace methods
11451145 io_mul = iosys_siso * iosys_siso2
@@ -1150,19 +1150,19 @@ def test_lineariosys_statespace(self, tsys):
11501150
11511151 # And make sure the systems match
11521152 ss_series = tsys .siso_linsys * tsys .siso_linsys
1153- np .testing .assert_array_equal (io_mul .A , ss_series .A )
1154- np .testing .assert_array_equal (io_mul .B , ss_series .B )
1155- np .testing .assert_array_equal (io_mul .C , ss_series .C )
1156- np .testing .assert_array_equal (io_mul .D , ss_series .D )
1153+ np .testing .assert_allclose (io_mul .A , ss_series .A )
1154+ np .testing .assert_allclose (io_mul .B , ss_series .B )
1155+ np .testing .assert_allclose (io_mul .C , ss_series .C )
1156+ np .testing .assert_allclose (io_mul .D , ss_series .D )
11571157
11581158 # Make sure that series does the same thing
11591159 io_series = ct .series (iosys_siso , iosys_siso2 )
11601160 assert isinstance (io_series , ct .InputOutputSystem )
11611161 assert isinstance (io_series , ct .StateSpace )
1162- np .testing .assert_array_equal (io_series .A , ss_series .A )
1163- np .testing .assert_array_equal (io_series .B , ss_series .B )
1164- np .testing .assert_array_equal (io_series .C , ss_series .C )
1165- np .testing .assert_array_equal (io_series .D , ss_series .D )
1162+ np .testing .assert_allclose (io_series .A , ss_series .A )
1163+ np .testing .assert_allclose (io_series .B , ss_series .B )
1164+ np .testing .assert_allclose (io_series .C , ss_series .C )
1165+ np .testing .assert_allclose (io_series .D , ss_series .D )
11661166
11671167 # Test out feedback as well
11681168 io_feedback = ct .feedback (iosys_siso , iosys_siso2 )
@@ -1173,10 +1173,10 @@ def test_lineariosys_statespace(self, tsys):
11731173
11741174 # And make sure the systems match
11751175 ss_feedback = ct .feedback (tsys .siso_linsys , tsys .siso_linsys )
1176- np .testing .assert_array_equal (io_feedback .A , ss_feedback .A )
1177- np .testing .assert_array_equal (io_feedback .B , ss_feedback .B )
1178- np .testing .assert_array_equal (io_feedback .C , ss_feedback .C )
1179- np .testing .assert_array_equal (io_feedback .D , ss_feedback .D )
1176+ np .testing .assert_allclose (io_feedback .A , ss_feedback .A )
1177+ np .testing .assert_allclose (io_feedback .B , ss_feedback .B )
1178+ np .testing .assert_allclose (io_feedback .C , ss_feedback .C )
1179+ np .testing .assert_allclose (io_feedback .D , ss_feedback .D )
11801180
11811181 # Make sure series interconnections are done in the right order
11821182 ss_sys1 = ct .rss (2 , 3 , 2 )
@@ -1190,10 +1190,10 @@ def test_lineariosys_statespace(self, tsys):
11901190
11911191 # While we are at it, check that the state space matrices match
11921192 ss_series = ss_sys2 * ss_sys1
1193- np .testing .assert_array_equal (io_series .A , ss_series .A )
1194- np .testing .assert_array_equal (io_series .B , ss_series .B )
1195- np .testing .assert_array_equal (io_series .C , ss_series .C )
1196- np .testing .assert_array_equal (io_series .D , ss_series .D )
1193+ np .testing .assert_allclose (io_series .A , ss_series .A )
1194+ np .testing .assert_allclose (io_series .B , ss_series .B )
1195+ np .testing .assert_allclose (io_series .C , ss_series .C )
1196+ np .testing .assert_allclose (io_series .D , ss_series .D )
11971197
11981198 def test_docstring_example (self ):
11991199 P = ct .LinearIOSystem (
0 commit comments