control.describing_function_plot
- control.describing_function_plot(data, *args, **kwargs)[source]
Plot a Nyquist plot with a describing function for a nonlinear system.
This function generates a Nyquist plot for a closed loop system consisting of a linear system with a static nonlinear function in the feedback path.
The function may be called in one of two forms:
describing_function_plot(response[, options])
describing_function_plot(H, F, A[, omega[, options]])
In the first form, the response should be generated using the
describing_function_response()
function. In the second form, that function is called internally, with the listed arguments.- Parameters
data (
DescribingFunctionResponse
) – A describing function response data object created bydescribing_function_response()
.H (LTI system) – Linear time-invariant (LTI) system (state space, transfer function, or FRD)
F (static nonlinear function) – A static nonlinearity, either a scalar function or a single-input, single-output, static input/output system.
A (list) – List of amplitudes to be used for the describing function plot.
omega (list, optional) – List of frequencies to be used for the linear system Nyquist curve. If not specified (or None), frequencies are computed automatically based on the properties of the linear system.
refine (bool, optional) – If True (default), refine the location of the intersection of the Nyquist curve for the linear system and the describing function to determine the intersection point
label (str or array_like of str, optional) – If present, replace automatically generated label with the given label.
point_label (str, optional) – Formatting string used to label intersection points on the Nyquist plot. Defaults to “%5.2g @ %-5.2g”. Set to None to omit labels.
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.
title (str, optional) – Set the title of the plot. Defaults to plot type and system name(s).
warn_nyquist (bool, optional) – Set to True to turn on warnings generated by nyquist_plot or False to turn off warnings. If not set (or set to None), warnings are turned off if omega is specified, otherwise they are turned on.
**kwargs (
matplotlib.pyplot.plot()
keyword properties, optional) – Additional keywords passed to matplotlib to specify line properties for Nyquist curve.
- Returns
cplt –
Object containing the data that were plotted:
cplt.lines: Array of
matplotlib.lines.Line2D
objects for each line in the plot. The first element of the array is a list of lines (typically only one) for the Nyquist plot of the linear I/O system. The second element of the array is a list of lines (typically only one) for the describing function curve.cplt.axes: 2D array of
matplotlib.axes.Axes
for the plot.cplt.figure:
matplotlib.figure.Figure
containing the plot.
See
ControlPlot
for more detailed information.- Return type
ControlPlot
object
Examples
>>> H_simple = ct.tf([8], [1, 2, 2, 1]) >>> F_saturation = ct.saturation_nonlinearity(1) >>> amp = np.linspace(1, 4, 10) >>> lines = ct.describing_function_plot(H_simple, F_saturation, amp)