Nyquist plot of frequency response (2024)

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

nyquist(sys) creates a Nyquist plot of the frequency response of a dynamic system model sys. The plot displays real and imaginary parts of the system response as a function of frequency.

nyquist plots a contour comprised of both positive and negative frequencies. The plot also shows arrows to indicate the direction of increasing frequency for each branch. nyquist automatically determines frequencies to plot based on system dynamics.

If sys is a multi-input, multi-output (MIMO) model, then nyquist produces an array of Nyquist plots, each plot showing the frequency response of one I/O pair.

If sys is a model with complex coefficients, then the positive and negative branches are not symmetric.

example

nyquist(sys1,sys2,...,sysN) plots the frequency response of multiple dynamic systems on the same plot. All systems must have the same number of inputs and outputs.

example

nyquist(sys1,LineSpec1,...,sysN,LineSpecN) specifies a color, line style, and marker for each system in the plot.

example

nyquist(___,w) plots system responses for frequencies specified by w.

  • If w is a cell array of the form {wmin,wmax}, then nyquist plots the response at frequencies ranging between wmin and wmax.

  • If w is a vector of frequencies, then nyquist plots the response at each specified frequency. The vector w can contain both negative and positive frequencies.

You can use w with any of the input-argument combinations in previous syntaxes.

example

[re,im,wout] = nyquist(sys) returns the real and imaginary parts of the frequency response at each frequency in the vector wout. The function automatically determines frequencies in wout based on system dynamics. This syntax does not draw a plot.

example

[re,im,wout]= nyquist(sys,w) returns the response data at the frequencies specified by w.

  • If w is a cell array of the form {wmin,wmax}, then wout contains frequencies ranging between wmin and wmax.

  • If w is a vector of frequencies, then wout = w.

example

[re,im,wout,sdre,sdim]= nyquist(sys,w) also returns the estimated standard deviation of the real and imaginary parts of the frequency response for the identified model sys. If you omit w, then the function automatically determines frequencies in wout based on system dynamics.

Examples

collapse all

Nyquist Plot of Dynamic System

Open Live Script

Create the following transfer function and plot its Nyquist response.

H(s)=2s2+5s+1s2+2s+3.

H = tf([2 5 1],[1 2 3]);nyquist(H)

Nyquist plot of frequency response (1)

The nyquist function can display a grid of M-circles, which are the contours of constant closed-loop magnitude. M-circles are defined as the locus of complex numbers where the following quantity is a constant value across frequency.

T(jω)=|G(jω)1+G(jω)|.

Here, ω is the frequency in radians/TimeUnit, where TimeUnit is the system time units, and G is the collection of complex numbers that satisfy the constant magnitude requirement.

To display the grid of M-circles, right-click in the plot and select Grid. Alternatively, use the grid command.

grid on

Nyquist plot of frequency response (2)

Nyquist Plot at Specified Frequencies

Open Live Script

Create a Nyquist plot over a specified frequency range. Use this approach when you want to focus on the dynamics in a particular range of frequencies.

H = tf([-0.1,-2.4,-181,-1950],[1,3.3,990,2600]);nyquist(H,{1,100})

Nyquist plot of frequency response (3)

The cell array {1,100} specifies a frequency range [1,100] for the positive frequency branch and [–100,–1] for the negative frequency branch in the Nyquist plot. The negative frequency branch is obtained by symmetry for models with real coefficients. When you provide frequency bounds in this way, the function selects intermediate points for frequency response data.

Alternatively, specify a vector of frequency points to use for evaluating and plotting the frequency response.

w = 1:0.1:30;nyquist(H,w,'.-')

Nyquist plot of frequency response (4)

nyquist plots the frequency response at the specified frequencies.

Nyquist Plot of Several Dynamic Systems

Open Live Script

Compare the frequency response of several systems on the same Nyquist plot.

Create the dynamic systems.

rng(0)sys1 = tf(3,[1,2,1]);sys2 = tf([2 5 1],[1 2 3]);sys3 = rss(4);

Create a Nyquist plot that displays all systems.

nyquist(sys1,sys2,sys3)legend('Location','southwest')

Nyquist plot of frequency response (5)

Nyquist Plot with Specified Line Attributes

Open Live Script

Specify the line style, color, or marker for each system in a Nyquist plot using the LineSpec input argument.

sys1 = tf(3,[1,2,1]);sys2 = tf([2 5 1],[1 2 3]);nyquist(sys1,'o:',sys2,'g')

Nyquist plot of frequency response (6)

