Professional Documents
Culture Documents
Help Center: Skip To Content
Help Center: Skip To Content
Products
Solutions
Academia
Support
Community
Events
Get MATLAB
Sign In to Your MathWorks Account
Help Center
Search Help Center
Help Center
nyquist
ON THIS PAGE
Syntax
Description
Examples
o Nyquist Plot of Dynamic System
o Nyquist Plot at Specified Frequencies
o Nyquist Plot of Several Dynamic Systems
o Nyquist Plot with Specified Line Attributes
o Obtain Real and Imaginary Parts of Frequency Response
o Nyquist Plot of MIMO System
o Create Nyquist Plot of Identified Model With Response Uncertainty
o Nyquist Plot of Model with Complex Coefficients
Input Arguments
Output Arguments
Tips
See Also
Documentation
Examples
Functions
Blocks
Apps
Videos
Answers
Trial Software
Product
Updates
nyquist
Nyquist plot of frequency response
collapse all in page
Syntax
nyquist(sys)
nyquist(sys1,sys2,...,sysN)
nyquist(sys1,LineSpec1,...,sysN,LineSpecN)
nyquist(___,w)
[re,im,wout] = nyquist(sys)
[re,im,wout] = nyquist(sys,w)
[re,im,wout,sdre,sdim] = nyquist(sys,w)
Description
example
Because H is a SISO model, the first two dimensions of re and im are both 1. The third
dimension is the number of frequencies in wout.
size(re)
ans = 1×3
1 1 141
length(wout)
ans = 141
Thus, each entry along the third dimension of re gives the real part of the response at the
corresponding frequency in wout.
Nyquist Plot of MIMO System
Try This ExampleCopy Command Copy Code
For this example, create a 2-output, 3-input system.
rng(0,'twister');
H = rss(4,2,3);
For this system, nyquist plots the frequency responses of each I/O channel in a separate
plot in a single figure.
nyquist(H)
Compute the real and imaginary parts of these responses at 20 frequencies between 1 and
10 radians.
w = logspace(0,1,20);
[re,im] = nyquist(H,w);
re and im are three-dimensional arrays, in which the first two dimensions correspond to the
output and input dimensions of H, and the third dimension is the number of frequencies. For
instance, examine the dimensions of re.
size(re)
ans = 1×3
2 3 20
Thus, for example, re(1,3,10) is the real part of the response from the third input to the first
output, computed at the 10th frequency in w. Similarly, im(1,3,10) contains the imaginary
part of the same response.
Create Nyquist Plot of Identified Model With Response Uncertainty
This example uses:
Identify a transfer function model using the data. Using the tfest command requires System
Identification Toolbox™ software.
sys_p = tfest(z2,2);
Obtain the standard deviations for the real and imaginary parts of the frequency response
for a set of 512 frequencies, w.
w = linspace(-10*pi,10*pi,512);
[re,im,wout,sdre,sdim] = nyquist(sys_p,w);
re and im are the real and imaginary parts of the frequency response, and sdre and sdim are
their standard deviations, respectively. The frequencies in wout are the same as the
frequencies you specified in w.
Use the standard deviation data to create a 3σ plot corresponding to the confidence region.
re = squeeze(re);
im = squeeze(im);
sdre = squeeze(sdre);
sdim = squeeze(sdim);
plot(re,im,'b',re+3*sdre,im+3*sdim,'k:',re-3*sdre,im-3*sdim,'k:')
xlabel('Real Axis');
ylabel('Imaginary Axis');
Nyquist Plot of Model with Complex Coefficients
Try This ExampleCopy Command Copy Code
Create a Nyquist plot of a model with complex coefficients and a model with real coefficients
on the same plot.
rng(0)
A = [-3.50,-1.25-0.25i;2,0];
B = [1;0];
C = [-0.75-0.5i,0.625-0.125i];
D = 0.5;
Gc = ss(A,B,C,D);
Gr = rss(4);
nyquist(Gc,Gr)
legend('Complex-coefficient model','Real-coefficient model')
The Nyquist plot always shows two branches, one for positive frequencies and one for
negative frequencies. The arrows indicate the direction of increasing frequency for each
branch. For models with complex coefficients, the two branches are not symmetric. For
models with real coefficients, the negative branch is obtained by symmetry.
Input Arguments
collapse all
sys — Dynamic system
dynamic system model | model array
Dynamic system, specified as a SISO or MIMO dynamic system model or array of dynamic
system models. Dynamic systems that you can use include:
Continuous-time or discrete-time numeric LTI models,
such as tf, zpk, or ss models.
Generalized or uncertain LTI models such
as genss or uss (Robust Control Toolbox) models.
(Using uncertain models requires Robust Control
Toolbox™ software.)
o For tunable control design blocks, the function
evaluates the model at its current value for both
plotting and returning frequency response data.
o For uncertain control design blocks, the function plots
the nominal value and random samples of the model.
When you use output arguments, the function returns
frequency response data for the nominal model only.
Frequency-response data models such as frd models.
For such models, the function plots the response at
frequencies defined in the model.
Identified LTI models, such as idtf (System
Identification Toolbox), idss (System Identification
Toolbox), or idproc (System Identification
Toolbox) models. For such models, the function can
also plot confidence intervals and return standard
deviations of the frequency response. See Create
Nyquist Plot of Identified Model With Response
Uncertainty. (Using identified models requires System
Identification Toolbox™ software.)
If sys is an array of models, the function plots the frequency responses of all models in the
array on the same axes.
LineSpec — Line style, marker, and color
character vector | string
Line style, marker, and color, specified as a string or vector of one, two, or three characters.
The characters can appear in any order. You do not need to specify all three characteristics
(line style, marker, and color). For example, if you omit the line style and specify the marker,
then the plot shows only the marker and no line. For more information about configuring this
argument, see the LineSpec input argument of the plot function.
Example: 'r--' specifies a red dashed line
Example: '*b' specifies blue asterisk markers
Example: 'y' specifies a yellow line
w — Frequencies
{wmin,wmax} | vector
Frequencies at which to compute and plot frequency response, specified as the cell
array {wmin,wmax} or as a vector of frequency values.
If w is a cell array of the form {wmin,wmax}, then the
function computes the response at frequencies
ranging between wmin and wmax.
If w is a vector of frequencies, then the function
computes the response at each specified frequency.
For example, use logspace to generate a row vector
with logarithmically spaced frequency values. The
vector w can contain both positive and negative
frequencies.
If you specify a frequency range of [w ,w ] for your plot, then the plot shows a contour
min max
Topics
Frequency-Domain Responses
Dynamic System Models
Introduced before R2006a
MathWorks
Accelerating the pace of engineering and science
MathWorks is the leading developer of mathematical computing software for engineers and
scientists.
Discover...
Explore Products
MATLAB
Simulink
Student Software
Hardware Support
File Exchange
Try or Buy
Downloads
Trial Software
Contact Sales
Pricing and Licensing
How to Buy
Learn to Use
Documentation
Tutorials
Examples
Videos and Webinars
Training
Get Support
Installation Help
Answers
Consulting
License Center
Contact Support
About MathWorks
Careers
Newsroom
Social Mission
Contact Sales
About MathWorks
United States
Trust Center
Trademarks
Privacy Policy
Preventing Piracy
Application Status
© 1994-2021 The MathWorks, Inc.
Join the conversation