@@ -21,15 +21,15 @@ def setUp(self):
21
21
"""Set up a MIMO system to test operations on."""
22
22
23
23
# sys1: 3-states square system (2 inputs x 2 outputs)
24
- A322 = [[- 3. , 4. , 2. ],
24
+ A322 = [[- 3j , 4j , 2. ],
25
25
[- 1. , - 3. , 0. ],
26
- [2. , 5. , 3. ]]
26
+ [2j , 5j , 3. ]]
27
27
B322 = [[1. , 4. ],
28
- [- 3. , - 3. ],
28
+ [- 3j , - 3. ],
29
29
[- 2. , 1. ]]
30
- C322 = [[4. , 2. , - 3. ],
30
+ C322 = [[4. , 2j , - 3. ],
31
31
[1. , 4. , 3. ]]
32
- D322 = [[- 2. , 4. ],
32
+ D322 = [[- 2j , 4. ],
33
33
[0. , 1. ]]
34
34
self .sys322 = StateSpace (A322 , B322 , C322 , D322 )
35
35
@@ -90,9 +90,9 @@ def test_pole(self):
90
90
"""Evaluate the poles of a MIMO system."""
91
91
92
92
p = np .sort (self .sys322 .pole ())
93
- true_p = np .sort ([3.34747678408874 ,
94
- - 3.17373839204437 + 1.47492908003839j ,
95
- - 3.17373839204437 - 1.47492908003839j ])
93
+ true_p = np .sort ([- 0.000000000000002 - 3.631067038076226j ,
94
+ - 3.345427524119811 + 0.315533519038114j ,
95
+ 3.345427524119812 + 0.315533519038115j ])
96
96
97
97
np .testing .assert_array_almost_equal (p , true_p )
98
98
@@ -117,20 +117,23 @@ def test_zero_siso(self):
117
117
118
118
np .testing .assert_almost_equal (true_z , z )
119
119
120
- @unittest .skipIf (not slycot_check (), "slycot not installed" )
120
+ # @unittest.skipIf(not slycot_check(), "slycot not installed")
121
121
def test_zero_mimo_sys322_square (self ):
122
122
"""Evaluate the zeros of a square MIMO system."""
123
123
124
124
z = np .sort (self .sys322 .zero ())
125
- true_z = np .sort ([44.41465 , - 0.490252 , - 5.924398 ])
125
+ true_z = np .sort ([26.269442405839197 - 17.632596605469434j ,
126
+ 6.573387902319676 + 1.272834429979537j ,
127
+ - 3.842830308158862 - 4.640237824510066j ])
126
128
np .testing .assert_array_almost_equal (z , true_z )
127
129
128
- @unittest .skipIf (not slycot_check (), "slycot not installed" )
130
+ # @unittest.skipIf(not slycot_check(), "slycot not installed")
129
131
def test_zero_mimo_sys222_square (self ):
130
132
"""Evaluate the zeros of a square MIMO system."""
131
133
132
134
z = np .sort (self .sys222 .zero ())
133
- true_z = np .sort ([- 10.568501 , 3.368501 ])
135
+ true_z = np .sort ([ - 6.904778467102364 + 1.237894313717807j ,
136
+ 4.304778467102365 + 2.162105686282194j ])
134
137
np .testing .assert_array_almost_equal (z , true_z )
135
138
136
139
@unittest .skipIf (not slycot_check (), "slycot not installed" )
@@ -144,11 +147,11 @@ def test_zero_mimo_sys623_non_square(self):
144
147
def test_add_ss (self ):
145
148
"""Add two MIMO systems."""
146
149
147
- A = [[- 3. , 4. , 2. , 0. , 0. ], [- 1. , - 3. , 0. , 0. , 0. ],
148
- [ 2. , 5. , 3. , 0. , 0. ], [0. , 0. , 0. , 4. , 1. ], [0. , 0. , 0. , 2. , - 3. ]]
149
- B = [[1. , 4. ], [- 3. , - 3. ], [- 2. , 1. ], [5. , 2. ], [- 3. , - 3. ]]
150
- C = [[4. , 2. , - 3. , 2. , - 4. ], [1. , 4. , 3. , 0. , 1. ]]
151
- D = [[1. , 6. ], [1. , 0. ]]
150
+ A = [[- 3j , 4j , 2. , 0. , 0. ], [- 1. , - 3. , 0. , 0. , 0. ],
151
+ [ 2j , 5j , 3. , 0. , 0. ], [0. , 0. , 0. , 4. , 1j ], [0. , 0. , 0. , 2j , - 3. ]]
152
+ B = [[1. , 4. ], [- 3j , - 3. ], [- 2. , 1. ], [5. , 2. ], [- 3j , - 3 ]]
153
+ C = [[4. , 2j , - 3. , 2. , - 4. ], [1. , 4. , 3. , 0. , 1j ]]
154
+ D = [[1j , 4 + 2j ], [1. , 0. ]]
152
155
153
156
sys = self .sys322 + self .sys222
154
157
@@ -160,11 +163,11 @@ def test_add_ss(self):
160
163
def test_subtract_ss (self ):
161
164
"""Subtract two MIMO systems."""
162
165
163
- A = [[- 3. , 4. , 2. , 0. , 0. ], [- 1. , - 3. , 0. , 0. , 0. ],
164
- [ 2. , 5. , 3. , 0. , 0. ], [0. , 0. , 0. , 4. , 1. ], [0. , 0. , 0. , 2. , - 3. ]]
165
- B = [[1. , 4. ], [- 3. , - 3. ], [- 2. , 1. ], [5. , 2. ], [- 3. , - 3. ]]
166
- C = [[4. , 2. , - 3. , - 2. , 4. ], [1. , 4. , 3. , 0. , - 1. ]]
167
- D = [[- 5. , 2. ], [- 1. , 2. ]]
166
+ A = [[- 3j , 4j , 2. , 0. , 0. ], [- 1. , - 3. , 0. , 0. , 0. ],
167
+ [ 2j , 5j , 3. , 0. , 0. , ], [0. , 0. , 0. , 4. , 1j ], [0. , 0. , 0. , 2j , - 3. ]]
168
+ B = [[1. , 4. ], [- 3j , - 3. ], [- 2. , 1. ], [5. , 2. ], [- 3j , - 3. ]]
169
+ C = [[4. , 2j , - 3. , - 2. , 4. ], [1. , 4. , 3. , 0. , - 1j ]]
170
+ D = [[5j , 4 - 2j ], [- 1. , 2. ]]
168
171
169
172
sys = self .sys322 - self .sys222
170
173
@@ -176,12 +179,11 @@ def test_subtract_ss(self):
176
179
def test_multiply_ss (self ):
177
180
"""Multiply two MIMO systems."""
178
181
179
- A = [[4. , 1. , 0. , 0. , 0. ], [2. , - 3. , 0. , 0. , 0. ], [2. , 0. , - 3. , 4. , 2. ],
180
- [- 6. , 9. , - 1. , - 3. , 0. ], [- 4. , 9. , 2. , 5. , 3. ]]
181
- B = [[5. , 2. ], [- 3. , - 3. ], [7. , - 2. ], [- 12. , - 3. ], [- 5. , - 5. ]]
182
- C = [[- 4. , 12. , 4. , 2. , - 3. ], [0. , 1. , 1. , 4. , 3. ]]
183
- D = [[- 2. , - 8. ], [1. , - 1. ]]
184
-
182
+ A = [[- 3j , 4j , 2. , 2. , - 4 + 4j ], [- 1. , - 3. , 0. , - 6j , 9j ], [2j , 5j , 3. , - 4. , 8 + 1j ],
183
+ [0. , 0. , 0. , 4. , 1j ], [0. , 0. , 0. , 2j , - 3. ]]
184
+ B = [[4 + 3j , - 4 + 2j ], [6. , 9. ], [1 - 6j , - 1 - 4j ], [5. , 2. ], [- 3j , - 3. ]]
185
+ C = [[4. , 2j , - 3. , - 4j , 12j ], [1. , 4. , 3. , 0. , 1j ]]
186
+ D = [[10. , 0. ], [1. , - 1. ]]
185
187
sys = self .sys322 * self .sys222
186
188
187
189
np .testing .assert_array_almost_equal (sys .A , A )
@@ -219,7 +221,7 @@ def test_evalfr(self):
219
221
assert len (w ) == 1
220
222
assert issubclass (w [- 1 ].category , PendingDeprecationWarning )
221
223
222
- @unittest .skipIf (not slycot_check (), "slycot not installed" )
224
+ # @unittest.skipIf(not slycot_check(), "slycot not installed")
223
225
def test_freq_resp (self ):
224
226
"""Evaluate the frequency response at multiple frequencies."""
225
227
0 commit comments