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

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

Nyquist Plot

The document contains MATLAB code for defining a transfer function and plotting its Nyquist plot. It specifies the numerator and denominator of the transfer function, sets axis limits, and adds labels and a title. Additionally, it calculates and displays the gain margin, phase margin, and crossover frequencies.

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)
22 views1 page

Nyquist Plot

The document contains MATLAB code for defining a transfer function and plotting its Nyquist plot. It specifies the numerator and denominator of the transfer function, sets axis limits, and adds labels and a title. Additionally, it calculates and displays the gain margin, phase margin, and crossover frequencies.

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:57 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