Skip to content

Commit 90959bd

Browse files
committed
changed root locus test to a numerically more significant one.
1 parent cdb9f42 commit 90959bd

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

control/rlocus.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ def _RLClickDispatcher(event,sys,fig,ax_rlocus,plotstr,sisotool=False,bode_plot_
413413

414414
# If zoom is used on the rootlocus plot smooth and update it
415415
if plt.get_current_fig_manager().toolbar.mode in ['zoom rect','pan/zoom'] and event.inaxes == ax_rlocus.axes:
416-
417416
(nump, denp) = _systopoly1d(sys)
418417
xlim,ylim = ax_rlocus.get_xlim(),ax_rlocus.get_ylim()
419418

control/tests/rlocus_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,20 @@ def test_root_locus_zoom(self):
5252
fig = plt.gcf()
5353
ax_rlocus = fig.axes[0]
5454

55-
event = type('test', (object,), {'xdata': 0.9957380594313321, 'ydata': 1.7825491928580846, 'inaxes': ax_rlocus.axes})()
56-
ax_rlocus.set_xlim((-4.420022219849855, 0.9957380594313321))
57-
ax_rlocus.set_ylim((1.7825491928580846, 10.695295157148486))
55+
event = type('test', (object,), {'xdata': 14.7607954359, 'ydata': -35.6171379864, 'inaxes': ax_rlocus.axes})()
56+
ax_rlocus.set_xlim((-10.813628105112421, 14.760795435937652))
57+
ax_rlocus.set_ylim((-35.61713798641108, 33.879716621220311))
5858
plt.get_current_fig_manager().toolbar.mode = 'zoom rect'
5959
_RLClickDispatcher(event, system, fig, ax_rlocus, '-')
6060

6161
zoom_x = ax_rlocus.lines[-2].get_data()[0][65:75]
6262
zoom_y = ax_rlocus.lines[-2].get_data()[1][65:75]
6363
zoom_y = [abs(y) for y in zoom_y]
6464

65-
zoom_x_valid = [-2.23659192, -2.23659121, -2.23659103, -2.23659086, -2.23659068, -2.23659063,
66-
-2.23659059, -2.23659055, -2.2365905, -2.23658766]
67-
zoom_y_valid = [1.78253589, 1.78254318, 1.782545, 1.78254682, 1.78254864, 1.7825491,
68-
1.78254955, 1.78255001, 1.78255046, 1.7825796]
65+
zoom_x_valid = [4.35145783, 4.49519318, 4.63559911 , 4.7728639 , 5.2937363 , 5.77581159,
66+
6.22564674 , 6.64818196 , 7.0472438 , 7.4258642]
67+
zoom_y_valid = [19.34886165, 19.63109635, 19.90593613 , 20.17384159 , 21.18390302,
68+
22.11041787, 22.96863881, 23.76981422 , 24.52250243, 25.23338241]
6969

7070
assert_array_almost_equal(zoom_x,zoom_x_valid)
7171
assert_array_almost_equal(zoom_y,zoom_y_valid)

0 commit comments

Comments
 (0)