Import the PyLab namespace (provides set of useful commands and constants like Pi)
In [1]:
%pylab notebook
Define all the parameters:
In [2]:
VS = 230.0 # Secondary voltage (V)
amps = arange(0, 65.2, 6.52) # Current values (A)
Req = 0.0445 # Equivalent R (ohms)
Xeq = 0.0645 # Equivalent X (ohms)
Calculate the current values for the three power factors. The first row of I contains the lagging currents, the second row contains the unity currents, and the third row contains the leading currents.
In [3]:
I = amps * array ([[0.8 - 0.6j], # Lagging
[1.0], # Unity
[0.8 + 0.6j]]) # Leading
Calculate VP/a:
In [4]:
VPa = VS + Req * I + 1j * Xeq * I
Calculate voltage regulation:
In [5]:
VR = (abs(VPa) - VS) / VS * 100;
Plot the voltage regulation:
In [6]:
rc('text', usetex=True) # enable LaTeX commands for plot
plot(amps,VR[0,])
plot(amps,VR[1,])
plot(amps,VR[2,])
title(r'\textbf{Voltage Regulation Versus Load}');
xlabel(r'\textbf{Load (A)}');
ylabel(r'\textbf{Voltage Regulation (\%)}');
legend(('0.8 PF lagging','1.0 PF','0.8 PF leading'), loc=2);
grid()