@@ -137,8 +137,10 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None,
137137 print_gain = config ._get_param (
138138 'rlocus' , 'print_gain' , print_gain , _rlocus_defaults )
139139
140+ sys_loop = sys if sys .issiso () else sys [0 ,0 ]
141+
140142 # Convert numerator and denominator to polynomials if they aren't
141- (nump , denp ) = _systopoly1d (sys )
143+ (nump , denp ) = _systopoly1d (sys_loop )
142144
143145 # if discrete-time system and if xlim and ylim are not given,
144146 # that we a view of the unit circle
@@ -540,8 +542,9 @@ def _RLSortRoots(mymat):
540542
541543def _RLZoomDispatcher (event , sys , ax_rlocus , plotstr ):
542544 """Rootlocus plot zoom dispatcher"""
545+ sys_loop = sys if sys .issiso () else sys [0 ,0 ]
543546
544- nump , denp = _systopoly1d (sys )
547+ nump , denp = _systopoly1d (sys_loop )
545548 xlim , ylim = ax_rlocus .get_xlim (), ax_rlocus .get_ylim ()
546549
547550 kvect , mymat , xlim , ylim = _default_gains (
@@ -573,7 +576,9 @@ def _RLClickDispatcher(event, sys, fig, ax_rlocus, plotstr, sisotool=False,
573576
574577def _RLFeedbackClicksPoint (event , sys , fig , ax_rlocus , sisotool = False ):
575578 """Display root-locus gain feedback point for clicks on root-locus plot"""
576- (nump , denp ) = _systopoly1d (sys )
579+ sys_loop = sys if sys .issiso () else sys [0 ,0 ]
580+
581+ (nump , denp ) = _systopoly1d (sys_loop )
577582
578583 xlim = ax_rlocus .get_xlim ()
579584 ylim = ax_rlocus .get_ylim ()
@@ -584,10 +589,10 @@ def _RLFeedbackClicksPoint(event, sys, fig, ax_rlocus, sisotool=False):
584589 # Catch type error when event click is in the figure but not in an axis
585590 try :
586591 s = complex (event .xdata , event .ydata )
587- K = - 1. / sys (s )
588- K_xlim = - 1. / sys (
592+ K = - 1. / sys_loop (s )
593+ K_xlim = - 1. / sys_loop (
589594 complex (event .xdata + 0.05 * abs (xlim [1 ] - xlim [0 ]), event .ydata ))
590- K_ylim = - 1. / sys (
595+ K_ylim = - 1. / sys_loop (
591596 complex (event .xdata , event .ydata + 0.05 * abs (ylim [1 ] - ylim [0 ])))
592597
593598 except TypeError :
0 commit comments