Skip to content

Commit 7130434

Browse files
committed
fix bug concatenating zero dimensional when test in matlab_test.py
1 parent 2aada8b commit 7130434

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

control/rlocus.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,11 @@ def _k_max(num, den, real_break_points, k_break_points):
222222
asymp_angles = (2 * np.arange(0, asymp_number)-1) * np.pi / asymp_number
223223
farthest_points = asymp_center + distance_max * np.exp(asymp_angles * 1j) # farthest points over asymptotes
224224
kmax_asymp = -den(farthest_points) / num(farthest_points)
225-
if kmax_asymp == 0:
226-
kmax_asymp = [den.coeffs[0]/num.coeffs[0]*3]
227225
else:
228226
farthest_points = 2 * np.max(np.abs(important_points))
229-
kmax_asymp = -den(farthest_points) / num(farthest_points)
230-
if kmax_asymp == 0:
231-
kmax_asymp = -den(1) / num(1)
227+
kmax_asymp = [-den(farthest_points) / num(farthest_points)]
228+
if kmax_asymp == 0:
229+
kmax_asymp = [den.coeffs[0] / num.coeffs[0] * 3]
232230
kmax = np.max(np.concatenate((np.real(kmax_asymp), k_break_points), axis=0))
233231
return kmax
234232

0 commit comments

Comments
 (0)