summaryrefslogtreecommitdiff
path: root/3673/CH6/EX6.a.2/Example_a_6_2.sce
blob: 23575d587b27bcc26ed6160155f19d4875f4a2f3 (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
//Example_a_6_2 page no:234
clc;
I=5;
Z1mag=10;
Z1ang=-60;
Z2mag=16;
Z2ang=70;
Z1real=Z1mag*cosd(Z1ang);
Z1img=Z1mag*sind(Z1ang);
Z1=Z1real+(Z1img*%i);
Z2real=Z2mag*cosd(Z2ang);
Z2img=Z2mag*sind(Z2ang);
Z2=Z2real+(Z2img*%i);
Z=Z1+Z2;
Zmag=sqrt(real(Z)^2+imag(Z)^2);
pf=real(Z)/Zmag;
active_power=I^2*real(Z);
apparent_power=I^2*Zmag;
reactive_power=I^2*imag(Z);
disp(pf,"the power factor is ");
disp(active_power,"the active power is (in W)");
disp(apparent_power,"the apparent power is (in VA)");
disp(reactive_power,"the reactive power is (in VAR)");
disp("the calculated values varies slightly with textbook hence values are rounded off in text book");