Hi SAM Wizards,
I am currently working with the PVlib library in a Python project. At the moment I am using the following code to read in, for example, parameters of modules from the Sandia Module database.
"""
Tool to save parameters of given inverters and pv modules in a json file
which are needed for calculations in photovoltaics.py.
"""
import os
import pvlib
MODULE_NAME = 'Entech_22X_Concentrator___1994_'
INVERTER_NAME = 'ABB__MICRO_0_25_I_OUTD_US_208__208V_'
SANDIA_MOD = 'SandiaMod'
CEC_INVERTER = 'cecinverter'
def _get_module_parameters(module_name=MODULE_NAME, sandia_mod=SANDIA_MOD):
"""Create a json file with pv module parameters."""
sandia_modules = pvlib.pvsystem.retrieve_sam(sandia_mod)
module_ser = sandia_modules[module_name]
module_ser.to_json(f'{module_name}.json')
def _get_inverter_parameters(inverter_name=INVERTER_NAME, cec_inverter=CEC_INVERTER):
"""Creates a json file with inverter parameters based on the Sandia Array
Performance Mode"""
sapm_inverters = pvlib.pvsystem.retrieve_sam(CEC_INVERTER)
inverter_ser = sapm_inverters[inverter_name]
inverter_ser.to_json(f'{inverter_name}.json')
The database is not freuqently updated, which comes to my question. I would like to be able to add PV Modules on my own, which may be missing in the database so far. Though the PV Modules in the database contain parameters such as airmass coefficients a
0 - a
4 and angle of incidence coefficients b
0 - b
4 . These are needed for PVlib to calculate the following equations
f
1(AM
a) = a
0+a
1(AM
a)
1+a
2(AM
a)
2+a
3(AM
a)
3+a
4(AM
a)
4 (1)
and
f
2(AOI) = b
0+b
1(AOI)
1+b
2(AOI)
2+b
3(AOI)
3+b4(AOI)
4. (2)
These can then be inserted into equation (3)
I
sc = I
sco⋅f
1(AM
a)⋅{(E
b⋅f
2(AOI)+f
d⋅E
diff) / E
o}⋅{1+α
Isc⋅(T
c-T
o)} (3)
With AOI being the Solar angle-of-incidence given in degrees and AM
a as the absolute air mass. Is there a way to calculate the airmass coefficients a
0 - a
4 and angle of incidence coefficients b
0 - b
4? Does PVlib have a function which is able to calculate these coefficients for the user? Or are they determined by Sandia for every single PV module in tests?
I hope my explenation is somewhat understandable, I would be grateful is someone knew how the solve the issues. Thanks in advance!