Solar module I-V
The parameters of a solar panel are given in the table below.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 |
Two such panels, along with bypass diodes (assumed to be ideal), are connected in series as shown in the figure. The irradiation for PV1 is $1000\,$W/m$^2$ and that for PV2 is $500\,$W/m$^2$. Determine the following.
- currents through the panels PV1 and PV2.
- currents through the bypass diodes $D_1$ and $D_2$.
from IPython.display import Image
Image(filename =r'solar_4_fig_1.png', width=140)
# run this cell to view the circuit file.
%pycat solar_4_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_4_orig.in and produces a new circuit file solar_4.in, after replacing \$Voc_ref, etc. with values of our choice.
import gseim_calc as calc
s_g_rad_1 = '1000'
s_g_rad_2 = '500'
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'
l = [
('$g_rad_1', s_g_rad_1),
('$g_rad_2', s_g_rad_2),
('$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),
]
calc.replace_strings_1("solar_4_orig.in", "solar_4.in", l)
print('solar_4.in is ready for execution')
solar_4.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("solar_4.in")
os.system('run_gseim solar_4.in')
Circuit: filename = solar_4.in main: i_solve = 0 GSEIM: Program completed.
0
The circuit file (solar_4.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on solar_4.in) creates a data file called solar_4.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
slv = calc.slv("solar_4.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_i1 = slv.get_index(i_slv,i_out,"i1")
col_i2 = slv.get_index(i_slv,i_out,"i2")
col_ID1 = slv.get_index(i_slv,i_out,"ID1")
col_ID2 = slv.get_index(i_slv,i_out,"ID2")
col_p1 = slv.get_index(i_slv,i_out,"p1")
col_p2 = slv.get_index(i_slv,i_out,"p2")
col_v_p = slv.get_index(i_slv,i_out,"v_p")
p_total = u[:,col_p1] + u[:,col_p2]
v_p = u[:,col_v_p]
i1_sc = u[:,col_i1][0]
i2_sc = u[:,col_i2][0]
ID1_sc = u[:,col_ID1][0]
ID2_sc = u[:,col_ID2][0]
print('IPV1 at V=0:', "%7.3f"%i1_sc, "A")
print('IPV2 at V=0:', "%7.3f"%i2_sc, "A")
print('ID1 at V=0:', "%7.3f"%ID1_sc, "A")
print('ID2 at V=0:', "%7.3f"%ID2_sc, "A")
color1 = 'green'
color2 = 'crimson'
color3 = 'blue'
color4 = 'royalblue'
color5 = 'goldenrod'
color6 = 'red'
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])
ax[0].plot(v_p, u[:,col_i1 ], color=color1, linewidth=1.0, label="$I_{PV1}$")
ax[0].plot(v_p, u[:,col_i2 ], color=color5, linewidth=1.0, label="$I_{PV2}$")
ax[1].plot(v_p, u[:,col_ID1], color=color2, linewidth=1.0, label="$I_{D1}$")
ax[1].plot(v_p, u[:,col_ID2], color=color4, linewidth=1.0, label="$I_{D2}$")
ax[2].plot(v_p, u[:,col_p1] , color=color1, linewidth=1.0, label="$P_{PV1}$")
ax[2].plot(v_p, u[:,col_p2] , color=color5, linewidth=1.0, label="$P_{PV2}$")
ax[2].plot(v_p, p_total , color=color4, linewidth=1.0, label="$P_{total}$")
ax[0].set_ylabel(r'$I_{module}$ (A)', fontsize=12)
ax[1].set_ylabel(r'$I_{diode} (A)$' , fontsize=12)
ax[2].set_ylabel('Power (W)' , fontsize=12)
for i in range(2):
ax[i].tick_params(labelbottom=False)
for i in range(3):
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[i].set_xlim(left=0.0)
ax[0].legend(loc = 'upper right',frameon = True, fontsize = 10, title = None,
markerfirst = True, markerscale = 1.0, labelspacing = 0.5, columnspacing = 2.0,
prop = {'size' : 12},)
ax[1].legend(loc = 'upper right',frameon = True, fontsize = 10, title = None,
markerfirst = True, markerscale = 1.0, labelspacing = 0.5, columnspacing = 2.0,
prop = {'size' : 12},)
ax[2].legend(loc = 'upper left',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_4.dat IPV1 at V=0: 10.150 A IPV2 at V=0: 5.075 A ID1 at V=0: -0.000 A ID2 at V=0: 5.075 A
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.