Next: cacsd, Previous: systime, Up: Control Theory
If no output arguments are given: produce Bode plots of a system; otherwise, compute the frequency response of a system data structure
Inputs
Outputs
- sys
- a system data structure (must be either purely continuous or discrete; see is_digital)
- w
- frequency values for evaluation.
if sys is continuous, then bode evaluates G(jw) where G(s) is the system transfer function.
if sys is discrete, then bode evaluates G(
exp
(jwT)), where
- T is the system sampling time
- G(z) is the system transfer function.
Default the default frequency range is selected as follows: (These steps are not performed if w is specified)
- via routine __bodquist__, isolate all poles and zeros away from w=0 (jw=0 or
exp
(jwT)=1) and select the frequency range based on the breakpoint locations of the frequencies.- if sys is discrete time, the frequency range is limited to jwT in [0,2 pi /T]
- A "smoothing" routine is used to ensure that the plot phase does not change excessively from point to point and that singular points (e.g., crossovers from +/- 180) are accurately shown.
- out_idx
- in_idx
- The names or indices of outputs and inputs to be used in the frequency response. See
sysprune
.Example
bode(sys,[],"y_3", {"u_1","u_4"});
- mag
- phase
- the magnitude and phase of the frequency response G(jw) or G(
exp
(jwT)) at the selected frequency values.- w
- the vector of frequency values used
- If no output arguments are given, e.g.,
bode(sys);bode plots the results to the screen. Descriptive labels are automatically placed.
Failure to include a concluding semicolon will yield some garbage being printed to the screen (
ans = []
).- If the requested plot is for an MIMO system, mag is set to ||G(jw)|| or ||G(
exp
(jwT))|| and phase information is not computed.
Get default range of frequencies based on cutoff frequencies of system poles and zeros. Frequency range is the interval [10^wmin, 10^wmax]
Used internally in __freqresp__ (bode, nyquist)
Used by __freqresp__ to check that input frequency vector w is valid. Returns boolean value.
Linear time invariant frequency response of single-input systems.
Inputs
Output
- a
- b
- coefficient matrices of dx/dt = A x + B u
- sys
- system data structure
- w
- vector of frequencies
- out
- frequency response, that is:
-1 G(s) = (jw I-A) Bfor complex frequencies s = jw.
Produce Nyquist plots of a system; if no output arguments are given, Nyquist plot is printed to the screen.
Compute the frequency response of a system.
Inputs (pass as empty to get default values)
Outputs
- sys
- system data structure (must be either purely continuous or discrete; see
is_digital
)- w
- frequency values for evaluation. If sys is continuous, then bode evaluates G(jw); if sys is discrete, then bode evaluates G(exp(jwT)), where T is the system sampling time.
- default
- the default frequency range is selected as follows: (These steps are not performed if w is specified)
- via routine __bodquist__, isolate all poles and zeros away from w=0 (jw=0 or exp(jwT)=1) and select the frequency range based on the breakpoint locations of the frequencies.
- if sys is discrete time, the frequency range is limited to jwT in [0,2p*pi]
- A “smoothing” routine is used to ensure that the plot phase does not change excessively from point to point and that singular points (e.g., crossovers from +/- 180) are accurately shown.
- atol
- for interactive nyquist plots: atol is a change-in-slope tolerance for the of asymptotes (default = 0; 1e-2 is a good choice). This allows the user to “zoom in” on portions of the Nyquist plot too small to be seen with large asymptotes.
- realp
- imagp
- the real and imaginary parts of the frequency response G(jw) or G(exp(jwT)) at the selected frequency values.
- w
- the vector of frequency values used
If no output arguments are given, nyquist plots the results to the screen. If atol != 0 and asymptotes are detected then the user is asked interactively if they wish to zoom in (remove asymptotes) Descriptive labels are automatically placed.
Note: if the requested plot is for an MIMO system, a warning message is presented; the returned information is of the magnitude ||G(jw)|| or ||G(exp(jwT))|| only; phase information is not computed.
Compute transmission zeros of a continuous system:
. x = Ax + Bu y = Cx + Duor of a discrete one:
x(k+1) = A x(k) + B u(k) y(k) = C x(k) + D u(k)Outputs
References
- zer
- transmission zeros of the system
- gain
- leading coefficient (pole-zero form) of SISO transfer function returns gain=0 if system is multivariable
- Emami-Naeini and Van Dooren, Automatica, 1982.
- Hodel, Computation of Zeros with Balancing, 1992 Lin. Alg. Appl.