In [1]:
%pylab inline
Assume that the voltage applied to a load is $\vec{V} = 208\,V\angle -30^\circ$ and the current flowing through the load $\vec{I} = 2\,A\angle 20^\circ$.
In [2]:
V = 208.0 * exp(-1j*30/180*pi) # [V]
I = 2.0 * exp( 1j*20/180*pi) # [A]
In [3]:
S = V * conjugate(I) # The complex conjugate of a complex number is
# obtained by changing the sign of its imaginary part.
S_angle = arctan(S.imag/S.real)
print('S = {:.1f} VA ∠{:.1f}°'.format(*(abs(S), S_angle/pi*180)))
print('====================')
In [4]:
PF = cos(S_angle)
print('PF = {:.3f} leading'.format(PF))
print('==================')
In [5]:
Q = abs(S)*sin(S_angle)
print('Q = {:.1f} var'.format(Q))
print('==============')