control.sisotool

control.sisotool(sys, kvect=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)

Sisotool style 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
  • sys (LTI 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*loop,1), sys can be provided as a two-input, two-output system (e.g. by using bdgalg.connect' or :func:`iosys.interconnect()). 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. This allows you to see the step responses of more complex systems, for example, systems with a feedforward path into the plant or in which the gain appears in the feedback path.

  • kvect (list or ndarray, optional) – List of gains to use for plotting root locus

  • xlim_rlocus (tuple or list, optional) – control of x-axis range, normally with tuple (see matplotlib.axes).

  • ylim_rlocus (tuple or list, optional) – control of y-axis range

  • plotstr_rlocus (matplotlib.pyplot.plot() format string, optional) – plotting style for the root locus plot(color, linestyle, etc)

  • rlocus_grid (boolean (default = False)) – If True plot s- or z-plane grid.

  • omega (array_like) – List of frequencies in rad/sec to be used for bode plot

  • dB (boolean) – If True, plot result in dB for the bode plot

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

  • deg (boolean) – If True, plot phase in degrees for the bode plot (else radians)

  • omega_limits (array_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_num (int) – Number of samples to plot. Defaults to config.defaults[‘freqplot.number_of_samples’].

  • margins_bode (boolean) – If True, plot gain and phase margin in the bode plot

  • tvect (list or ndarray, optional) – List of timesteps to use for closed loop step response

Examples

>>> sys = tf([1000], [1,25,100,0])
>>> sisotool(sys)