control.sisotool

control.sisotool(sys, initial_gain=None, xlim_rlocus=None, ylim_rlocus=None, plotstr_rlocus='C0', rlocus_grid=False, omega=None, dB=None, Hz=None, deg=None, omega_limits=None, omega_num=None, margins_bode=True, tvect=None, kvect=None)[source]

Collection of plots inspired by MATLAB’s sisotool.

The left two plots contain the bode magnitude and phase diagrams. The top right plot is a clickable root locus plot, clicking on the root locus will change the gain of the system. The bottom left plot shows a closed loop time response.

Parameters
sysLTI object

Linear input/output systems. If sys is SISO, use the same system for the root locus and step response. If it is desired to see a different step response than feedback(K*sys, 1), such as a disturbance response, sys can be provided as a two-input, two-output system. For two-input, two-output system, sisotool inserts the negative of the selected gain K between the first output and first input and uses the second input and output for computing the step response. To see the disturbance response, configure your plant to have as its second input the disturbance input. To view the step response with a feedforward controller, give your plant two identical inputs, and sum your feedback controller and your feedforward controller and multiply them into your plant’s second input. It is also possible to accommodate a system with a gain in the feedback.

initial_gainfloat, optional

Initial gain to use for plotting root locus. Defaults to 1 (config.defaults['sisotool.initial_gain']).

xlim_rlocustuple or list, optional

Control of x-axis range (see matplotlib.axes.Axes.set_xlim).

ylim_rlocustuple or list, optional

Control of y-axis range (see matplotlib.axes.Axes.set_ylim).

plotstr_rlocusmatplotlib.pyplot.plot format string, optional

Plotting style for the root locus plot(color, linestyle, etc).

rlocus_gridboolean (default = False)

If True, plot s- or z-plane grid.

omegaarray_like

List of frequencies in rad/sec to be used for bode plot.

dBboolean

If True, plot result in dB for the bode plot.

Hzboolean

If True, plot frequency in Hz for the bode plot (omega must be provided in rad/sec).

degboolean

If True, plot phase in degrees for the bode plot (else radians).

omega_limitsarray_like of two values

Limits of the to generate frequency vector. If Hz=True the limits are in Hz otherwise in rad/s. Ignored if omega is provided, and auto-generated if omitted.

omega_numint

Number of samples to plot. Defaults to config.defaults['freqplot.number_of_samples'].

margins_bodeboolean

If True, plot gain and phase margin in the bode plot.

tvectlist or ndarray, optional

List of time steps to use for closed loop step response.

Examples

>>> G = ct.tf([1000], [1, 25, 100, 0])
>>> ct.sisotool(G)