Nyquist Stability Criterion - Examples and MATLAB Coding (2024)

Nyquist Stability Criterion – MATLAB Code with Examples

Table of Contents

The Nyquist criterion is widely used inelectronicsandcontrol system engineering, as well as other fields, for designing and analyzing systems withfeedback. While Nyquist is one of the most general stability tests, it is still restricted tolinear,time-invariant(LTI) systems.

The most common use of Nyquist plots is for assessing the stability of a system withfeedback. InCartesian coordinates, the real part of thetransfer function is plotted on the X-axis. The imaginary part is plotted on the Y-axis. The frequency is swept as a parameter, resulting in a plot per frequency.

Nyquist Stability Criterion can be expressed as

Z = N+P

Where: Z= number of roots of 1+G(s)H(s) in the right-hand side (RHS) of s-plane (It is also called zeros of characteristics equation)

N=number of encirclement of critical point 1+j0 in a clockwise direction

P=number of poles of open loop transfer function (OLTF) [i.e. G(s)H(s)] in RHS of s-plane.

Above condition (i.e. Z=N+P) is valid for all systems whether stable or unstable.

Now we will explain this criterion with the following examples:

Example 1:

Consider an open loop transfer function (OLTF) as:We will call it system-1 in the subsequent discussion. It is a stable system or unstable? Perhaps few of you will say that it is an unstable system because one pole is at +3, but it should be noted that stability depends on the denominator of a closed-loop transfer function;If any one of the roots of the denominator of a closed-loop transfer function (also called roots of characteristics equation; or say poles of closed-loop transfer function) is at RHS of s-plane then the system is unstable. So in above case pole at +3 will try to bring the system towards instability, but it is not necessary that the system is unstable. First, we will analyze that this system is stable or not, then we will discuss the Nyquist Stability Criterion.

  • The complete control system mentioned in this example is shown in Figure-1 [assuming that it is a unity feedback control system; i.e. H(s)=1].

Against unit step input its time response is shown in Figure-2.

From Figure-2, it can be easily understood that the system is stable.

  • Characteristics equation of a control system is given as:

1+G(s)H(s)=0,

So, in this system characteristics equation is

or,

s3+ 15s2+ 26s+10 = 0

Its roots are: -13.0691, -1.3740, -0.5569; as all the roots are in left-hand side (LHS) of s-plane hence the system is stable.

  • From Routh Hurwitz criterion also, its stability can be verified.

From Figure-2, it can be seen that the system has no oscillations. The reason is, it is an overdamped system. Pole at ‘-13.0691’ can be ignored (poles far away from the imaginary axis have less influence while poles near to the imaginary axis have more influence; hence poles near to the imaginary axis are also called dominant poles); so remaining system is second order control system and now two remaining roots are different and have no imaginary part hence system is overdamped. To understand overdamped system refer article Time Response of Second-order Transfer Function and Stability analysis (or, you can understand it like this also, ignore two poles -13.0691, -1.3740, consider only one pole -0.5569, as it is the dominant pole. Now it is the first order control system or say first order transfer function. Time response shown in Figure-2 is very similar to the response of first-order transfer function against step input.)

In the article Time Response of Second order Transfer Function and Stability analysis, it is shown that Gain margin (GM) & Phase margin (PM) indicates about the stability of the system.

If Gain margin (GM) & Phase margin (PM) is positive then the system is stable, if negative than the system is unstable and if both are zero then the system is marginally stable. Higher the GM & PM, more the system is stable.

But note that the above statement is true if not a single pole of the open loop transfer function is in RHS of s-plane. In the system-1 one pole is at ‘+3’, i.e. one pole of the open loop transfer function is at RHS of s-plane; in such type of systems Nyquist plot and Nyquist Stability Criterion is a very useful tool for the analysis of a system.

Nyquist plot of system-1 is as follows:

From the OLTF, you can understand, P=1, (one pole of the OLTF is at RHS of s-plane)

N=-1, N is the number of encirclement of critical point 1+j0 in a clockwise direction, in Figure-3, a critical point is encircled once in an anti-clockwise direction.

As Z=N+P, hence Z=0;

i.e. number of roots of characteristics equation in RHS of s-plane is zero, therefore, the system is stable.

(if the value of Z is other than zero then the system will be unstable. Z cannot be negative).

Example 2:

Now take another example:

We will call it system-2.

The Nyquist plot of system-2 is as shown in Figure-4.

So, from the Nyquist plot, it can be viewed that N=0. (No encirclement of critical point by Nyquist plot)

In this example also P=1. (one pole of OLTF is at RHS; i.e. one pole is at +3)

So, Z=N+P=1; therefore one pole of a closed-loop transfer function is at RHS of s-plane, hence the system is unstable.

(You can find roots of characteristics equation. It will be -11.7862, -5.4096, 2.1958; you can understand because of 2.1958, the system is unstable).

Example 3:

