In order to illustrate the plotting of G(jw), we will generate our own
plot of G(j*w)and compare it with the Bode plots and the Nyquist
diagram. If we run the following m-file, we will see the points that comprise
G(jw), in particular the point corresponding to G(j*3).
%define the transfer function num = conv([1,4],[1 6]); den = conv([1,-3],[1 -5]); %create a frequency vector clf w = logspace(-1,2,100); hold on %plot a '+' for each point corresponding to G(jw) for i = 1:100 plot(polyval(num,j*w(1,i))/polyval(den, j*w (1,i)), '+') end %plot a green 'X' for frequency of 3rad/s plot(polyval(num,j*3)/polyval(den, j*3), 'xg') %plot vector from origin to this point n= polyval(num,j*3)/polyval(den, j*3); x = [0,real(n)]; y = [0,imag(n)]; plot(x,y, '-g') %find magnitude and phase Mag = abs(n); Phase = 180 +360*atan(imag(n)/real(n))/(2*pi); %find gain Gain = 20*log10(Mag); grid Mag, Phase, GainThe image should look similar to this:
Mag = 1.3558 Phase = 139.3987 Gain = 2.6440
If you look at the plots at a frequency of 3rad/s you will see the magnitude is a little over 2.5 dB and the phase is around 140 degrees. This agrees with our previous results.
%define the transfer function num = conv([1,4],[1 6]); den = conv([1,-3],[1 -5]); %create a frequency vector similar to the one described above w = logspace(-1,2,100); negw = -1*w; clf hold on %plot a '+' for each point corresponding to G(jw) for i = 1:100 plot(polyval(num,j*w(1,i))/polyval(den, j*w (1,i)), '+') plot(polyval(num,j*negw(1,i))/polyval(den, j*negw (1,i)), '+') end %draw Nyquist diagram on top to compare nyquist(num,den) hold off
A perfect match! Also note that the negative frequencies produce a mirror image across the real axis of the positive frequency response.
Use the "Back" button of your browser to return to the previous page
8/27/96 LJO