Nyquist plot for a system.
Generates a Nyquist plot for the system over a (optional) frequency range. The curve is computed by evaluating the Nyquist segment along the positive imaginary axis, with a mirror image generated to reflect the negative imaginary axis. Poles on or near the imaginary axis are avoided using a small indentation. The portion of the Nyquist contour at infinity is not explicitly computed (since it maps to a constant value for any system with a proper transfer function).
LTI
or NyquistResponseData
List of linear input/output systems (single system is OK) or Nyquist responses (computed using nyquist_response
). Nyquist curves for each system are plotted on the same graph.
Set of frequencies to be evaluated, in rad/sec. Specifying omega
as a list of two elements is equivalent to providing omega_limits
.
If True, display the unit circle, to read gain crossover frequency. The circle style is determined by config.defaults['nyquist.circle_style']
.
Draw circles corresponding to the given magnitudes of sensitivity.
Draw circles corresponding to the given magnitudes of complementary sensitivity.
matplotlib.pyplot.plot
keyword properties, optional
Additional keywords passed to matplotlib
to specify line properties.
ControlPlot
object
Object containing the data that were plotted. See ControlPlot
for more detailed information.
matplotlib.lines.Line2D
Array containing information on each line in the plot. The shape of the array is given by (nsys, 4) where nsys is the number of systems or Nyquist responses passed to the function. The second index specifies the segment type:
lines[idx, 0]: unscaled portion of the primary curve
lines[idx, 1]: scaled portion of the primary curve
lines[idx, 2]: unscaled portion of the mirror curve
lines[idx, 3]: scaled portion of the mirror curve
matplotlib.axes.Axes
Axes for each subplot.
matplotlib.figure.Figure
Figure containing the plot.
matplotlib.legend.Legend
Legend object(s) contained in the plot.
Specify the number of arrows to plot on the Nyquist curve. If an integer is passed. that number of equally spaced arrows will be plotted on each of the primary segment and the mirror image. If a 1D array is passed, it should consist of a sorted list of floats between 0 and 1, indicating the location along the curve to plot an arrow. If a 2D array is passed, the first row will be used to specify arrow locations for the primary curve and the second row will be used for the mirror image. Default value is 2 and can be set using config.defaults['nyquist.arrows']
.
Arrowhead width and length (in display coordinates). Default value is 8 and can be set using config.defaults['nyquist.arrow_size']
.
Define style used for Nyquist curve arrows (overrides arrow_size
).
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.
For portions of the Nyquist curve that are scaled to have a maximum magnitude of max_curve_magnitude
, begin a smooth rescaling at this fraction of max_curve_magnitude
. Default value is 0.15.
Define the threshold for generating a warning if the number of net encirclements is a non-integer value. Default value is 0.05 and can be set using config.defaults['nyquist.encirclement_threshold']
.
For poles on the imaginary axis, set the direction of indentation to be ‘right’ (default), ‘left’, or ‘none’.
Number of points to insert in the Nyquist contour around poles that are at or near the imaginary axis.
Amount to indent the Nyquist contour around poles on or near the imaginary axis. Portions of the Nyquist plot corresponding to indented portions of the contour are plotted using a different line style.
If present, replace automatically generated label(s) with the given label(s). If data
is a list, strings should be specified for each system.
Label every nth frequency on the plot. If not specified, no labels are generated.
Include a legend in the given location. Default is ‘upper right’, with no legend for a single response. Use False to suppress legend.
Restrict the maximum magnitude of the Nyquist plot to this value. Portions of the Nyquist plot whose magnitude is restricted are plotted using a different line style. The default value is 20 and can be set using config.defaults['nyquist.max_curve_magnitude']
.
When plotting scaled portion of the Nyquist plot, increase/decrease the magnitude by this fraction of the max_curve_magnitude to allow any overlaps between the primary and mirror curves to be avoided. The default value is 0.02 and can be set using config.defaults['nyquist.max_curve_magnitude']
.
Linestyles for mirror image of the Nyquist curve. The first element is used for unscaled portions of the Nyquist curve, the second element is used for portions that are scaled (using max_curve_magnitude). If False then omit completely. Default linestyle ([’–’, ‘:’]) is determined by config.defaults['nyquist.mirror_style']
.
Set limits for plotted frequency range. If Hz=True the limits are in Hz otherwise in rad/s. Specifying omega
as a list of two elements is equivalent to providing omega_limits
.
Number of samples to use for the frequency range. Defaults to config.defaults['freqplot.number_of_samples']
. Ignored if data
is not a system or list of systems.
(legacy) If given, nyquist_plot
returns the legacy return values of (counts, contours). If False, return the values with no plot.
Linestyles for primary image of the Nyquist curve. The first element is used for unscaled portions of the Nyquist curve, the second element is used for portions that are scaled (using max_curve_magnitude). Default linestyle ([‘-’, ‘-.’]) is determined by config.defaults['nyquist.mirror_style']
.
Override the default parameters used for generating plots. Default is set by config.defaults['ctrlplot.rcParams']
.
(legacy) If True, return the encirclement count and Nyquist contour used to generate the Nyquist plot.
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.
Matplotlib marker to use to mark the starting point of the Nyquist plot. Defaults value is ‘o’ and can be set using config.defaults['nyquist.start_marker']
.
Start marker size (in display coordinates). Default value is 4 and can be set using config.defaults['nyquist.start_marker_size']
.
Set the title of the plot. Defaults to plot type and system name(s).
Set the frame of reference used to center the plot title. If set to ‘axes’ (default), the horizontal position of the title will centered relative to the axes. If set to ‘figure’, it will be centered with respect to the figure (faster execution).
If set to False, turn off warnings about frequencies above Nyquist.
If set to False, turn off warnings about number of encirclements not meeting the Nyquist criterion.
Notes
If a discrete-time model is given, the frequency response is computed along the upper branch of the unit circle, using the mapping z = exp(1j * omega * dt)
where omega
ranges from 0 to pi/dt
and dt
is the discrete timebase. If timebase not specified (dt
= True), dt
is set to 1.
If a continuous-time system contains poles on or near the imaginary axis, a small indentation will be used to avoid the pole. The radius of the indentation is given by indent_radius
and it is taken to the right of stable poles and the left of unstable poles. If a pole is exactly on the imaginary axis, the indent_direction
parameter can be used to set the direction of indentation. Setting indent_direction
to ‘none’ will turn off indentation. If return_contour
is True, the exact contour used for evaluation is returned.
For those portions of the Nyquist plot in which the contour is indented to avoid poles, resulting in a scaling of the Nyquist plot, the line styles are according to the settings of the primary_style
and mirror_style
keywords. By default the scaled portions of the primary curve use a dashdot line style and the scaled portions of the mirror image use a dotted line style.
Examples
>>> G = ct.zpk([], [-1, -2, -3], gain=100) >>> out = ct.nyquist_plot(G)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4