Nyquist Example #2

MATLAB Code




%         ***** MATLAB Code Starts Here
%

%NYQUIST_02_MAT

%

fig_size = [232 84 774 624];

% System 1 -- all open-loop poles & zeros in LHP

%

olz1 = [-0.5;-10]; olp1 = [-0.3;-5;-20;-20];

num1 = 250 * real(poly(olz1));

den1 = real(poly(olp1));

[re1,im1] = nyquist(num1,den1);

figure(1),clf,plot(re1,im1,'b',re1,-im1,'r--'),plotax,set(gcf,'Position',fig_size),...

title('System #1: All open-loop poles in LHP, All open-loop zeros in LHP'),...

v=axis;nyquist_arrow(re1,im1,v);

%

% System 2 -- one open-loop zero in RHP, all open-loop poles in LHP

%

olz2 = [0.5;-10]; olp2 = [-0.3;-5;-20;-20];

num2 = 250 * real(poly(olz2));

den2 = real(poly(olp2));

[re2,im2] = nyquist(num2,den2);

figure(2),clf,plot(re2,im2,'b',re2,-im2,'r--'),plotax,set(gcf,'Position',fig_size),...

title('System #2: All open-loop poles in LHP, 1 open-loop zero in RHP'),...

v=axis;nyquist_arrow(re2,im2,v);

%

% System 3 -- one open-loop zero and one open-loop pole in RHP

%

olz3 = [0.5;-10]; olp3 = [0.3;-5;-20;-20];

num3 = 250 * real(poly(olz3));

den3 = real(poly(olp3));

[re3,im3] = nyquist(num3,den3);

figure(3),clf,plot(re3,im3,'b',re3,-im3,'r--'),plotax,set(gcf,'Position',fig_size),...

title('System #3: 1 open-loop pole in RHP, 1 open-loop zero in RHP'),...

v=axis;nyquist_arrow(re3,im3,v);

%

% System 4 -- one open-loop pole in RHP, all open-loop zeros in LHP

%

olz4 = [-0.5;-10]; olp4 = [0.3;-5;-20;-20];

num4 = 250 * real(poly(olz4));

den4 = real(poly(olp4));

[re4,im4] = nyquist(num4,den4);

figure(4),clf,plot(re4,im4,'b',re4,-im4,'r--'),plotax,set(gcf,'Position',fig_size),...

title('System #4: 1 open-loop pole in RHP, All open-loop zeros in LHP'),...

v=axis;nyquist_arrow(re4,im4,v);

%

% Form the closed-loop characteritics equations

%

dcl(1,:) = den1 + [0 0 num1];

dcl(2,:) = den2 + [0 0 num2];

dcl(3,:) = den3 + [0 0 num3];

dcl(4,:) = den4 + [0 0 num4];

%

% Find the closed-loop poles

%

for i = 1:4

clp(:,i) = roots(dcl(i,:));

end

%

clear i

%
%         ***** MATLAB Code Stops Here

Click the icon to return to the Dr. Beale's home page

Lastest revision on Wednesday, June 7, 2006 12:39 PM