Section 7–2 / Bode Diagrams 425Frequency (rad/sec)Bode Diagram of G(s) = 9(s^2 + 0.2s + 1)/[s(s^2 + 1.2s + 9)]− 100− 50050100− 50Phase (deg); Magnitude (dB)05010 −^210 −^1100101102103Figure 7–23
Bode diagram of
G(s)=
9 As^2 +0.2s+ 1 B
sAs^2 +1.2s+ 9 B.
MATLAB Program 7–3
num = [9 1.8 9];
den = [1 1.2 9 0];
w = logspace(-2,3,100);
bode(num,den,w)
title('Bode Diagram of G(s) = 9(s^2 + 0.2s + 1)/[s(s^2 + 1.2s + 9)]')
If it is desired to plot the Bode diagram from 0.01 to 1000 radsec, enter the following
command:w = logspace(-2,3,100)
This command generates 100 points logarithmically equally spaced between 0.01 and 100 radsec.
(Note that such a vector wspecifies the frequencies in radians per second at which the frequency
response will be calculated.)
If we use the commandbode(num,den,w)
then the frequency range is as the user specified, but the magnitude range and phase-angle
range will be automatically determined. See MATLAB Program 7–3 and the resulting plot in
Figure 7–23.