PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Alternating Current Analysis 299


Example 3.18

Create the script fi le I_versus V_ R L C that analyzes the effect of changing R of the series
RLC circuit diagram shown in Figure 3.78, for the following values of R— 540 Ω, 1.35 kΩ,

and 2.7 kΩ, over the range 4 103 ≤ ω ≤ 2 π (^) (^15) * 103 rad/s, linearly spaced every ∆ω =
500 rad/s, and returns the following plots:



  1. Z(ω) versus ω

  2. I(ω) versus ω

  3. ∠Z(ω) versus ω

  4. VC(ω) versus ω


L = 30 mH

C = 0.01 μF

4 krad/ s < w < 6.28*15 krad/s

V = 5

I

Z(w)

0 °

R

FIGURE 3.78
Network of Example 3.18.

MATLAB Solution
% Script file: I _ vsV _ RLC
% R = 540, L = 30mH, C =. 01uF
V = 5;
RI = 270;
R1 = RI*2;
C = .01e-6;
L = 30e-3;
W = [4000:500:2*pi*15e3];
XC = -1./(W.*C);
XL = W.*L;
Z1 = sqrt(R1^2+(XL+XC).^2);
Angle1 = atan((XL+XC)./R1);
I1 = V./Z1;
VC1 = (V*XC)./Z1;
% R = 1.35K, L = 30mH, C =. 01uF
R2 = RI*5;
Z2 = sqrt (R2^2+(XL+XC).^2);
Angle2 = atan((XL+XC)./R2);
I2 = V./Z2;
VC2 = (V*XC)./Z2;
% R = 2.7K, L = 30mH, C =. 01uF
R3 = RI*10;
Z3 = sqrt(R3^2+(XL+XC).^2);
Angle3=atan((XL+XC)./R3);
I3 = V./Z3;
VC3 = (V*XC)./Z3;
figure(1)
Free download pdf