Experimenting with shadow patterns and cell temperatures on a PV system

Pvmmxlsio was made for easy manual experimentation with different shadow patterns and temperature inputs on PVMismatch PV system models.

Importing necessary modules


In [6]:
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from pvmismatch.pvmismatch_lib import (pvcell, pvconstants, pvmodule,
                                       pvstring, pvsystem)

from pvmismatch.contrib import xlsio

PVMismatch

Defining cell, module and PV system parameters:


In [2]:
str_len = 6 # number of modules in a string
str_num = 3 # number of (parallel connected) strings in the array
v_bypass = np.float64(-0.5)  # [V] trigger voltage of bypass diode
cell_area = np.float64(246.49)  # [cm^2] cell area
Isc0_T0 = 9.68 # [A] reference short circuit current
ncols_per_substr=[2]*3 # 3 bypass diodes with 2 series connected cell-columns
nrows=10 # number of cell rows in the module

Building a PV system in PVMismatch:


In [3]:
pv_mod_pattern = pvmodule.standard_cellpos_pat(nrows=nrows,
                                            ncols_per_substr=ncols_per_substr)
pv_mod = pvmodule.PVmodule(cell_pos=pv_mod_pattern, pvcells=None,
                           pvconst=None, Vbypass=v_bypass, cellArea=cell_area)
pv_cells = pv_mod.pvcells
for c in pv_cells:
    c.update(Isc0_T0 = Isc0_T0) # updating short circuit currents
pv_mod.setSuns(cells=list(range(0, len(pv_cells))), Ee=[1]*len(pv_cells))
pv_str = pvstring.PVstring(numberMods=str_len, pvmods=[pv_mod]*str_len)
pv_sys = pvsystem.PVsystem(numberStrs=str_num, pvstrs=[pv_str]*str_num,
                           numberMods=[str_len]*str_num,
                           pvmods=[pv_mod]*str_len)

PVMismatch xls I/O

Creating a human-readable xls of the PV system layout with the PV cell indexes, irradiances and temperatures with pvmmxlsio. Also calculating the PV system power with PVMismatch using the default 1000 W/m2 irradiance.


In [4]:
output_xls_name=r'ExcelLayoutFromPVMM.xlsx' # the mod. & sys. layout in xls
xlsio.system_layout_to_xls(output_xls_name, pv_sys, write_bpd_act=False)
print('PV power with 1 suns: ', pv_sys.calcSystem()[2].max(), ' [W]')
plot = pv_sys.plotSys()
plt.show(block=False)


PV power with 1 suns:  5559.749365010059  [W]

Now let's change the Irradiance in the xls files and save them with a different name. I have already done it, see ExcelLayoutFromPVMM_input_1-6.xlsx files.

  • The 3 yellow columns are the 3 PV strings we defined earlier.
  • Each cell in the xls file is a PV cell
  • Labels for PV modules (in the xls files):
    • Rows: m_cr, where m is the number of the given module within the string and cr is the cell row within the module
    • Columns: s_b_cc, where s is the number of the string in the PV system, b is the number of the bypass diode in the module and cc is the number of the PV cell column within a PV module substring. Therefore a cell with the labels "2_7" (m_cr) and "1_2_1" (s_b_cc) is a PV cell in the 8th cell row of the second column of the 3rd bypass diode of the 3rd module of the 2nd string (everything is zero-indexed).

Now we can read in the irradiance patterns we made and calculate the PV system power with PVMismatch:


In [5]:
for i in list(range(1,7)):
    input_xls_name=r'ExcelLayoutFromPVMM_input{}.xlsx'.format(i)
    xlsio.set_input_from_xls(input_xls_name, pv_sys, str_num, str_len)
    print('PV power with irradiances read in from {}: '.format(input_xls_name),
          pv_sys.calcSystem()[2].max(), ' [W]')
    # updating the input excel with the bypass diode activation
    xlsio.system_layout_to_xls(output_xls_name=input_xls_name, pv_sys=pv_sys,
                               write_bpd_act=True)
    pv_sys.plotSys()
    plt.show(block=False)


PV power with irradiances read in from ExcelLayoutFromPVMM_input1.xlsx:  5559.749365010059  [W]
5559.176015723298
PV power with irradiances read in from ExcelLayoutFromPVMM_input2.xlsx:  4589.703082294068  [W]
4589.4993991509145
PV power with irradiances read in from ExcelLayoutFromPVMM_input3.xlsx:  5494.8980446173055  [W]
5494.607459726416
PV power with irradiances read in from ExcelLayoutFromPVMM_input4.xlsx:  4807.183546159309  [W]
4790.723835004662
PV power with irradiances read in from ExcelLayoutFromPVMM_input5.xlsx:  4355.076326122976  [W]
4324.323103173466
PV power with irradiances read in from ExcelLayoutFromPVMM_input6.xlsx:  4086.3438024494053  [W]
4084.892092506256

Now if we open the xls files again, we will see that the indication of bypass diode activation and reverse-biased cells is also exported to the xls files. Bypassed cells are indicated with blue and reverse biased cells are indicated with red, as shown below:


In [ ]: