3-phase controlled rectifier
In the three-phase thyristor rectifier circuit given below, $v_a=220\sqrt 2 \sin(\omega t)$, $v_b=220\sqrt 2 \sin(\omega t-120^\circ)$, and $v_c=220\sqrt 2 \sin(\omega t+120^\circ)$. The converter is operated at a firing angle of $30^{\circ}$. Determine the duration for which each diode will be reverse biased in a fundamental cycle of the input voltage.from IPython.display import Image
Image(filename =r'controlled_rectifier_3ph_7_fig_1.png', width=420)
# run this cell to view the circuit file.
%pycat controlled_rectifier_3ph_7_orig.in
We now replace the strings such as \$alpha with the values of our choice by running the python script given below. It takes an existing circuit file controlled_rectifier_3ph_7_orig.in and produces a new circuit file controlled_rectifier_3ph_7.in, after replacing \$alpha (etc) with values of our choice.
import gseim_calc as calc
import numpy as np
s_alpha = "30"
s_L = "20e-3"
A_sin = 220.0*np.sqrt(2.0)
s_A_sin = ("%11.4E"%(A_sin)).strip()
l = [
('$alpha', s_alpha),
('$L', s_L),
('$A_sin', s_A_sin),
]
calc.replace_strings_1("controlled_rectifier_3ph_7_orig.in", "controlled_rectifier_3ph_7.in", l)
print('controlled_rectifier_3ph_7.in is ready for execution')
controlled_rectifier_3ph_7.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("controlled_rectifier_3ph_7.in")
os.system('run_gseim controlled_rectifier_3ph_7.in')
Circuit: filename = controlled_rectifier_3ph_7.in main: i_solve = 0 main: calling solve_ssw mat_ssw_1_ex: n_statevar: 3 Transient simulation starts... i=0 i=1000 i=2000 solve_ssw_ex: ssw_iter_newton=0, ssw_period_1_compute=4.0000e-02, rhs_ssw_norm=5.7735e+00 Transient simulation starts... i=0 i=1000 i=2000 solve_ssw_ex: ssw_iter_newton=1, ssw_period_1_compute=4.0000e-02, rhs_ssw_norm=0.0000e+00 solve_ssw_ex: calling solve_ssw_1_ex for one more trns step Transient simulation starts... i=0 i=1000 i=2000 solve_ssw_ex over (after trns step for output) solve_ssw_ex ends, slv.ssw_iter_newton=1 GSEIM: Program completed.
0
The circuit file (controlled_rectifier_3ph_7.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on controlled_rectifier_3ph_7.in) creates data files called controlled_rectifier_3ph_7_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("controlled_rectifier_3ph_7.in")
i_slv = 0
i_out = 1
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u1 = np.loadtxt(filename)
t1 = u1[:, 0]
v_o = slv.get_array_double(i_slv,i_out,"v_o",u1)
VSa = slv.get_array_double(i_slv,i_out,"VSa",u1)
VSb = slv.get_array_double(i_slv,i_out,"VSb",u1)
VSc = slv.get_array_double(i_slv,i_out,"VSc",u1)
i_out = 2
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u2 = np.loadtxt(filename)
t2 = u2[:, 0]
ga = slv.get_array_double(i_slv,i_out,"ga",u2)
gb = slv.get_array_double(i_slv,i_out,"gb",u2)
gc = slv.get_array_double(i_slv,i_out,"gc",u2)
l_v_o = calc.avg_rms_3a(t1, v_o, 0, 2.0*T, 1.0e-5*T)
print('average value of v_o:', "%11.4E"%l_v_o[0])
fig, ax = plt.subplots(2, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 7, ax[0])
for i in range(2):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].set_ylabel(r'voltage', fontsize=12)
ax[1].set_ylabel(r'$g_x$' , fontsize=12)
ax[0].tick_params(labelbottom=False)
color1 = "tomato"
color2 = "dodgerblue"
color3 = "olive"
color4 = "blue"
ax[0].plot(t1*1e3, VSa, color=color1, linewidth=1.0, label="$V_{Sa}$")
ax[0].plot(t1*1e3, VSb, color=color2, linewidth=1.0, label="$V_{Sb}$")
ax[0].plot(t1*1e3, VSc, color=color3, linewidth=1.0, label="$V_{Sc}$")
ax[0].plot(t1*1e3, v_o, color=color4, linewidth=1.0, label="$v_o$")
ax[0].axhline(y=l_v_o[0], color=color4, linewidth=1.0, label="$v_o^{avg}$", linestyle='--', dashes=(5,3))
ax[1].plot(t2*1e3, (ga ), color=color1, linewidth=1.0, label="$g_a$")
ax[1].plot(t2*1e3, (gb - 1.2), color=color2, linewidth=1.0, label="$g_b$")
ax[1].plot(t2*1e3, (gc - 2.4), color=color3, linewidth=1.0, label="$g_c$")
ax[1].set_xlabel('time (msec)', fontsize=12)
ax[1].tick_params(left = False)
ax[1].set_yticks([])
for i in range(2):
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: controlled_rectifier_3ph_7_2.dat filename: controlled_rectifier_3ph_7_3.dat average value of v_o: 1.9264E+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("controlled_rectifier_3ph_7.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]
ITa = slv.get_array_double(i_slv,i_out,"ITa",u1)
ITb = slv.get_array_double(i_slv,i_out,"ITb",u1)
ITc = slv.get_array_double(i_slv,i_out,"ITc",u1)
fig, ax = plt.subplots(3, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 4, 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[i].set_yticks([0.0, 10.0])
ax[i].set_ylim(bottom=-2.0, top=12.0)
ax[0].set_ylabel(r'$I_{Ta}$', fontsize=12)
ax[1].set_ylabel(r'$I_{Tb}$', fontsize=12)
ax[2].set_ylabel(r'$I_{Tc}$', fontsize=12)
for k in range(2):
ax[k].tick_params(labelbottom=False)
color1 = "blue"
ax[0].plot(t1*1e3, ITa, color=color1, linewidth=1.0, label="$I_{Ta}$")
ax[1].plot(t1*1e3, ITb, color=color1, linewidth=1.0, label="$I_{Tb}$")
ax[2].plot(t1*1e3, ITc, color=color1, linewidth=1.0, label="$I_{Tc}$")
#plt.tight_layout()
plt.show()
filename: controlled_rectifier_3ph_7_1.dat
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("controlled_rectifier_3ph_7.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]
ITa = slv.get_array_double(i_slv,i_out,"ITa",u1)
v_Ta = slv.get_array_double(i_slv,i_out,"v_Ta",u1)
v_Tb = slv.get_array_double(i_slv,i_out,"v_Tb",u1)
v_Tc = slv.get_array_double(i_slv,i_out,"v_Tc",u1)
# compute durations of reverse bias:
ndiv = 5000
delt_v_Ta, v_Tap = calc.interp_linear_1(t1, v_Ta, ndiv)
delt_v_Tb, v_Tbp = calc.interp_linear_1(t1, v_Tb, ndiv)
delt_v_Tc, v_Tcp = calc.interp_linear_1(t1, v_Tc, ndiv)
n_v_Ta = 0
n_v_Tb = 0
n_v_Tc = 0
for k in range(ndiv):
if (v_Tap[k] < 0.0): n_v_Ta += 1
if (v_Tbp[k] < 0.0): n_v_Tb += 1
if (v_Tcp[k] < 0.0): n_v_Tc += 1
print('angle of reverse bias for Ta:', "%7.2f"%(float(n_v_Ta)*delt_v_Ta*360.0/(2.0*T)), 'deg.')
print('angle of reverse bias for Tb:', "%7.2f"%(float(n_v_Tb)*delt_v_Tb*360.0/(2.0*T)), 'deg.')
print('angle of reverse bias for Tc:', "%7.2f"%(float(n_v_Tc)*delt_v_Tc*360.0/(2.0*T)), 'deg.')
fig, ax = plt.subplots(2, sharex=False, gridspec_kw={'height_ratios': [1, 2]})
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 3, ax[0])
for i in range(2):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].set_yticks([0.0, 10.0])
ax[0].set_ylim(bottom=-2.0, top=12.0)
ax[0].tick_params(labelbottom=False)
ax[0].set_ylabel(r'$I_{Ta}$', fontsize=12)
ax[1].set_ylabel(r'$V_{Ta}$', fontsize=12)
color1 = "blue"
color2 = "red"
ax[0].plot(t1*1e3, ITa , color=color1, linewidth=1.0, label="$I_{Ta}$")
ax[1].plot(t1*1e3, v_Ta, color=color2, linewidth=1.0, label="$V_{Ta}$")
ax[1].set_xlabel('time (msec)', fontsize=12)
#plt.tight_layout()
plt.show()
filename: controlled_rectifier_3ph_7_1.dat angle of reverse bias for Ta: 189.50 deg. angle of reverse bias for Tb: 189.65 deg. angle of reverse bias for Tc: 189.50 deg.
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.