summaryrefslogtreecommitdiff
path: root/620/CH25/EX25.19/example25_19.sce
blob: 2602afd6261cf65791143edd04d127ac4525bbfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
r1=100;
r2=220;
r3=150;
l1=50*10^(-3);
l2=100*10^(-3);
c=2*10^(-6);
f=400;
v=24;
disp("Part a");
x_l1=2*%pi*f*l1;
x_l2=2*%pi*f*l2;
x_c=1/(2*%pi*f*c);
z1=r1+%i*x_l1;
z2=r2+%i*x_l2;
z3=r3-%i*x_c;
z=z1+z2*z3/(z2+z3);
m_z=sqrt(real(z)^2+imag(z)^2);
deg_z=atan(imag(z)/real(z))*180/%pi;
disp("the total impedance (in Ω) of the circuit has a magnitude of"); disp(m_z);
disp("with a phase angle (in deg) of"); disp(deg_z);
disp("Part b");
m_i=v/m_z;
deg_i=-deg_z;
disp("the total supply current (in mA) has a magnitude of"); disp(m_i*10^3);
disp("with a phase angle (in deg) of"); disp(deg_i);
disp("Part c");
m_v1=m_i*sqrt(real(z1)^2+imag(z1)^2);
deg_v1=deg_i+atan(imag(z1)/real(z1))*180/%pi;
disp("the reading of voltmeter (in V) has a magnitude of"); disp(m_v1);
disp("with a phase angle (in deg) of"); disp(deg_v1);
disp("Part d");
m_ic=m_i*sqrt(real(z2)^2+imag(z2)^2)/sqrt(real(z2+z3)^2+imag(z2+z3)^2);
deg_ic=deg_i+(atan(imag(z2)/real(z2))-atan(imag(z2+z3)/real(z2+z3)))*180/%pi;
disp("the current (in mA) through the capacitor has a magnitude of"); disp(m_ic*10^3);
disp("with a phase angle (in deg) of"); disp(deg_ic);