control.root_locus

control.root_locus(sysdata, kvect=None, grid=None, plot=None, **kwargs)[source]

Root locus plot.

Calculate the root locus by finding the roots of 1 + k * G(s) where G is a linear system with transfer function num(s)/den(s) and each k is an element of kvect.

Parameters
• sysdata (PoleZeroMap or LTI object or list) – Linear input/output systems (SISO only, for now).

• kvect (array_like, optional) – Gains to use in computing plot of closed-loop poles.

• 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).

• plot (bool, optional) – (legacy) If given, root_locus_plot returns the legacy return values of roots and gains. If False, just return the values with no plot.

• grid (bool or str, optional) – If True plot omega-damping grid, if False show imaginary axis for continuous time systems, unit circle for discrete time systems. If empty, do not draw any additonal lines. Default value is set by config.default[‘rlocus.grid’].

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

• initial_gain (float, optional) – Mark the point on the root locus diagram corresponding to the given gain.

Returns

• lines (array of list of Line2D) – Array of Line2D objects for each set of markers in the plot. The shape of the array is given by (nsys, 3) where nsys is the number of systems or responses passed to the function. The second index specifies the object type:

• lines[idx, 0]: poles

• lines[idx, 1]: zeros

• lines[idx, 2]: loci

• roots, gains (ndarray) – (legacy) If the plot keyword is given, returns the closed-loop root locations, arranged such that each row corresponds to a gain in gains, and the array of gains (ame as kvect keyword argument if provided).

Notes

The root_locus_plot 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.