summaryrefslogtreecommitdiff
path: root/620/CH24/EX24.7/example24_7.sce
blob: 77555cdf6568d4430e2aa92f2d63a9589a14a4fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
l=30*10^(-3);
c=0.005*10^(-6);
r=1000;
v=2;
f=10*10^3;
disp("Part a");
x_l=2*%pi*f*l;
x_c=1/(2*%pi*f*c);
z=sqrt(r^2+(x_l-x_c)^2);
disp("the circuit impedance (in Ω)"); disp(z);
disp("Part b");
i=v/z;
disp("the circuit current (in mA) is"); disp(i*10^3);
disp("Part c");
vr=i*r;
disp("voltage (in V) across resistor is"); disp(vr);
vl=i*x_l;
disp("voltage (in V) across inductor is"); disp(vl);
vc=i*x_c;
disp("voltage (in V) across capacitor is"); disp(vc);
disp("Part d");
deg=atan((x_l-x_c)/r);
disp("the phase angle (in deg) between current and applied voltage is"); disp(deg);