1-ph controlled rectifier
A single-phase half-controlled converter shown in the figure is connected to a constant current load. The supply voltage is $100\,\sin(100\,\pi\,t)$. The converter is operating at a firing angle of $\alpha$. If the firing pulses to the thyristor are suddenly removed, determine the steady-state average voltage across the load.In [1]:
from IPython.display import Image
Image(filename =r'controlled_rectifier_1ph_4_fig_1.png', width=250)
Out[1]:
In [2]:
# run this cell to view the circuit file.
%pycat controlled_rectifier_1ph_4_orig.in
Execute the following cell to run GSEIM on controlled_rectifier_1ph_4.in.
In [3]:
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("controlled_rectifier_1ph_4_orig.in")
os.system('run_gseim controlled_rectifier_1ph_4_orig.in')
get_lib_elements: filename gseim_aux/xbe.aux get_lib_elements: filename gseim_aux/ebe.aux Circuit: filename = controlled_rectifier_1ph_4_orig.in Circuit: n_xbeu_vr = 5 Circuit: n_ebeu_nd = 4 main: i_solve = 0 main: calling solve_trns Transient simulation starts... i=0 check_spice_e: i_ebeu: 1, i: 0, norm_spice_cur_nd: 5.0000e+10 is too large. i=1000 i=2000 i=3000 i=4000 i=5000 solve_trns_exc completed. GSEIM: Program completed.
Out[3]:
0
The last step (i.e., running GSEIM on controlled_rectifier_1ph_4_orig.in) creates a data file called controlled_rectifier_1ph_4.dat in the directory from which Jupyter was launched. We can now use the python code below to compute/plot the various quantities of interest.
In [4]:
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_1ph_4_orig.in")
i_slv = 0
i_out = 0
filename = slv.l_filename_all[i_slv][i_out]
print('filename:', filename)
u = np.loadtxt(filename)
t = u[:, 0]
col_v_s = slv.get_index(i_slv,i_out,"v_s")
col_v_o = slv.get_index(i_slv,i_out,"v_o")
col_g1 = slv.get_index(i_slv,i_out,"g1")
col_g2 = slv.get_index(i_slv,i_out,"g2")
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_ID4 = slv.get_index(i_slv,i_out,"ID4")
l_v_o_1 = calc.avg_rms_2(t, u[:,col_v_o], 0.0 , 2.0*T, 1.0e-5*T)
l_v_o_2 = calc.avg_rms_2(t, u[:,col_v_o], 2.0*T, 4.0*T, 1.0e-5*T)
l_v_o = []
for k in range(3):
l_v_o.append(l_v_o_1[k] + l_v_o_2[k])
t_v_o = np.array(l_v_o[0])
print('average value of v_o with gate pulses:', "%11.4E"%l_v_o_1[1][0])
print('average value of v_o without gate pulses:', "%11.4E"%l_v_o_2[1][0])
color1='blue'
color2='green'
color3='red'
color4='dodgerblue'
fig, ax = plt.subplots(8, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5.5, 12, ax[0])
for i in range(8):
ax[i].set_xlim(left=0.0, right=4.0*T*1e3)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].set_ylabel(r'$v_s$', fontsize=12)
ax[1].set_ylabel(r'$g_1$', fontsize=12)
ax[2].set_ylabel(r'$g_2$', fontsize=12)
ax[3].set_ylabel(r'$v_o$', fontsize=12)
ax[4].set_ylabel(r'$I_{T1}$', fontsize=12)
ax[5].set_ylabel(r'$I_{T2}$', fontsize=12)
ax[6].set_ylabel(r'$I_{T3}$', fontsize=12)
ax[7].set_ylabel(r'$I_{D4}$', fontsize=12)
ax[1].set_yticks([0.0, 1.0])
ax[2].set_yticks([0.0, 1.0])
for k in range(7):
ax[k].tick_params(labelbottom=False)
ax[0].plot(t*1e3, u[:,col_v_s], color=color1, linewidth=1.0, label="$v_s$")
ax[1].plot(t*1e3, u[:,col_g1 ], color=color2, linewidth=1.0, label="$g_1$")
ax[2].plot(t*1e3, u[:,col_g2 ], color=color2, linewidth=1.0, label="$g_2$")
ax[3].plot(t*1e3, u[:,col_v_o], color=color3, linewidth=1.0, label="$v_o$")
ax[3].plot(t_v_o*1e3, l_v_o[1], color=color3, linewidth=1.0, label="$v_o^{avg}$", linestyle='--', dashes=(5,3))
ax[4].plot(t*1e3, u[:,col_IT1], color=color4, linewidth=1.0, label="$I_{T1}$")
ax[5].plot(t*1e3, u[:,col_IT2], color=color4, linewidth=1.0, label="$I_{T2}$")
ax[6].plot(t*1e3, u[:,col_IT3], color=color4, linewidth=1.0, label="$I_{T3}$")
ax[7].plot(t*1e3, u[:,col_ID4], color=color4, linewidth=1.0, label="$I_{D4}$")
ax[7].set_xlabel('time (msec)', fontsize=12)
ax[3].legend(loc = 'upper 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_1ph_4.dat average value of v_o with gate pulses: 5.7245E+01 average value of v_o without gate pulses: -2.0000E-02
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.
In [ ]: