3-phase rectifier
The three-phase diode rectifier given below is connected to a three-phase ac voltage source through inductor $L=5\,$mH. The inductor Ld is large enough so that the current through it is ripple free.- What is the average value of the DC voltage ($V_{pm}$) and the DC current ($i_{Ld}$)?
- What is the power delivered to the voltage source?
- What is the duration for which a diode conducts in one fundamental cycle of the input voltage?
- Which are the dominant harmonics in the ac line current?
from IPython.display import Image
Image(filename =r'rectifier_3ph_9_fig_1.png', width=450)
# run this cell to view the circuit file.
%pycat rectifier_3ph_9_orig.in
We now replace the strings such as \$Ls with the values of our choice by running the python script given below. It takes an existing circuit file rectifier_3ph_9_orig.in and produces a new circuit file rectifier_3ph_9.in, after replacing \$Ls (etc) with values of our choice.
import gseim_calc as calc
import numpy as np
s_Ls = "5e-3"
s_Vdc = "400"
VL = 400.0
A_sin = VL*np.sqrt(2/3)
s_A_sin = ("%11.4E"%(A_sin)).strip()
l = [
('$Ls', s_Ls),
('$Vdc', s_Vdc),
('$A_sin', s_A_sin),
]
calc.replace_strings_1("rectifier_3ph_9_orig.in", "rectifier_3ph_9.in", l)
print('rectifier_3ph_9.in is ready for execution')
rectifier_3ph_9.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("rectifier_3ph_9.in")
os.system('run_gseim rectifier_3ph_9.in')
get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = rectifier_3ph_9.in Circuit: n_xbeu_vr = 0 Circuit: n_ebeu_nd = 11 main: i_solve = 0 ssw_allocate_1 (2): n_statevar=4 main: calling solve_trns mat_ssw_1_e: n_statevar: 4 mat_ssw_1_e0: cct.n_ebeu: 16 Transient simulation starts... i=0 i=1000 solve_ssw_e: ssw_iter_newton=0, rhs_ssw_norm=4.6680e+00 Transient simulation starts... i=0 i=1000 solve_ssw_e: ssw_iter_newton=1, rhs_ssw_norm=4.8733e+01 Transient simulation starts... i=0 i=1000 solve_ssw_e: ssw_iter_newton=2, rhs_ssw_norm=5.2612e-04 Transient simulation starts... i=0 i=1000 solve_ssw_e: ssw_iter_newton=3, rhs_ssw_norm=3.1229e-12 solve_ssw_e: calling solve_ssw_1_e for one more trns step Transient simulation starts... i=0 i=1000 solve_ssw_1_e over (after trns step for output) solve_ssw_e ends, slv.ssw_iter_newton=3 GSEIM: Program completed.
0
The circuit file (rectifier_3ph_9.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on rectifier_3ph_9.in) creates data files called rectifier_3ph_9_1.dat, etc. in the same directory. We can now use the python code below to compute/plot the various quantities of interest.
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
f_hz = 50.0
T = 1.0/f_hz
slv = calc.slv("rectifier_3ph_9.in")
i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
col_v_o = slv.get_index(i_slv,i_out,"v_o")
col_ID1 = slv.get_index(i_slv,i_out,"ID1")
col_ID2 = slv.get_index(i_slv,i_out,"ID2")
col_ID3 = slv.get_index(i_slv,i_out,"ID3")
col_ID4 = slv.get_index(i_slv,i_out,"ID4")
col_ID5 = slv.get_index(i_slv,i_out,"ID5")
col_ID6 = slv.get_index(i_slv,i_out,"ID6")
col_ISa = slv.get_index(i_slv,i_out,"ISa")
col_ISb = slv.get_index(i_slv,i_out,"ISb")
col_ISc = slv.get_index(i_slv,i_out,"ISc")
col_ILd = slv.get_index(i_slv,i_out,"ILd")
i_out = 1
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u2 = np.loadtxt(filename)
t2 = u2[:, 0]
col_P_Vdc = slv.get_index(i_slv,i_out,"P_Vdc")
col_P_Vsa = slv.get_index(i_slv,i_out,"P_Vsa")
col_P_Vsb = slv.get_index(i_slv,i_out,"P_Vsb")
col_P_Vsc = slv.get_index(i_slv,i_out,"P_Vsc")
l_v_o = calc.avg_rms_2(t1, u1[:,col_v_o ], T, 2.0*T, 1.0e-5*T)
l_P_Vdc = calc.avg_rms_2(t2, u2[:,col_P_Vdc], T, 2.0*T, 1.0e-5*T)
l_P_Vsa = calc.avg_rms_2(t2, u2[:,col_P_Vsa], T, 2.0*T, 1.0e-5*T)
l_ID1 = calc.avg_rms_2(t1, u1[:,col_ID1 ], T, 2.0*T, 1.0e-5*T)
l_ILd = calc.avg_rms_2(t1, u1[:,col_ILd ], T, 2.0*T, 1.0e-5*T)
l_ISa = calc.avg_rms_2(t1, u1[:,col_ISa ], T, 2.0*T, 1.0e-5*T)
print('average value of v_pm:' , "%11.4E"%( l_v_o [1][0]))
print('rms value of v_pm:' , "%11.4E"%( l_v_o [2][0]))
print('rms value of ID1:' , "%11.4E"%( l_ID1 [2][0]))
print('rms value of ISa:' , "%11.4E"%( l_ISa [2][0]))
print('average value of ILd:' , "%11.4E"%( l_ILd [1][0]))
print('average power delivered to Vdc:', "%11.4E"%(-l_P_Vdc[1][0]))
print('average power delivered by Vsa:', "%11.4E"%( l_P_Vsa[1][0]))
# time instants when the diode current crosses 1.0e-6:
l_cross_1_ID1, l_cross_2_ID1 = calc.cross_over_points_1(t1, u1[:,col_ID1], 0.0, T, 1.0e-6)
print('zero-crossing points of D1 current (positive slope):')
for tx in l_cross_1_ID1:
print(" ", "%11.4E"%tx)
print('zero-crossing points of D1 current (negative slope):')
for tx in l_cross_2_ID1:
print(" ", "%11.4E"%tx)
theta = (l_cross_2_ID1[0]-l_cross_1_ID1[0])*360.0/T
print('angle of conduction for D1:', "%11.4E"%theta)
color1='red'
color2='goldenrod'
color3='blue'
color4='green'
color5='crimson'
color6='cornflowerblue'
fig, ax = plt.subplots(3, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5.5, 6, ax[0])
for i in range(3):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
#ax[0].tick_params(labelbottom=False)
#ax[1].tick_params(labelbottom=False)
#ax[2].tick_params(labelbottom=False)
ax[0].plot(t1*1e3, u1[:,col_v_o], color=color4, linewidth=1.0, label="$v_o$")
ax[1].plot(t1*1e3, u1[:,col_ID1], color=color1, linewidth=1.0, label="$I_{D1}$")
ax[1].plot(t1*1e3, u1[:,col_ID3], color=color2, linewidth=1.0, label="$I_{D3}$")
ax[1].plot(t1*1e3, u1[:,col_ID5], color=color3, linewidth=1.0, label="$I_{D5}$")
ax[2].plot(t1*1e3, u1[:,col_ISa], color=color1, linewidth=1.0, label="$I_{sa}$")
ax[2].plot(t1*1e3, u1[:,col_ISb], color=color2, linewidth=1.0, label="$I_{sb}$")
ax[2].plot(t1*1e3, u1[:,col_ISc], color=color3, linewidth=1.0, label="$I_{sc}$")
ax[2].set_xlabel('time (msec)', fontsize=12)
for i in range(3):
ax[i].legend(loc = 'lower right',frameon = True, fontsize = 10, title = None,
markerfirst = True, markerscale = 1.0, labelspacing = 0.5, columnspacing = 2.0,
prop = {'size' : 12},)
plt.tight_layout()
plt.show()
filename: rectifier_3ph_9_1.dat filename: rectifier_3ph_9_2.dat average value of v_pm: 4.0009E+02 rms value of v_pm: 4.0716E+02 rms value of ID1: 5.0050E+01 rms value of ISa: 7.0781E+01 average value of ILd: 9.3357E+01 average power delivered to Vdc: 3.7343E+04 average power delivered by Vsa: 1.2483E+04 zero-crossing points of D1 current (positive slope): 1.7400E-03 zero-crossing points of D1 current (negative slope): 1.1740E-02 angle of conduction for D1: 1.8000E+02
import numpy as np
import matplotlib.pyplot as plt
import gseim_calc as calc
from setsize import set_size
f_hz = 50.0
T = 1.0/f_hz
slv = calc.slv("rectifier_3ph_9.in")
i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
col_v_o = slv.get_index(i_slv,i_out,"v_o")
col_ID1 = slv.get_index(i_slv,i_out,"ID1")
col_ID2 = slv.get_index(i_slv,i_out,"ID2")
col_ID3 = slv.get_index(i_slv,i_out,"ID3")
col_ID4 = slv.get_index(i_slv,i_out,"ID4")
col_ID5 = slv.get_index(i_slv,i_out,"ID5")
col_ID6 = slv.get_index(i_slv,i_out,"ID6")
col_ISa = slv.get_index(i_slv,i_out,"ISa")
col_ISb = slv.get_index(i_slv,i_out,"ISb")
col_ISc = slv.get_index(i_slv,i_out,"ISc")
col_ILd = slv.get_index(i_slv,i_out,"ILd")
# compute Fourier coeffs:
t_start = T
t_end = 2.0*T
n_fourier = 20
coeff_ISa, thd_ISa = calc.fourier_coeff_1C(t1, u1[:,col_ISa],
t_start, t_end, 1.0e-8, n_fourier)
coeff_v_o, thd_v_o = calc.fourier_coeff_1C(t1, u1[:,col_v_o],
t_start, t_end, 1.0e-8, n_fourier)
print('THD in ac line current:', "%5.2f"%(thd_ISa*100.0), "%")
print("ac line current fundamental: RMS value: ", "%11.4E"%(coeff_ISa[1]/np.sqrt(2.0)))
x = np.linspace(0, n_fourier, n_fourier+1)
y_v_o = np.array(coeff_v_o)
y_ISa = np.array(coeff_ISa)
fig, ax = plt.subplots(2, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
grid_color='#CCCCCC'
set_size(6, 4, ax[0])
delta = 5.0
x_major_ticks = np.arange(0.0, (float(n_fourier+1)), delta)
x_minor_ticks = np.arange(0.0, (float(n_fourier+1)), 1.0)
for i in range(2):
ax[i].set_xlim(left=-1.0, right=float(n_fourier))
ax[i].set_xticks(x_major_ticks)
ax[i].set_xticks(x_minor_ticks, minor=True)
ax[i].grid(visible=True, which='major', axis='x', color=grid_color, linestyle='-', zorder=0)
ax[0].set_ylabel('$V_{out}$',fontsize=14)
ax[1].set_ylabel('$i_{sa}$',fontsize=14)
bars1 = ax[0].bar(x, y_v_o, width=0.3, color='red', label="$v_o$", zorder=3)
bars2 = ax[1].bar(x, y_ISa , width=0.3, color='green', label="$i_{sa}$" , zorder=3)
plt.tight_layout()
plt.show()
filename: rectifier_3ph_9_1.dat THD in ac line current: 9.37 % ac line current fundamental: RMS value: 7.0472E+01
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.