summaryrefslogtreecommitdiff
path: root/2276/CH4/EX4.6/chapter4_ex6.sce
blob: 7bce6f1c05447b99092941d0f23c12ade15c5eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
clc
clear

//input
r=10;//resistance of an inductor in ohms
l=0.08;//inductance in henry
c=200*(10^-6);//capacitence of the capacitor connected in series to the inductor in farad
v=240;//supply voltage in volts
f=50;//supply frequency in hertz

//calculations
xl=2*%pi*f*l;//reactance of the inductor in ohms
xc=1/(2*%pi*f*c);//reactance of the capacitor in ohms
R=xl-xc;//total reactacne of the circuit in ohms
z=((r^2)+(R^2))^0.5;//impedance of the circuit in ohms
I=v/z;//current in ohms
phi=(180/%pi)*acos(r/z);//phase angle in degrees
pd=I*(((r^2)+(xl^2))^0.5);//p.d. across inductor in volts

//output
mprintf('the current taken from the supply is %3.1f A lagging on the voltage by %3.1f degrees and the voltage drop across the inductor is %3.0f V',I,phi,pd)