summaryrefslogtreecommitdiff
path: root/1319/CH1/EX1.32/1_32.sce
blob: 7b8592f47a384d55ffb31806c63867b64359596c (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
//Determine the parameters of the circuit and power and pf

clc;
clear;

tv=30;//Phase angle for voltage
ti=-30;// Phase angle for current
t=tv-ti;//Phase difference between v and i

//Keeping i as reference, Voltage leads current by t angle

i=10*(expm(%i*0));
v=230*(expm(%i*(%pi*t/180)));

z=v/i;

R=real(z);
X=imag(z);

P=abs(v)*abs(i)*cosd(t)/2; // rms values of voltage and current

printf('The circuit parameters are \n')
printf('Resistance = %g ohms\nReactance = %g ohms\n\n',R,X)
printf('The Power consumed = %g W\n',P)
printf('p.f of the circuit = %g\n',cosd(t))