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 |
The solar panel is connected to a resistor as shown in the figure. Assume that the panel is operating at the Standard Test Conditions (STC).
- Plot the $I$-$V$ and $P$-$V$ curves.
- Determine the value of $R$ for maximum power transfer.
from IPython.display import Image
Image(filename =r'solar_1_fig_1.png', width=100)
# run this cell to view the circuit file.
%pycat solar_1_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_1_orig.in and produces a new circuit file solar_1.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'
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),
]
calc.replace_strings_1("solar_1_orig.in", "solar_1.in", l)
print('solar_1.in is ready for execution')
solar_1.in is ready for execution
import os
import dos_unix
# uncomment for windows:
#dos_unix.d2u("solar_1.in")
os.system('run_gseim solar_1.in')
Circuit: filename = solar_1.in main: i_solve = 0 GSEIM: Program completed.
0
The circuit file (solar_1.in) is created in the same directory as that used for launching Jupyter notebook. The last step (i.e., running GSEIM on solar_1.in) creates a data file called solar_1.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_1.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_p_module = slv.get_index(i_slv,i_out,"p_module")
col_r1 = slv.get_index(i_slv,i_out,"r1" )
col_v_p = slv.get_index(i_slv,i_out,"v_p" )
col_i1 = slv.get_index(i_slv,i_out,"i1" )
p_module = u[:, col_p_module]
r1 = u[:, col_r1 ]
v_p = u[:, col_v_p ]
i1 = u[:, col_i1 ]
p_max = np.max(p_module)
k_max = p_module.argmax()
r1_max_power = r1[k_max]
print('R for max power:', "%11.4E"%r1_max_power, "ohms")
print('max power:', "%11.4E"%p_max, "W")
color1='green'
color2='crimson'
color3='blue'
fig, ax = plt.subplots(3, sharex=False)
plt.subplots_adjust(wspace=0, hspace=0.0)
set_size(5.5, 7, ax[0])
for i in range(3):
ax[i].grid(color='#CCCCCC', linestyle='solid', linewidth=0.5)
ax[0].plot(v_p, i1 , color=color1, linewidth=1.0, label="$I_{module}$")
ax[1].plot(v_p, p_module, color=color2, linewidth=1.0, label="$P_{module}$")
ax[2].plot(r1 , p_module, color=color3, linewidth=1.0, label="$P_{module}$")
ax[0].set_ylabel(r'$I_{module}$', fontsize=12)
ax[1].set_ylabel(r'$P_{module}$', fontsize=12)
ax[2].set_ylabel(r'$P_{module}$', fontsize=12)
ax[0].set_xlabel('Voltage (V)' , fontsize=12)
ax[1].set_xlabel('Voltage (V)' , fontsize=12)
ax[2].set_xlabel(r'$R\,(\Omega)$', fontsize=12)
ax[0].set_xlim(left=0.0)
ax[1].set_xlim(left=0.0)
ax[2].set_xlim(left=0.0, right=20.0)
plt.tight_layout()
plt.show()
filename: solar_1.dat R for max power: 3.4282E+00 ohms max power: 3.2025E+02 W
This notebook was contributed by Prof. Nakul Narayanan K, Govt. Engineering College, Thrissur. He may be contacted at nakul@gectcr.ac.in.