Now take another example: Here again P=1.

The nyquist plot is as follows (Figure-5):

You can see N=1. (Encirclement of the critical point is once in a clockwise direction).

Z=N+P=2, therefore two roots of characteristics equation is in RHS of complex plane (s-plane)

(Roots of characteristics equation are -16.2724, 0.6362 ±j 6.8044; i.e. Z=2; two poles 0.6362 ±j 6.8044 are at RHS of s-plane).

So, you can understand, condition Z=N+P is valid for all the systems.

Example 4:

Now Consider

If you will draw its Nyquist plot, it will pass through a critical point (1+j0). In this case, the system is marginally stable. You can understand ‘N’ is undefined in this case (In the present case two roots of characteristics equation will be at origin and one root on Left Hand Side of s-plane. Therefore the system will be marginally stable).

Summary of Systems 1-4:

In all the above examples you can see that denominator is same, but the numerator is different, or say numerator is variable. So, Keep ‘K’ in the numerator instead of a fixed value; hence consider the following open loop transfer function:

If you will apply the Routh Hurwitz criterion to characteristics equation 1+G(s)H(s), then you will find the range of ‘K’ as 240<K<630

So, now you can understand why systems in examples 14 are stable, unstable or marginally stable.

You can draw the root locus of the above transfer function, it will be as shown in Figure-6

(It can be seen that branches of Root locus plot are starting from 3, -8, -10, where K=0. So you can see for K<240, two poles of closed-loop transfer function will be at LHS of s-plane, but one pole will be at RHS of s-plane, hence for K<240 system is unstable.

As the system is stable for 240<K<630, so, If you will decide K=250, then it will be system-1 (example-1), in this case, all the poles of the closed loop transfer function are real and in the LHS of s-plane and the system is stable. If you will decide K=1000, then it will be system-3 (example-3), then two poles of the closed loop transfer function are complex and one pole is real; but the system will be unstable. For Further understanding you can refer Root Locus articles)

It is the Nyquist criterion article, but root locus plot is inserted for better understanding. In examples 1-4, the only difference in open loop transfer function is that numerator is variable, so we have written ‘K’ instead of a fixed value and root locus is drawn. You can understand by the movement of ‘K’, what will be the effect on poles of a closed-loop transfer function.

Now we will take up a few more examples:

Example 5:

Consider

Its Nyquist Plot is as follows:

As per the transfer function P=0 (no pole of OLTF on RHS)

As per the Nyquist plot N=0 (No encirclement of critical point by Nyquist plot).

Hence Z=N+P=0; implies that no pole of a closed-loop transfer function is in RHS of s-plane, hence the system is stable.

Example 6:

Consider

Its Nyquist Plot is as follows:

As per the transfer function P=2 (two poles of OLTF on RHS)

As per the Nyquist plot N=2

Hence Z=N+P=0; implies that no poles of the closed-loop transfer function in RHS of s-plane, hence the system is stable.

  • Please note that in this article, formula Z=N+P is used, where N=number of encirclement of critical point 1+j0 in a clockwise direction. In a few books, you may find the formula Z=N+P, where N=number of encirclement of critical point 1+j0 in a counter-clockwise direction. Both are correct.

MATLAB Coding:

We are writing here MATLAB coding also, so that readers can generate Nyquist Plot and verify all the results.

MATLAB coding to generate a Nyquist plot is as follows:

s=tf(‘s’)

G1=250/ ((s-3)(s+8)(s+10))

nyquist(G1)

% above command will generate Nyquist plot of example-1

% G1 is a variable, you can type sys1, system1, etc. instead of G1

G2=100/ ((s-3)(s+8)(s+10))

nyquist(G2)

% above command will generate Nyquist plot of example -2

Similarly, Nyquist plots of all the systems can be generated.

Through the command: s=tf(‘s’), letter ‘s’ is treated as operator ‘s’ of Laplace function. No need to give this command every time. Once you will shut down the MATLAB and reopens it, then only you have to execute this command.

Nyquist Stability Criterion - Examples and MATLAB Coding (18)

About the Author

Dr. Vipin Jain obtained degree of Bachelor of Engineering in 1992 from Nagpur University, Master of Technology in 2007, Ph.D. Degree in 2017 from University of Delhi. He has long teaching and industrial experience. He is a faculty member in the Electrical Engineering Department, Bharat Institute of Technology, Meerut (UP), India, since December 2007. More than twenty research papers have been published by him so far. He is energy auditor certified by Bureau of Energy Efficiency, Government of India.

Related Posts:

Tags

Nyquist Stability Criterion nyquist theorem

Nyquist Stability Criterion - Examples and MATLAB Coding (2024)

FAQs

How to make Nyquist in Matlab? ›

To create Nyquist plots with default options or to extract the standard deviation, real and imaginary parts of the frequency response data, use nyquist . h = nyquistplot( sys ) plots the Nyquist plot of the dynamic system model sys and returns the plot handle h to the plot.

