control.matlab.rlocus

control.matlab.rlocus(sys, kvect=None, xlim=None, ylim=None, plotstr=None, plot=True, print_gain=None, grid=None, ax=None, **kwargs)

Root locus plot

Calculate the root locus by finding the roots of 1+k*TF(s) where TF is self.num(s)/self.den(s) and each k is an element of kvect.

Parameters
  • sys (LTI object) – Linear input/output systems (SISO only, for now).

  • kvect (list or ndarray, optional) – List of gains to use in computing diagram.

  • xlim (tuple or list, optional) – Set limits of x axis, normally with tuple (see matplotlib.axes).

  • ylim (tuple or list, optional) – Set limits of y axis, normally with tuple (see matplotlib.axes).

  • plotstr (matplotlib.pyplot.plot() format string, optional) – plotting style specification

  • plot (boolean, optional) – If True (default), plot root locus diagram.

  • print_gain (bool) – If True (default), report mouse clicks when close to the root locus branches, calculate gain, damping and print.

  • grid (bool) – If True plot omega-damping grid. Default is False.

  • ax (matplotlib.axes.Axes) – Axes on which to create root locus plot

Returns

  • rlist (ndarray) – Computed root locations, given as a 2D array

  • klist (ndarray or list) – Gains used. Same as klist keyword argument if provided.

Notes

The root_locus function calls matplotlib.pyplot.axis(‘equal’), which means that trying to reset the axis limits may not behave as expected. To change the axis limits, use matplotlib.pyplot.gca().axis(‘auto’) and then set the axis limits to the desired values.