summaryrefslogtreecommitdiff
path: root/1529/CH16/EX16.1/16_01.sce
blob: 63ce134818e19d65dc83249850477eab32ec815f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//Chapter 16, Problem 1
clc;
V=60;                           //voltage
R=20;                           //resistance in ohm
f=1000;                         //frequency in hertz
L=2.387e-3;                     //inductance in henry
Ir=V/R;                         //current flowing in the resistor
Xl=2*%pi*f*L;                   //inductive reactance
Il=V/Xl;                        //current flowing in the inductance
I=sqrt(Ir^2+Il^2);              //supply current from phasor diagram fig 16.1
phi=atan(Il/Ir);
Z=V/I;                          //impedance
P=V*I*cos(phi);                 //power consumed
printf("(a)  Current flowing in the resistor = %d A\n\tCurrent flowing in the inductance = %d A\n\n",Ir,Il);
printf("(b) Supply current = %d A\n\n",I);
printf("(c) Circuit phase angle = %.2f deg (lagging)\n\n",phi*(180/%pi));
printf("(d) Circuit impedance = %.1f ohm\n\n",Z);
printf("(e) Power consumed = %d W",P);