Professional Documents
Culture Documents
close all
clear
clf
clc
(i)
The value of magnitudes of G in dB for angular frequency 0-300 rad/s with increment of 5 rad/s are:
disp(logmagGiDiscrete)
Inf -59.1037 -78.0685 -93.2694 -103.6289 -111.5465 -117.9697 -123.3787 -128.0526 -132.1684 -135.8458 -139.
fprintf("The value of phases of G in degree for angular frequency 0-300 rad/s with
increment of 5 rad/s are:")
The value of phases of G in degree for angular frequency 0-300 rad/s with increment of 5 rad/s are:
disp(phaGiDiscrete)
1
-90.0000 -155.4467 -291.6401 -317.7879 -329.0597 -335.5005 -339.6960 -342.6540 -344.8547 -346.5572 -347.9141 -349.
axmag.Title.String = "Magnitude";
axmag.Box = "on";
hold off
axpha.Title.String = "Phase";
axpha.XScale = 'log';
axpha.Box = "on";
hold off
2
% Create the Nyquist plot
figure(2);
axnyq = gca;
hold on
plot(realGi, imagGi, 'Parent', axnyq);
scatter(realGiDiscrete, imagGiDiscrete, "filled", 'Parent', axnyq);
grid on
axis equal
axnyq.XAxisLocation = "origin";
axnyq.YAxisLocation = "origin";
axnyq.XLabel.String = "G_{Re}";
axnyq.YLabel.String = "G_{Im}";
axnyq.Box = "on";
hold off
3
% Create the Nichols chart
figure(3);
axnic = gca;
hold on
plot(phaGi, logmagGi/20, 'Parent', axnic);
scatter(phaGiDiscrete, logmagGiDiscrete/20, 'filled', 'Parent', axnic);
grid on
axnic.XAxisLocation = "origin";
% axnic.YAxisLocation = "origin";
axnic.Box = "on";
hold off
4
(ii)
5
fprintf("The value of magnitudes of G in dB for angular frequency 0-300 rad/s with
increment of 5 rad/s are:")
The value of magnitudes of G in dB for angular frequency 0-300 rad/s with increment of 5 rad/s are:
disp(logmagGiDiscrete)
-25.3434 -31.1094 -41.2442 -47.6594 -52.4016 -56.1527 -59.2498 -61.8847 -64.1761 -66.2028 -68.0191 -69.
fprintf("The value of phases of G in degree for angular frequency 0-300 rad/s with
increment of 5 rad/s are:")
The value of phases of G in degree for angular frequency 0-300 rad/s with increment of 5 rad/s are:
disp(phaGiDiscrete)
180.0000 -75.3236 -121.0659 -139.3205 -149.0723 -155.0945 -159.1695 -162.1055 -164.3194 -166.0477 -167.4339 -168.
axmag.Title.String = "Magnitude";
axmag.Box = "on";
hold off
axpha.Title.String = "Phase";
6
axpha.XScale = 'log';
axpha.Box = "on";
hold off
hold on
plot(realGi, imagGi, 'Parent', axnyq);
scatter(realGiDiscrete, imagGiDiscrete, "filled", 'Parent', axnyq);
grid on
axis equal
axnyq.XAxisLocation = "origin";
axnyq.YAxisLocation = "origin";
axnyq.XLabel.String = "G_{Re}";
7
axnyq.YLabel.String = "G_{Im}";
axnyq.Box = "on";
hold off
hold on
plot(phaGi, logmagGi/20, 'Parent', axnic);
scatter(phaGiDiscrete, logmagGiDiscrete/20, 'filled', 'Parent', axnic);
grid on
axnic.XAxisLocation = "origin";
axnic.YAxisLocation = "origin";
8
axnic.XLim = [-225 225];
axnic.Box = "on";
hold off