268 Practical MATLAB® Applications for Engineers
C = 1e-6;
w = [200:50:2000];
XL = w*L;
XC = 1./(w*C);
plot(w,XL,’o’,w, XC,’*’)
title(‘[XL(w) and XC(w)] vs w’)
xlabel(‘frequency in rad/sec’), ylabel(‘Magnitude in Ohms’)
legend(‘XL’,’XC’)
grid on
hold; plot(w,XL,w,XC)The script fi le XL_XC is executed and the results are shown in Figure 3.49.Example 3.2Evaluate the impedance Z and admittance Y = (1/Z) for the circuit shown in Figure 3.50
fi rst by hand, and then by writing the script fi le Z_Y, for an angular frequency of w =
1 rad/s.FIGURE 3.49
Plots of Example 3.1.
200 400 600 800 1000 1200 1400 1600 1800 20000500100015002000250030003500400045005000 [XL(w) and XC(w)] versus wfrequency in rad/secMagnitude in OhmsXL
XCFIGURE 3.50
Network of Example 3.2.
C = 1/5 F R = 4 Ω
Z L = 2 Hw = 1 rad/s