PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

300 Practical MATLAB® Applications for Engineers


subplot(2,2,1)
plot(W,Z1,’*’,W,Z2,’s’,W,Z3,’o’)
grid on
legend(‘R=540 Ohms’, ‘R=1.35KOhms’, ‘R=2.7KOhms’);
title(‘[Z(w)] vs w’)
ylabel(‘Impedance (Ohms)’)
subplot(2,2,2)
plot(W,I1,’*’,W,I2,’s’,W,I3,’o’)
title(‘[I(w)] vs w’)
ylabel(‘Amplitude (amps)’)
grid on
legend(‘I for 540’, ‘I for 1350’, ‘I for 2700’);
subplot(2,2,3)
plot(W,Angle1,’*’,W,Angle2,’s’,W,Angle3,’o’)
title(‘ [ang(Z(w)] vs w’)
ylabel(‘Amplitude (radians)’); xlabel(‘ frequebcy w (rad/sec)’);
legend(‘angle for 540’, ‘angle for 1350’, ‘angle for 2700’);
grid on
subplot(2,2,4)
plot(W,VC1,’*’,W,VC2,’s’,W,VC3,’o’)
grid on
title(‘[Vc(w)] vs w’)
ylabel(‘Amplitude (volts)’); xlabel(‘frequency w (rad/sec)’);
legend(‘Vc for 540’, ‘Vc for 1350’, ‘Vc for 2700’);

The script fi le I_vsV_RLC is executed, and the resulting plots are shown in Figure 3.79.

3

2

1

(^005100)
Amplitude (amps)
Amplitude (radians) Amplitude (volts)
0
0.01
0.008
0.006
0.004
0.002
510
0 0510
2
0
− 1
− 2
0
− 5
− 10
− 15
− 20
510
R = 540 Ohms
[Z(w)] versus w
[ang(Z(w)] versus w
R = 1.35 KOhms
R = 2.7 KOhms
× 104
× 104
[Vc(w)] versus w
× 104
frequency w (rad/sec)
frequency w (rad/sec)× 104
[I(w)] versus w
× 104
Impedance (Ohms)
angle for 540
Vc for 540
Vc for 1350
Vc for 2700
I for 540
I for 1350
I for 2700
angle for 1350
angle for 2700
FIGURE 3.79
Plots of Example 3.18.

Free download pdf