nyquist [control]
— Function File: [realp, imagp, w] = nyquist (sys, w, out_idx, in_idx, atol)
— Function File: nyquist (sys, w, out_idx, in_idx, atol)

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)

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)
  1. 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.
  2. if sys is discrete time, the frequency range is limited to jwT in [0,2p*pi]
  3. 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.
Outputs
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.