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

//input
r=10;//resistance of a coil in ohms
l=0.08;//inductance of the coil in henry
v=250;//a.c. supply voltage in volts
f=50;//supply frequency in hertz

//calculations
Xl=2*%pi*f*l;//reactance of the coil in ohms
z=((r^2)+(Xl^2))^0.5;//impedance of the circuit 
I=v/z;//current in amperes
phi=acos(r/z);// phase angle in radians
PHI=(phi*180)/%pi;//phase angle in degrees

//output
mprintf('the coil will take a current of %3.2f A lagging by %3.0f degree on the voltage',I,PHI)