422 Chapter 7 / Control Systems Analysis and Design by the Frequency-Response MethodThe frequency vaat the intersection of the initial –40-dBdecade segment (or its
extension) with the 0-dB line gives the square root of Kanumerically. This can be seen
from the following:
which yields
Plotting Bode Diagrams with MATLAB. The command bodecomputes magni-
tudes and phase angles of the frequency response of continuous-time, linear, time-
invariant systems.
When the command bode(without left-hand arguments) is entered in the
computer,MATLABproduces a Bode plot on the screen. Most commonly used bode
commands are
bode(num,den)
bode(num,den,w)
bode(A,B,C,D)
bode(A,B,C,D,w)
bode(A,B,C,D,iu,w)
bode(sys)
When invoked with left-hand arguments, such as
[mag,phase,w] = bode(num,den,w)
bodereturns the frequency response of the system in matrices mag,phase, and w.No
plot is drawn on the screen. The matrices magandphasecontain magnitudes and phase
angles of the frequency response of the system, evaluated at user-specified frequency
points. The phase angle is returned in degrees. The magnitude can be converted to deci-
bels with the statement
magdB = 20*log10(mag)
Other Bode commands with left-hand arguments are
[mag,phase,w] = bode(num,den)
[mag,phase,w] = bode(num,den,w)
[mag,phase,w] = bode(A,B,C,D)
[mag,phase,w] = bode(A,B.C,D,w)
[mag,phase,w] = bode(A,B,C,D,iu,w)
[mag,phase,w] = bode(sys)
To specify the frequency range, use the command logspace(d1,d2)orlogspace
(d1,d2,n). logspace(d1,d2)generates a vector of 50 points logarithmically equally spaced
between decades 10 d1and 10 d2. (50 points include both endpoints. There are 48 points
between the endpoints.) To generate 50 points between 0.1 radsec and 100 radsec,
enter the command
w = logspace(-1,2)
va= 1 Ka
20 log 2
Ka
AjvaB
22 =^20 log^1 =^0
Openmirrors.com