summaryrefslogtreecommitdiff
path: root/3872/CH2/EX2.2/EX2_2.sce
blob: 7a01ddca2705d1d06acc80713938cdaf7cb26875 (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
26
//Book - Power System: Analysis & Design 5th Edition
//Authors - J. Duncan Glover, Mulukutla S. Sarma, and Thomas J. Overbye
//Chapter - 2 ; Example 2.2
//Scilab Version - 6.0.0 ; OS - Windows


clc;
clear;
V=100*exp(%i*130*%pi/180);                          //Source Voltage in Volts
I=10*exp(%i*10*%pi/180);                            //Source current in Amperes
S=V*conj(I);                                        //Apparent power in VA
P=real(S);                                          //Real power in Watts
Q=imag(S);                                          //Reactive power in VAR
printf('The values are P=%d Watts and Q=%d VAR. Hence,',P,Q);
if P<0 then
    P=-P
    printf('\nThe source absorbs %d Watts',P);
else 
    printf('\nThe source delivers %d Watts',P);
end
if Q<0 then
    Q=-Q;
    printf('\nThe source absorbs %d VAR',Q);
else
    printf('\nThe source delivers %d VAR',Q);
end