How to tell if a Nyquist plot is stable in Matlab? ›

A stable system. Let us draw the Nyquist plot: If we zoom in, we can see that the plot in "L(s)" does not encircle the -1+j0, so the system is stable.

How to find Nyquist rate in Matlab? ›

[ re , im , wout ] = nyquist( sys , w ) returns the response data at the frequencies specified by w .
  1. If w is a cell array of the form {wmin,wmax} , then wout contains frequencies ranging between wmin and wmax .
  2. If w is a vector of frequencies, then wout = w .

What is the formula of Nyquist's criterion? ›

According to Nyquist theory Z=N+P (for any system, whether it is stable or unstable). For the stable system, Z=0, i.e. No roots of characteristics equation should be at RHS. So for the stable system N = –P.

How do you set sampling rate in MATLAB? ›

To change the sample rate from 44.1 to 48 kHz, you have to determine a rational number (ratio of integers), P/Q , such that P/Q times the original sample rate, 44100, is equal to 48000 within some specified tolerance. To determine these factors, use rat .

How to draw a Nyquist plot? ›

Rules for Drawing Nyquist Plots
  1. Locate the poles and zeros of open loop transfer function G(s)H(s) in 's' plane.
  2. Draw the polar plot by varying ω from zero to infinity. ...
  3. Draw the mirror image of above polar plot for values of ω ranging from −∞ to zero (0 if any pole or zero present at s=0).

How to check stability using Matlab? ›

The stability of the model can be evaluated by checking the Eigenvalues of the system. You can either do that mathematically or use the command “eig” in Matlab. The Controllability of the state space model depends on the rank of the controllability matrix of your state space system.

How do you test for Nyquist stability? ›

Stability is determined by looking at the number of encirclements of the point (−1, 0). The range of gains over which the system will be stable can be determined by looking at crossings of the real axis. The Nyquist plot can provide some information about the shape of the transfer function.

How to calculate a Nyquist diagram? ›

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.

How do you use Nyquist formula? ›

C(bps) = 2B * log2M (Nyquist)

C is the capacity in bits per second, B is the frequency bandwidth in Hertz, and M is the number of levels a single symbol can take on. This "idealized" capacity equation shows us that data rate is proportional to twice the bandwidth and logarithmically proportional to M.

What is the formula for the Nyquist rate? ›

The Nyquist rate is 2x the given frequency to be measured accurately. The theorem can be used in reverse. The Nyquist frequency is the highest frequency that equipment of a given sample rate can reliably measure, one-half the given sample rate. The Nyquist theorem is an important part of information theory.

How do you find Nyquist? ›

That means when the sampling rate becomes exactly equal to 2fm samples per second then is called as Nyquist sampling rate. For a bandwidth of span C, the Nyquist frequency is just 2C. The significance of the Nyquist rate is that it helps to avoid the aliasing problem which is the overlapping of two signals.

What does the Nyquist criterion tell us? ›

The Nyquist criterion states that a repetitive waveform can be correctly reconstructed provided that the sampling frequency is greater than double the highest frequency to be sampled.

What is the main rule of Nyquist's theorem? ›

The Nyquist theorem states that an analog signal can be digitized without aliasing error if and only if the sampling rate is greater than or equal to twice the highest frequency component in a given signal.

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.

How do you make Nyquist? ›

Drawing Process: To draw a Nyquist plot, one must determine system poles on the jω axis, select a suitable contour, and map each segment to visualize the system's response. Encirclement Rule: The stability of the system is determined by the direction and number of encirclements around the critical point.

How do you make a beep in MATLAB? ›

beep produces your computer's default beep sound. beep on turns the beep on. beep off turns the beep off. s = beep returns the current beep mode ( on or off ).

How to generate SNR in MATLAB? ›

To measure the SNR of a signal, you can simply use the MATLAB function "snr(x)", where x is the input signal. If you want to measure the SNR specifically using PSD, then you can do that by leveraging the "periodogram()" function. See SNR of Sinusoid Using PSD example for more information.

How do you create a constant in MATLAB? ›

You can define constants that you can refer to by name by creating a MATLAB® class that defines constant properties. Use constant properties to define constant values that you can access by name. Create a class with constant properties by declaring the Constant attribute in the property blocks.

Top Articles
Latest Posts
Article information

Author: Velia Krajcik

Last Updated:

Views: 5253

Rating: 4.3 / 5 (54 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Velia Krajcik

Birthday: 1996-07-27

Address: 520 Balistreri Mount, South Armand, OR 60528

Phone: +466880739437

Job: Future Retail Associate

Hobby: Polo, Scouting, Worldbuilding, Cosplaying, Photography, Rowing, Nordic skating

Introduction: My name is Velia Krajcik, I am a handsome, clean, lucky, gleaming, magnificent, proud, glorious person who loves writing and wants to share my knowledge and understanding with you.