The first LineSpec, 'o:', specifies a dotted line with circle markers for the response of sys1. The second LineSpec, 'g', specifies a solid green line for the response of sys2.

Obtain Real and Imaginary Parts of Frequency Response

Open Live Script

Compute the real and imaginary parts of the frequency response of a SISO system.

If you do not specify frequencies, nyquist chooses frequencies based on the system dynamics and returns them in the third output argument.

H = tf([2 5 1],[1 2 3]);[re,im,wout] = nyquist(H);

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

Open Live Script

For this example, create a 2-output, 3-input system.

For this system, nyquist plots the frequency responses of each I/O channel in a separate plot in a single figure.

nyquist(H)

Nyquist plot of frequency response (7)

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:

  • System Identification ToolboxSystem Identification Toolbox

Open Live Script

Compute the standard deviations of the real and imaginary parts of the frequency response of an identified model. Use this data to create a 3σ plot of the response uncertainty.

Load the estimation data z2.

load iddata2 z2;

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 frequency response (8)

Nyquist Plot of Model with Complex Coefficients

Open Live Script

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')

Nyquist plot of frequency response (9)

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

sysDynamic 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.)

    • For tunable control design blocks, the function evaluates the model at its current value for both plotting and returning frequency response data.

    • 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.

wFrequencies
{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 [wmin,wmax] for your plot, then the plot shows a contour comprised of both positive frequencies [wmin,wmax] and negative frequencies [–wmax,–wmin].

Specify frequencies in units of rad/TimeUnit, where TimeUnit is the TimeUnit property of the model.

Output Arguments

collapse all

re — Real part of system response
3-D array

Real part of the system response, returned as a 3-D array. The dimensions of this array are (number of system outputs)-by-(number of system inputs)-by-(number of frequency points).

  • For SISO systems, re(1,1,k) gives the real part of the response at the kth frequency in w or wout. For an example, see Obtain Real and Imaginary Parts of Frequency Response.

  • For MIMO systems, re(i,j,k) gives the real part of the response at the kth frequency from the jth input to the ith output. For an example, see Nyquist Plot of MIMO System.

im — Imaginary part of system response
3-D array

Imaginary part of the system response, returned as a 3-D array. The dimensions of this array are (number of system outputs)-by(number of system inputs)-by-(number of frequency points).

  • For SISO systems, im(1,1,k) gives the imaginary part of the response at the kth frequency in w or wout. For an example, see Obtain Real and Imaginary Parts of Frequency Response.

  • For MIMO systems, im(i,j,k) gives the imaginary part of the response at the kth frequency from the jth input to the ith output. For an example, see Nyquist Plot of MIMO System.

wout — Frequencies
vector

Frequencies at which the function returns the system response, returned as a column vector. The function chooses the frequency values based on the model dynamics, unless you specify frequencies using the input argument w.

wout also contains negative frequency values for models with complex coefficients.

Frequency values are in radians per TimeUnit, where TimeUnit is the value of the TimeUnit property of sys.

sdre — Standard deviation of real part
3-D array | []

Estimated standard deviation of the real part of the response at each frequency point, returned as a 3-D array. sdre has the same dimensions as re.

If sys is not an identified LTI model, sdre is [].

sdim — Standard deviation of imaginary part
3-D array | []

Estimated standard deviation of the imaginary part of the response at each frequency point, returned as a 3-D array. sdim has the same dimensions as im.

If sys is not an identified LTI model, sdim is [].

Tips

  • When you need additional plot customization options, use nyquistplot instead.

  • Two zoom options that apply specifically to Nyquist plots are available from the right-click menu :

    • Full View — Clips unbounded branches of the Nyquist plot, but still includes the critical point (–1, 0).

    • Zoom on (-1,0) — Zooms around the critical point (–1, 0). To access critical-point zoom programmatically, use the zoomcp command. For more information, see nyquistplot.

  • To activate data markers that display the real and imaginary values at a given frequency, click anywhere on the curve. The following figure shows a nyquist plot with a data marker.

    Nyquist plot of frequency response (10)

Version History

Introduced before R2006a

See Also

nichols | sigma | bode | nyquistplot

Topics

  • Frequency-Domain Responses
  • Dynamic System Models

MATLAB 命令

您点击的链接对应于以下 MATLAB 命令:

 

请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。

Nyquist plot of frequency response (11)

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

Americas

Europe

Asia Pacific

Contact your local office

Nyquist plot of frequency response (2024)

FAQs

How to tell if a Nyquist plot is stable? ›

Assuming that the open-loop system transfer function is F(s), the Nyquist plot is a plot of the transfer function of F (jω), with ω from -∞ to +∞. Stability is determined by looking at the number of encirclements of the point at (-1,0j).

What is the frequency of the Nyquist plot? ›

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.

How to solve a Nyquist plot? ›

Rules of Nyquist Plot

Calculate the complex transfer function value by putting s= jω, where 'ω' is angular frequency and 'j' is the imaginary unit. Determine the magnitude and phase of the complex transfer function. Plot the points in the polar coordinate for each frequency point.

Why is the Nyquist plot important? ›

The Nyquist plot (one is shown in the video above) is a very useful tool for determining the stability of a system. It has advantages over the root locus and Routh-Horwitz because it easily handles time delays. However, it is most useful because it gives us a way to use the Bode plot to determine stability.

What is the necessary condition for Nyquist plot? ›

Nyquist Stability Criteria

To determine closed-loop stability, the plot is analyzed for encirclements of the critical point -1+j0. As per the criterion: No encirclement = System is stable. Anticlockwise encirclement = Number of right half plane system poles.

What is the Nyquist criteria for stability? ›

The Nyquist stability criterion is a graphical technique that determines the stability of a dynamical system, such as a feedback control system. It is based on the argument principle and the Nyquist plot of the open-loop transfer function of the system.

What is the minimum Nyquist frequency? ›

The Nyquist criterion states that the sampling frequency should be minimum twice the signal frequency. In this case it should be 50 kHz. A more precise statement is that the sampling frequency should more than twice the bandwidth.

How to read a Nyquist plot? ›

With a Nyquist plot, you can simply observe the distance between (–1, 0) and the point at which the curve crosses the negative real axis. More distance between these two points corresponds to a larger gain margin and, consequently, to a circuit that is more reliably stable.

What is the critical point of the Nyquist plot? ›

In a linear system, the crucial point on the Nyquist diagram is −1. For nonlinear systems the −[1/N(ω, X)] locus corresponds to the critical point −1. To evaluate the stability of the system, both −[1/N(ω, X)] and the G(jω) function are plotted on the polar plane.

What is the Nyquist for dummies? ›

Nyquist-Shannon Sampling Theorem

According to this theorem, in order to accurately reconstruct a continuous signal such as audio, it must be sampled at a rate that is at least twice the highest frequency component of the signal. This threshold is also called the Nyquist frequency.

What are the advantages and disadvantages of Nyquist plots? ›

Advantages of the Nyquist Plot

The plot shows the negative imaginary part of the impedance versus the real part. Compared to the Bode plot it has two disadvantages: It is less intuitive to understand. The frequency information is missing.

What is the formula for the Nyquist plot? ›

s=γ(ω)=iω, where −∞<ω<∞. w=kG∘γ(ω)=kG(iω). That is, the Nyquist plot is the image of the imaginary axis under the map w=kG(s).

How does gain affect Nyquist plot? ›

Gain and phase variations can cause the Nyquist curve to change from the “correct" number of -1 encirclements (stable) to an “incorrect" number of encirclements (unstable). Gain and phase margins measure the distance from the Nyquist curve to the -1 point along two specific directions.

How to find k in Nyquist plot? ›

Let's plot the C4 section of the Nyquist plot. We will find the value of K when the contour passes through the point (-1 + j0). We will find the stability at the two values of K. When the value of K is less than 240, the contour does not cross the real axis, and the point -1 + j0 is not encircled.

How do you know if a circuit is stable or unstable? ›

The poles either real or come in complex conjugate pairs. If the poles are in the left half of the complex plain, the electronic circuit is stale. If the poles are in the right half of the complex plain, then the circuit is unstable . The stable poles will cause the circuit to operate without going into saturation .

What are the conditions for a stable Bode plot? ›

For a Stable System: Both the margins should be positive or phase margin should be greater than the gain margin. 2. For Marginal Stable System: Both the margins should be zero or phase margin should be equal to the gain margin.

How do you tell if a system is stable from a Bode plot? ›

If both the gain margin GM and the phase margin PM are positive, then the control system is stable. If both the gain margin GM and the phase margin PM are equal to zero, then the control system is marginally stable. If the gain margin GM and / or the phase margin PM are/is negative, then the control system is unstable.

How to determine stability from Nyquist plot in Matlab? ›

If we zoom in, we can see that the plot in "L(s)" does not encircle the -1+j0, so the system is stable. The roots are at s=-5.5 and s=-0.24±2.88j so the system is stable, as expected. This can be seen even more clearly using Matlab's "nyquist" command.

References

Top Articles
Latest Posts
Recommended Articles
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5974

Rating: 4.6 / 5 (76 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.