Bode plot for a system.
Plot the magnitude and phase of the frequency response over a (optional) frequency range.
FrequencyResponseData
or LTI
List of LTI systems or FrequencyResponseData
objects. A single system or frequency response can also be passed.
Set of frequencies in rad/sec to plot over. If not specified, this will be determined from the properties of the systems. Ignored if data
is not a list of systems.
matplotlib.pyplot.plot
format string, optional
Passed to matplotlib
as the format string for all lines in the plot. The omega
parameter must be present (use omega=None if needed).
If True, plot result in dB. Default is False.
If True, plot frequency in Hz (omega must be provided in rad/sec). Default value (False) set by config.defaults['freqplot.Hz']
.
If True, plot phase in degrees (else radians). Default value (True) set by config.defaults['freqplot.deg']
.
If True, draw gain and phase margin lines on the magnitude and phase graphs and display the margins at the top of the graph. If set to ‘overlay’, the values for the gain and phase margin are placed on the graph. Setting display_margins
turns off the axes grid, unless grid
is explicitly set to True.
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
objects
Array containing information on each line in the plot. The shape of the array matches the subplots shape and the value of the array is a list of Line2D objects in that subplot.
matplotlib.axes.Axes
Axes for each subplot.
matplotlib.figure.Figure
Figure containing the plot.
matplotlib.legend.Legend
Legend object(s) contained in the plot.
matplotlib.axes.Axes
, optional
The matplotlib axes to draw the figure on. If not specified, the axes for the current figure are used or, if there is no current figure with the correct number and shape of axes, a new figure is created. The shape of the array must match the shape of the plotted data.
Labels to use for the frequency, magnitude, and phase axes. Defaults are set by config.defaults['freqplot.<keyword>']
.
If True, plot grid lines on gain and phase plots. Default is set by config.defaults['freqplot.grid']
.
Set the reference phase to use for the lowest frequency. If set, the initial phase of the Bode plot will be set to the value closest to the value specified. Units are in either degrees or radians, depending on the deg
parameter. Default is -180 if wrap_phase is False, 0 if wrap_phase is True.
If present, replace automatically generated label(s) with the given label(s). If sysdata is a list, strings should be specified for each system. If MIMO, strings required for each system, output, and input.
Location of the legend for multi-axes plots. Specifies an array of legend location strings matching the shape of the subplots, with each entry being either None (for no legend) or a legend location string (see legend
).
Include a legend in the given location. Default is ‘center right’, with no legend for a single response. Use False to suppress legend.
Method to use in computing margins (see stability_margins
).
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
. Ignored if data is not a list of systems.
Number of samples to use for the frequency range. Defaults to config.defaults['freqplot.number_of_samples']
. Ignored if data is not a list of systems.
If set to True, combine input and/or output signals onto a single plot and use line colors, labels, and a legend to distinguish them.
(legacy) If given, bode_plot
returns the legacy return values of magnitude, phase, and frequency. If False, just return the values with no plot.
If set to False, do not plot the magnitude or phase, respectively.
Override the default parameters used for generating plots. Default is set by config.defaults['ctrlplot.rcParams']
.
Determine whether and how axis limits are shared between the indicated variables. Can be set set to ‘row’ to share across all subplots in a row, ‘col’ to set across all subplots in a column, or False to allow independent limits. Note: if sharex
is given, it sets the value of share_frequency
; if sharey
is given, it sets the value of both share_magnitude
and share_phase
. Default values are ‘row’ for share_magnitude
and share_phase
, ‘col’, for share_frequency
, and can be set using config.defaults['freqplot.share_<axis>']
.
Force legend to be shown if True or hidden if False. If None, then show legend when there is more than one line on an axis or legend_loc
or legend_map
has been specified.
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 be centered relative to the axes. If set to ‘figure’, it will be centered with respect to the figure (faster execution). The default value can be set using config.defaults['freqplot.title_frame']
.
If wrap_phase is False (default), then the phase will be unwrapped so that it is continuously increasing or decreasing. If wrap_phase is True the phase will be restricted to the range [-180, 180) (or [, ) radians). If wrap_phase
is specified as a float, the phase will be offset by 360 degrees if it falls below the specified value. Default value is False and can be set using config.defaults['freqplot.wrap_phase']
.
Notes
Starting with python-control version 0.10, bode_plot
returns a ControlPlot
object instead of magnitude, phase, and frequency. To recover the old behavior, call bode_plot
with plot
= True, which will force the legacy values (mag, phase, omega) to be returned (with a warning). To obtain just the frequency response of a system (or list of systems) without plotting, use the frequency_response
command.
If a discrete-time model is given, the frequency response is plotted 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.
The default values for Bode plot configuration parameters can be reset using the config.defaults
dictionary, with module name ‘bode’.
Examples
>>> G = ct.ss([[-1, -2], [3, -4]], [[5], [7]], [[6, 8]], [[9]]) >>> out = ct.bode_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