control.root_locus_plot
- control.root_locus_plot(sysdata, gains=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 and k varies over a range of gains.
- Parameters
- sysdataPoleZeroMap or LTI object or list
Linear input/output systems (SISO only, for now).
- gainsarray_like, optional
Gains to use in computing plot of closed-loop poles. If not given, gains are chosen to include the main features of the root locus map.
- xlimtuple or list, optional
Set limits of x axis (see
matplotlib.axes.Axes.set_xlim
).- ylimtuple or list, optional
Set limits of y axis (see
matplotlib.axes.Axes.set_ylim
).- plotbool, 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.- gridbool 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 additional lines. Default value is set by
config.defaults['rlocus.grid']
.- initial_gainfloat, optional
Mark the point on the root locus diagram corresponding to the given gain.
- colormatplotlib color spec, optional
Specify the color of the markers and lines.
- Returns
- cplt
ControlPlot
object Object containing the data that were plotted. See
ControlPlot
for more detailed information.- cplt.linesarray of list of
matplotlib.lines.Line2D
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
- cplt.axes2D array of
matplotlib.axes.Axes
Axes for each subplot.
- cplt.figure
matplotlib.figure.Figure
Figure containing the plot.
- cplt.legend2D array of
matplotlib.legend.Legend
Legend object(s) contained in the plot.
- roots, gainsndarray
(legacy) If the
plot
keyword is given, returns the closed-loop root locations, arranged such that each row corresponds to a gain, and the array of gains (same asgains
keyword argument if provided).
- cplt
- Other Parameters
- ax
matplotlib.axes.Axes
, optional The matplotlib axes to draw the figure on. If not specified and the current figure has a single axes, that axes is used. Otherwise, a new figure is created.
- labelstr or array_like of str, optional
If present, replace automatically generated label(s) with the given label(s). If sysdata is a list, strings should be specified for each system.
- legend_locint or str, optional
Include a legend in the given location. Default is ‘center right’, with no legend for a single response. Use False to suppress legend.
- show_legendbool, optional
Force legend to be shown if True or hidden if False. If None, then show legend when there is more than one line on the plot or
legend_loc
has been specified.- titlestr, optional
Set the title of the plot. Defaults to plot type and system name(s).
- ax
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.