A Nyquist plot in MATLAB is a graphical representation of a system's frequency response, used to analyze stability and performance by plotting the real and imaginary parts of the complex transfer function.
Here's a simple MATLAB code snippet to create a Nyquist plot:
% Define the transfer function
num = [1]; % Numerator coefficients
den = [1, 3, 2]; % Denominator coefficients
sys = tf(num, den); % Create transfer function
% Generate the Nyquist plot
nyquist(sys);
grid on; % Add a grid for better visualization
What is a Nyquist Plot?
A Nyquist plot is a graphical representation used in control theory and signal processing that plots the complex frequency response of a system. This plot allows engineers to visualize the stability and dynamic behavior of control systems. It depicts how the gain (magnitude) and phase of a system's transfer function vary with frequency.

Applications of Nyquist Plots
Nyquist plots are crucial in various applications, including:
- Stability analysis: Using the Nyquist stability criterion, engineers ascertain whether a control system will remain stable given feedback.
- Frequency response analysis: Engineers analyze how systems respond to various frequencies, allowing for the assessment of system performance under oscillatory conditions.
- Control system design: They assist in designing control systems that meet specific stability margins and performance criteria.

Understanding the Basics
Components of a Nyquist Plot
A Nyquist plot consists of two major components:
- Real and imaginary axes: The horizontal axis corresponds to the real part of the transfer function, while the vertical axis indicates the imaginary part. Points plotted in this space represent frequency response at various frequencies.
- Gain and phase: The magnitude (gain) and angle (phase) of the system response are represented as the plot curves, providing insight into system behavior.
The Nyquist Stability Criterion
The Nyquist stability criterion helps assess system stability by examining the contour encirclement of a critical point, typically -1 in the complex plane. The relationship between open-loop stability (the system without feedback) and closed-loop stability (with feedback) becomes evident through this analysis. A Nyquist plot that encircles the critical point indicates potential stability issues.

Getting Started with MATLAB
Preparing Your MATLAB Environment
Before diving into Nyquist plots in MATLAB, ensure you have the appropriate software:
- Install the latest version of MATLAB.
- Make sure the Control System Toolbox is included, as it contains essential functions for creating Nyquist plots.
Basic Syntax for Nyquist Plot Commands
To generate a Nyquist plot in MATLAB, you'll primarily use the `nyquist()` function. Familiarizing yourself with the command structure is vital, as it will simplify the process of generating visual representations of your systems.

Creating a Nyquist Plot in MATLAB
Step-by-Step Guide
Defining a Transfer Function
The first step in creating a Nyquist plot is to define a transfer function. A transfer function represents the relationship between input and output in the frequency domain. Here’s an example of defining a standard second-order transfer function in MATLAB:
s = tf('s');
G = 1 / (s^2 + 5*s + 6);
This command defines a transfer function \( G(s) = \frac{1}{s^2 + 5s + 6} \).
Using the nyquist() Function
With the transfer function defined, you can create a basic Nyquist plot by leveraging the `nyquist()` function. This command will generate the plot and display it in a new window:
nyquist(G);
grid on;
Here, the `grid on` command adds gridlines to the plot, making it easier to analyze critical points.
Customizing Your Nyquist Plot
Adding Multiple Transfer Functions
MATLAB allows you to overlay multiple Nyquist plots for comparative analysis. You can plot additional transfer functions using the same `nyquist()` function. For example:
G2 = 1 / (s^2 + 2*s + 1);
nyquist(G, G2);
In this case, `G2` represents a second transfer function. This method is helpful for contrasting the system behaviors of different configurations.
Modifying Axes and Labels
Adding titles and labels enhances the interpretability of your Nyquist plots. You can customize axes and add annotations using the following commands:
title('Nyquist Plot of System G(s)');
xlabel('Real Part');
ylabel('Imaginary Part');
Clear labeling helps others (and future you) understand what the plot represents.

Analyzing the Nyquist Plot
Interpreting the Results
Understanding what the curves signify in the plot is crucial for system analysis. If the Nyquist plot does not encircle the -1 point, the closed-loop system is likely stable. Conversely, encirclement suggests that the system may exhibit instability.
Common Scenarios and Their Implications
Each Nyquist plot scenario has distinct implications for system stability:
- Encircling the -1 point: Indicates potential instability.
- No encirclement: Suggests guaranteed stability.
- Multiple loops: Indicates complex interactions that may require further investigation.

Troubleshooting Common Issues
Solutions to Frequent Errors
When generating Nyquist plots, you may encounter common errors, such as undefined transfer functions or incorrect plotting syntax. Ensuring that your transfer functions are properly defined in the Z-domain is essential.
For instance, if `G` is not defined, MATLAB will throw an error. Double-check your transfer function definitions for accuracy to resolve these issues quickly.

Advanced Techniques
Using Bode and Nyquist Together
Employing both Bode and Nyquist plots can provide a more complete view of a system's behavior. You can use the `bode()` function to visualize the same transfer function's magnitude and phase separately:
bode(G);
Combining insights from both plots allows engineers to make informed decisions about control parameters effectively.
Customizing Nyquist Plots with Frequency Response Data
For advanced users, you can extract and plot frequency response data using MATLAB. This approach enhances your analysis by offering a detailed view of system behavior:
[mag, phase, w] = bode(G);
nyquist(mag .* exp(1i * phase * pi / 180), w);
This method illustrates the frequency response while allowing for further customization.

Conclusion
In summary, a Nyquist plot in MATLAB is a powerful tool that aids in control system analysis and design. By defining transfer functions and utilizing the `nyquist()` function, engineers can visualize gain and phase margins effectively. Whether you are analyzing system stability, comparing multiple systems, or troubleshooting common issues, mastering this tool will significantly enhance your engineering skill set.

FAQs about Nyquist Plots in MATLAB
Frequently Asked Questions
-
What should I do if my Nyquist plot has no discernible shape? Ensure your transfer function is correctly defined. Check for any syntax errors.
-
How do I determine if my system is stable by looking at the Nyquist plot? Look for whether the plot encircles the -1 point. If it does not, your system is likely stable.
By leveraging this guide, you can effectively use NYQUIST PLOT MATLAB commands to analyze and design control systems with confidence.