summaryrefslogtreecommitdiff
path: root/608/CH26/EX26.02/26_02.sce
blob: 39e0249b95f6d1931facc4a3c3ffebcce55b95fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//Problem 26.02: A current of (15+i8)A flows in a circuit whose supply voltage is (120+i200)V.Determine (a) the active power, and (b) the reactive power.

//initializing the variables:
V = 120 + %i*200; // in volts
I = 15 + %i*8; // in amperes

//calculation:
//Active power, P
Pa = real(V)*real(I) + imag(V)*imag(I)
//Reactive power, Q
Q = imag(V)*real(I) - real(V)*imag(I)

printf("\n\n Result \n\n")
printf("\n (a) the active power in the circuit %.0f W",Pa)
printf("\n (b) the reactive power in the circuit %.0f var ",Q)