Plotting Nyquist Diagrams and Applications in MATLAB for Aerospace Engineers

Abdulrasheed Kamal
The Quantastic Journal
5 min readJul 19, 2024

Nyquist diagrams are an essential tool in aerospace engineering for analyzing the stability of feedback systems. This article provides a detailed guide on plotting Nyquist diagrams using MATLAB, discussing their theoretical background and practical applications in the aerospace industry. Aerospace engineers will learn how to generate Nyquist plots, interpret them, and apply them to real-world engineering problems.

Nyquist diagrams are graphical representations used to determine the stability of control systems. They plot the frequency response of a system, particularly focusing on the phase and gain of the system as a function of frequency. This visual tool helps aerospace engineers assess whether a feedback control system is stable and predict its behavior.

MATLAB offers robust functions for generating Nyquist plots, making it a valuable tool for engineers in the design and analysis of aerospace control systems. This article will guide you through the process of plotting Nyquist diagrams in MATLAB and demonstrate their practical applications in aerospace engineering.

Theoretical Background

Nyquist diagrams plot the complex function. G(j,ω) over a range of frequencies ω, where. G(s) is the open-loop transfer function of the system, and s = jω.

The plot maps the frequency response of G(j,ω) on the complex plane, showing how the magnitude and phase vary with frequency.

Key Concepts:

Gain and Phase Margins: These margins help determine the system’s stability. The gain margin is the factor by which the gain can be increased before the system becomes unstable, and the phase margin is the additional phase lag required to bring the system to the verge of instability.

Nyquist Criterion:

This criterion states that for a system to be stable, the Nyquist plot of the open-loop transfer function. G(j,ω) must encircle the critical point (–1 + 0 j ) in the complex plane a specific number of times related to the number of poles in the right half-plane.

Plotting Nyquist Diagrams in MATLAB: Step-by-Step Implementation

Define the Transfer Function

The first step is to define the transfer function of the system. MATLAB uses the tf function to represent transfer functions.

- Define the numerator and denominator of the transfer function

numerator = [1];
denominator = [1 3 3 1];

- Create the transfer function

sys = tf(numerator, denominator);

Plot the Nyquist Diagram

MATLAB provides the Nyquist function to plot the Nyquist diagram of a given transfer function.

- Plot the Nyquist diagram

nyquist(sys);
grid on;
title('Nyquist Diagram');

Analyze the Plot

After generating the Nyquist plot, analyze it to determine the stability of the system. Check for encirclements of the critical point -1 + 0j and calculate the gain and phase margins.

Example

Here’s an example of plotting a Nyquist diagram for a given transfer function:

- Define the transfer function

numerator = [2];
denominator = [1 2 2 1];
sys = tf(numerator, denominator);

- Plot the Nyquist diagram

nyquist(sys);
grid on;
title('Nyquist Diagram of the Transfer Function');
Nyquist Diagram of the Transfer Function.

This code plots the Nyquist diagram for the transfer function:

G(s) = 2/(s³ + 2s² + 2s + 1)

Practical Applications in Aerospace Engineering

Stability Analysis of Flight Control Systems

Nyquist diagrams are crucial for analyzing the stability of flight control systems. Aerospace engineers use Nyquist plots to ensure that autopilot and flight control systems are stable under various operating conditions.

Example:

Suppose we need to analyze the stability of a pitch control system of an aircraft. We can use MATLAB to plot the Nyquist diagram and determine the stability margins.

- Define the pitch control system transfer function

numerator = [1];
denominator = [1 3 3 1];
pitch_control_system = tf(numerator, denominator);

- Plot the Nyquist diagram

nyquist(pitch_control_system);
grid on;
title('Nyquist Diagram of Pitch Control System');
Nyquist Diagram of Pitch Control System.

Design and Tuning of Autopilot Systems

Aerospace engineers use Nyquist plots to design and tune autopilot systems. By adjusting the parameters of the control system, they ensure the aircraft remains stable and responds correctly to pilot inputs and environmental disturbances.

Example:

To design a proportional-integral-derivative (PID) controller for an autopilot system, we can use the Nyquist plot to adjust the controller parameters.

- Define the aircraft transfer function

numerator = [1];
denominator = [1 5 6];
aircraft = tf(numerator, denominator);

- Define the PID controller

Kp = 1; % Proportional gain
Ki = 1; % Integral gain
Kd = 0.5; % Derivative gain
controller = pid(Kp, Ki, Kd);

- Combine the aircraft and controller

sys = series(controller, aircraft);

- Plot the Nyquist diagram of the closed-loop system

nyquist(sys);
grid on;
title('Nyquist Diagram with PID Controller');
Nyquist Diagram with PID Controller.

By adjusting Kp , Ki , and Kd engineers can use the Nyquist plot to achieve the desired gain and phase margins, ensuring the system’s stability and performance.

Stability of Aerospace Propulsion Systems

Nyquist plots help ensure the stability of propulsion control systems, such as those in jet engines or rocket thrusters. These systems must remain stable under varying loads and operating conditions to maintain optimal performance and safety.

Example:

For a jet engine control system, engineers can plot the Nyquist diagram to analyze stability.

- Define the jet engine transfer function

numerator = [1];
denominator = [1 4 6 4];
jet_engine = tf(numerator, denominator);

- Plot the Nyquist diagram

nyquist(jet_engine);
grid on;
title('Nyquist Diagram of Jet Engine Control System');
Nyquist Diagram of Jet Engine Control System

Finally,

Nyquist diagrams are a powerful tool for aerospace engineers to analyze and design stable control systems. MATLAB’s built-in functions simplify the process of generating and interpreting these plots, making it an indispensable tool in aerospace engineering. By mastering Nyquist plots, aerospace engineers can ensure the stability and robustness of their control systems, leading to safer and more reliable aircraft and spacecraft designs.

Nyquist Diagram of the Transfer Function.

--

--