Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
14 views1 page

Nyquist

The document contains MATLAB code for creating a Nyquist plot of a transfer function defined by a specific numerator and denominator. It also calculates and displays the Gain Margin, Phase Margin, Gain Crossover Frequency, and Phase Crossover Frequency. The plot is labeled with appropriate axes and title.

Uploaded by

Aditya Bhavsar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Nyquist

The document contains MATLAB code for creating a Nyquist plot of a transfer function defined by a specific numerator and denominator. It also calculates and displays the Gain Margin, Phase Margin, Gain Crossover Frequency, and Phase Crossover Frequency. The plot is labeled with appropriate axes and title.

Uploaded by

Aditya Bhavsar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

25/4/25 1:53 AM C:\Users\bhavs\...\prac6nyquistplot.

m 1 of 1

% Define the transfer function numerator and denominator


num = [0 0 0 50]; % Equivalent to 50*s^0 (DC gain)
den = [1 7 12 12]; % Denominator: s^3 + 7s^2 + 12s + 12

% Create the transfer function


sys = tf(num, den);

% Plot the Nyquist plot


nyquist(sys)

% Set the axis limits: [xmin xmax ymin ymax]


v = [-3 5 -7 7];
axis(v)

% Add labels and title


xlabel('Real Axis');
ylabel('Imaginary Axis');
title('Nyquist Plot of the system 50/(s+4)(s^2+3s+3)' )

% Determine Gain Margin, Phase Margin, Gain crossover frequency, and Phase
crossover frequency
[Gm, Pm, Wcg, Wcp] = margin(sys);

% Display results in the command window


fprintf('Gain Margin: %.2f dB\n', 20*log10(Gm));
fprintf('Phase Margin: %.2f degrees\n', Pm);
fprintf('Gain Crossover Frequency: %.2f rad/s\n', Wcg);
fprintf('Phase Crossover Frequency: %.2f rad/s\n', Wcp);

You might also like