Solar module I-V
The following table gives the parameters of a solar panel.Parameter | Value |
---|---|
$P_{max}$ (W) | 320 |
Voltage at $P_{max}$ (V) | 33.4 |
Current at $P_{max}$ (A) | 9.59 |
$V_{OC}$ at STC (V) | 40.9 |
$I_{SC}$ at STC (A) | 10.15 |
Temperature coefficient for $I_{SC}$ ($\%/^oC$) | 0.058 |
Temperature coefficient for $V_{OC}$ ($\%/^oC$) | -0.32 |
Number of cells in series ($N_C$) | 60 |
The solar panel, operating at Standard Test Conditions (STC), is connected to a resistive load with $R = 1\,\Omega$ through a buck converter as shown in the figure. The parameters of the boost converter are $L = 10\,$mH, $C = C_{in} = 1000\,\mu$F, $f_s = 10\,$kHz. Determine the following.
- the duty ratio of the buck converter for transferring maximum power from the solar panel to the load.
- the average load voltage.
from IPython.display import Image
Image(filename =r'solar_3_fig_1.png', width=350)
# run this cell to view the circuit file.
%pycat solar_3_orig.in
We now replace the strings such as \$Voc_ref with the values of our choice by running the python script given below. It takes an existing circuit file solar_3_orig.in and produces a new circuit file solar_3.in, after replacing \$Voc_ref, etc. with values of our choice.
import gseim_calc as calc
s_g_rad = '1000'
s_t_C = '25'
s_Nc = '60'
s_Voc_ref = '40.9'
s_Isc_ref = '10.15'
s_Vm_ref = '33.4'
s_Im_ref = '9.59'
s_coef_Isc = '0.058'
s_coef_Voc = '-0.32'
s_L = '10e-3'
s_C = '1000e-6'
s_R = '1'
s_D = '0.4' # to be changed by user
l = [
('$g_rad', s_g_rad),
('$t_C', s_t_C),
('$Nc', s_Nc),
('$Voc_ref', s_Voc_ref),
('$Isc_ref', s_Isc_ref),
('$Vm_ref', s_Vm_ref),
('$Im_ref', s_Im_ref),
('$coef_Isc', s_coef_Isc),
('$coef_Voc', s_coef_Voc),
('$L', s_L),
('$C', s_C),
('$R', s_R),
('$D', s_D),
]
calc.replace_strings_1("solar_3_orig.in", "solar_3.in", l)
print('solar_3.in is ready for execution')
solar_3.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("solar_3.in")
os.system('run_gseim solar_3.in')
Circuit: filename = solar_3.in main: i_solve = 0 main: calling solve_trns mat_ssw_1_ex: n_statevar: 7 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=0, rhs_ssw_norm=2.4125e-03 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=1, rhs_ssw_norm=1.5741e-02 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=2, rhs_ssw_norm=1.3097e-03 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=3, rhs_ssw_norm=1.2480e-04 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=4, rhs_ssw_norm=2.2932e-06 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=5, rhs_ssw_norm=9.0545e-10 Transient simulation starts... i=0 solve_ssw_ex: ssw_iter_newton=6, rhs_ssw_norm=4.7006e-15 solve_ssw_ex: calling solve_ssw_1_ex for one more trns step Transient simulation starts... i=0 solve_ssw_1_ex over (after trns step for output) solve_ssw_ex ends, slv.ssw_iter_newton=6 GSEIM: Program completed.
0
The circuit file (solar_3.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on solar_3.in) creates a data file called solar_3.dat 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 = 10.0e3
T = 1.0/f_hz
slv = calc.slv("solar_3.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_IL = slv.get_index(i_slv,i_out,"IL")
col_v_out = slv.get_index(i_slv,i_out,"v_out")
col_P_R = slv.get_index(i_slv,i_out,"P_R")
col_Psrc = slv.get_index(i_slv,i_out,"Psrc")
l_v_out = calc.avg_rms_2(t, u[:,col_v_out], 0.0, 2.0*T, 1.0e-4*T)
l_P_R = calc.avg_rms_2(t, u[:,col_P_R ], 0.0, 2.0*T, 1.0e-4*T)
l_Psrc = calc.avg_rms_2(t, u[:,col_Psrc ], 0.0, 2.0*T, 1.0e-4*T)
t_v_out = np.array(l_v_out[0])
t_P_R = np.array(l_P_R[0])
t_Psrc = np.array(l_Psrc[0])
print('average voltage across R:', "%11.4E"%(l_v_out[1][0]))
print('average power delivered to R:', "%11.4E"%(l_P_R[1][0]))
color1 = 'blue'
color2 = 'green'
color3 = 'red'
color4 = 'dodgerblue'
color5 = 'olive'
fig, ax = plt.subplots(3, sharex=False, gridspec_kw={'height_ratios': [1, 1, 2]})
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5.5, 7, ax[0])
for i in range(3):
ax[i].set_xlim(left=0.0, right=2.0*T*1e6)
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].set_ylabel(r'$V_o$', fontsize=12)
ax[1].set_ylabel(r'$I_L$', fontsize=12)
ax[2].set_ylabel('Power ', fontsize=12)
for i in range(2):
ax[i].tick_params(labelbottom=False)
ax[0].plot(t*1e6, u[:,col_v_out], color=color1, linewidth=1.0, label="$V_o$")
ax[1].plot(t*1e6, u[:,col_IL ], color=color2, linewidth=1.0, label="$I_L$")
ax[2].plot(t*1e6, u[:,col_P_R ], color=color3, linewidth=1.0, label="$P_R$")
ax[2].plot(t*1e6, u[:,col_Psrc ], color=color4, linewidth=1.0, label="$P_{PV}$")
ax[0].plot(t_v_out*1e6, l_v_out[1], color=color1, linewidth=1.0, label="$V_o^{avg}$", linestyle='--', dashes=(5,3))
ax[2].plot(t_P_R *1e6, l_P_R [1], color=color3, linewidth=1.0, label="$P_R^{avg}$", linestyle='--', dashes=(5,3))
ax[2].set_xlabel('time (' + r'$\mu$' + 'sec)', fontsize=12)
for k in [0,2]:
ax[k].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: solar_3.dat average voltage across R: 1.5094E+01 average power delivered to R: 2.2784E+02
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.