3-phase controlled rectifier
In the three-phase thyristor converter 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 line inductance between the converter and the AC source is $10\,mH$. The converter is operated at a firing angle of $30^{\circ}$. Determine the duration for which each thyristor conducts in a fundamental cycle of the input voltage.from IPython.display import Image
Image(filename =r'controlled_rectifier_3ph_4_fig_1.png', width=470)
# run this cell to view the circuit file.
%pycat controlled_rectifier_3ph_4_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_4_orig.in and produces a new circuit file controlled_rectifier_3ph_4.in, after replacing \$alpha (etc) with values of our choice.
import gseim_calc as calc
import numpy as np
s_alpha = "30"
s_L = "10e-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_4_orig.in", "controlled_rectifier_3ph_4.in", l)
print('controlled_rectifier_3ph_4.in is ready for execution')
controlled_rectifier_3ph_4.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("controlled_rectifier_3ph_4.in")
os.system('run_gseim controlled_rectifier_3ph_4.in')
get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = controlled_rectifier_3ph_4.in Circuit: n_xbeu_vr = 6 Circuit: n_ebeu_nd = 9 main: i_solve = 0 ssw_allocate_1 (2): n_statevar=3 main: calling solve_trns mat_ssw_1_ex: n_statevar: 3 mat_ssw_1_e0: cct.n_ebeu: 17 Transient simulation starts... i=0 i=1000 i=2000 solve_ssw_ex: ssw_iter_newton=0, rhs_ssw_norm=8.1650e+00 Transient simulation starts... i=0 i=1000 i=2000 solve_ssw_ex: ssw_iter_newton=1, 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_1_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_4.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_4.in) creates data files called controlled_rectifier_3ph_4_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_4.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]
col_v_o = slv.get_index(i_slv,i_out,"v_o")
col_Vab = slv.get_index(i_slv,i_out,"Vab")
col_Vbc = slv.get_index(i_slv,i_out,"Vbc")
col_Vca = slv.get_index(i_slv,i_out,"Vca")
i_out = 2
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u2 = np.loadtxt(filename)
t2 = u2[:, 0]
col_g1 = slv.get_index(i_slv,i_out,"g1")
col_g2 = slv.get_index(i_slv,i_out,"g2")
col_g3 = slv.get_index(i_slv,i_out,"g3")
col_g4 = slv.get_index(i_slv,i_out,"g4")
col_g5 = slv.get_index(i_slv,i_out,"g5")
col_g6 = slv.get_index(i_slv,i_out,"g6")
l_v_o = calc.avg_rms_2(t1, u1[:,col_v_o], 0, 2.0*T, 1.0e-5*T)
t_v_o = np.array(l_v_o[0])
print('average value of v_o:', "%11.4E"%l_v_o[1][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"
color5 = "grey"
color6 = "green"
color7 = "darkcyan"
ax[0].plot(t1*1e3, u1[:,col_Vab], color=color1, linewidth=1.0, label="$V_{ab}$")
ax[0].plot(t1*1e3, u1[:,col_Vbc], color=color2, linewidth=1.0, label="$V_{bc}$")
ax[0].plot(t1*1e3, u1[:,col_Vca], color=color3, linewidth=1.0, label="$V_{ca}$")
ax[0].plot(t1*1e3, u1[:,col_v_o], color=color4, linewidth=1.0, label="$v_o$")
ax[0].plot(t_v_o*1e3, l_v_o[1], color=color4, linewidth=1.0, label="$v_o^{avg}$", linestyle='--', dashes=(5,3))
ax[1].plot(t2*1e3, (u2[:,col_g1] ), color=color1, linewidth=1.0, label="$g_1$")
ax[1].plot(t2*1e3, (u2[:,col_g2] - 1.2), color=color2, linewidth=1.0, label="$g_2$")
ax[1].plot(t2*1e3, (u2[:,col_g3] - 2.4), color=color3, linewidth=1.0, label="$g_3$")
ax[1].plot(t2*1e3, (u2[:,col_g4] - 3.6), color=color5, linewidth=1.0, label="$g_4$")
ax[1].plot(t2*1e3, (u2[:,col_g5] - 4.8), color=color6, linewidth=1.0, label="$g_5$")
ax[1].plot(t2*1e3, (u2[:,col_g6] - 6.0), color=color7, linewidth=1.0, label="$g_6$")
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_4_2.dat filename: controlled_rectifier_3ph_4_3.dat average value of v_o: 4.1527E+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_4.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_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_IT1 = slv.get_index(i_slv,i_out,"IT1")
col_IT2 = slv.get_index(i_slv,i_out,"IT2")
col_IT3 = slv.get_index(i_slv,i_out,"IT3")
col_IT4 = slv.get_index(i_slv,i_out,"IT4")
col_IT5 = slv.get_index(i_slv,i_out,"IT5")
col_IT6 = slv.get_index(i_slv,i_out,"IT6")
# compute durations of diode conduction:
ndiv = 5000
delt_IT1, IT1p = calc.interp_linear_1(t1, u1[:,col_IT1], ndiv)
delt_IT2, IT2p = calc.interp_linear_1(t1, u1[:,col_IT1], ndiv)
delt_IT3, IT3p = calc.interp_linear_1(t1, u1[:,col_IT3], ndiv)
delt_IT4, IT4p = calc.interp_linear_1(t1, u1[:,col_IT4], ndiv)
delt_IT5, IT5p = calc.interp_linear_1(t1, u1[:,col_IT5], ndiv)
delt_IT6, IT6p = calc.interp_linear_1(t1, u1[:,col_IT6], ndiv)
n_IT1 = 0
n_IT2 = 0
n_IT3 = 0
n_IT4 = 0
n_IT5 = 0
n_IT6 = 0
i_small = 1.0e-2
for k in range(ndiv):
if (IT1p[k] > i_small): n_IT1 += 1
if (IT2p[k] > i_small): n_IT2 += 1
if (IT3p[k] > i_small): n_IT3 += 1
if (IT4p[k] > i_small): n_IT4 += 1
if (IT5p[k] > i_small): n_IT5 += 1
if (IT6p[k] > i_small): n_IT6 += 1
print('angle of conduction for T1:', float(n_IT1)*delt_IT1*360.0/(2.0*T), 'deg.')
print('angle of conduction for T2:', float(n_IT1)*delt_IT2*360.0/(2.0*T), 'deg.')
print('angle of conduction for T3:', float(n_IT1)*delt_IT3*360.0/(2.0*T), 'deg.')
print('angle of conduction for T4:', float(n_IT1)*delt_IT4*360.0/(2.0*T), 'deg.')
print('angle of conduction for T5:', float(n_IT1)*delt_IT5*360.0/(2.0*T), 'deg.')
print('angle of conduction for T6:', float(n_IT1)*delt_IT6*360.0/(2.0*T), 'deg.')
fig, ax = plt.subplots(7, sharex=False, gridspec_kw={'height_ratios': [1, 1, 1, 1, 1, 1, 2]})
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(6.5, 8, ax[0])
for i in range(7):
ax[i].set_xlim(left=0.0, right=2.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
for i in range(6):
ax[i].set_yticks([0.0, 10.0])
ax[i].set_ylim(bottom=-2.0, top=12.0)
ax[6].set_ylim(bottom=-12.0, top=12.0)
ax[0].set_ylabel(r'$I_{T1}$', fontsize=12)
ax[1].set_ylabel(r'$I_{T2}$', fontsize=12)
ax[2].set_ylabel(r'$I_{T3}$', fontsize=12)
ax[3].set_ylabel(r'$I_{T4}$', fontsize=12)
ax[4].set_ylabel(r'$I_{T5}$', fontsize=12)
ax[5].set_ylabel(r'$I_{T6}$', fontsize=12)
ax[6].set_ylabel(r'$I_{Sx}$', fontsize=12)
for k in range(6):
ax[k].tick_params(labelbottom=False)
color1 = "blue"
color2 = "red"
color3 = "green"
ax[0].plot(t1*1e3, (u1[:,col_IT1]), color=color1, linewidth=1.0, label="$I_{T1}$")
ax[1].plot(t1*1e3, (u1[:,col_IT2]), color=color1, linewidth=1.0, label="$I_{T2}$")
ax[2].plot(t1*1e3, (u1[:,col_IT3]), color=color1, linewidth=1.0, label="$I_{T3}$")
ax[3].plot(t1*1e3, (u1[:,col_IT4]), color=color1, linewidth=1.0, label="$I_{T4}$")
ax[4].plot(t1*1e3, (u1[:,col_IT5]), color=color1, linewidth=1.0, label="$I_{T5}$")
ax[5].plot(t1*1e3, (u1[:,col_IT6]), color=color1, linewidth=1.0, label="$I_{T6}$")
ax[6].plot(t1*1e3, (u1[:,col_ISa]), color=color1, linewidth=1.0, label="$I_{Sa}$")
ax[6].plot(t1*1e3, (u1[:,col_ISb]), color=color2, linewidth=1.0, label="$I_{Sb}$")
ax[6].plot(t1*1e3, (u1[:,col_ISc]), color=color3, linewidth=1.0, label="$I_{Sc}$")
ax[6].set_xlabel('time (msec)', fontsize=12)
ax[6].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_4_1.dat angle of conduction for T1: 131.328 deg. angle of conduction for T2: 131.328 deg. angle of conduction for T3: 131.328 deg. angle of conduction for T4: 131.328 deg. angle of conduction for T5: 131.328 deg. angle of conduction for T6: 131.328 deg.
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.