System Identification Toolbox    
nyquist

Plot Nyquist curve of frequency function.

Syntax

Description

nyquist computes the complex-valued frequency response of idmodel and idfrd models. When invoked without left-hand arguments, nyquist produces a Nyquist plot on the screen, that is, a graph of the frequency response's imaginary part against its real part.

The argument m is an arbitrary idmodel or idfrd model. This model can be continuous or discrete, and SISO or MIMO. The InputNames and OuputNames of the models are used to plot the responses for different I/O channels in separate plots. Pressing the Enter key advances the plot from one input-output pair to the next one. Specific I/O channels can be selected by the normal subreferencing: m(ky,ku). With mode = 'same' all plots are given in the same diagram.

nyquist(m,w) explicitly specifies the frequency range or frequency points to be used for the plot. To focus on a particular frequency interval [wmin,wmax], set w = {wmin,wmax}. (Notice the curly brackets.) To use particular frequency points, set w to the vector of desired frequencies. Use logspace to generate logarithmically spaced frequency vectors. All frequencies should be specified in radians/sec.

nyquist(m1,m2,...,mN) or nyquist(m1,m2,...mN,w) plots the Bode responses of several idmodels or idfrd models on a single figure. The models may be mixes of different sizes and continuous/discrete. The sorting of the plots is made based on the InputNames and OutputNames.

nyquist(m1,'PlotStyle1',...,mN,'PlotStyleN') further specifies which color, linestyle, and/or marker should be used to plot each system, as in

When sd is specified as a number larger than zero, confidence regions will also be plotted. These are ellipses in the complex plane and correspond to the region where the true response at the frequency in question is to be found with a confidence, corresponding to sd standard deviations (of the Gaussian distribution).

If the argument indicating standard deviations is given as in `sd+5', a confidence region is plotted for every 5:th frequency, marking the center point by `+'. The default is `sd+10'.

Note that the frequencies cannot be specified for idfrd objects. For those, the plot and response are calculated for the internally stored frequencies. If the frequencies w are specified when several models are treated, they will apply to all non-idfrd models in the list. If you want different frequencies for different models, you should thus first convert them to idfrd objects using the idfrd command.

For time-series models (no input channels) the Nyquist plot is not defined.

Arguments

When nyquist is called with a single system and output arguments

fr = nyquist(m,w) or [fr,w,covfr] = nyquist(m)

no plot is drawn on the screen. If m has ny outputs and nu inputs, and w contains nw frequencies, then fr is an ny-by-nu-by-Nw array such that fr(ky,ku,k) gives the complex-valued frequency response from input ku to output ky at the frequency w(k). For a SISO model, use fr(:) to obtain a vector of the frequency response. The uncertainty information covfr is a 5-D array where covfr(ky,ku,k,:,:)) is the 2-by-2 covariance matrix of the response from input ku to output ky at frequency w(k). The 1,1 element is the variance of the real part, the 2,2 element the variance of the imaginary part and the 1,2 and 2,1 elements the covariance between the real and imaginary parts.

squeeze(covfr(ky,ku,k,:,:)) gives the covariance matrix of the corresponding response.

If m is a time series (no input), fr is returned as the (power) spectrum of the outputs; an ny-by-ny-by-Nw array. Hence fr(:,:,k) is the spectrum matrix at frequency w(k). The element fr(k1,k2,k) is the cross spectrum between outputs k1 and k2 at frequency w(k). When k1=k2, this is the real-valued power spectrum of output k1. covfr is then the covariance of the spectrum fr, so that covfr(k1,k1,k) is the variance of the power spectrum of output k1 at frequency w(k). No information about the variance of the cross spectra is normally given. (That is, covfr(k1,k2,k) = 0 for k1 not equal to k2.)

If the model m is not a time series, use fr = nyquist(m('n')) to obtain the spectrum information of the noise (output disturbance) signals.

Examples

See Also

bode, etfe, ffplot, idfrd, spa


  nuderst n4sid