Description
pvlib.pvsystem._DC_MODEL_PARAMS
lists parameter names for each of several DC models, including the SAPM:
pvlib-python/pvlib/pvsystem.py
Lines 29 to 36 in 6440ada
Many of these SAPM parameters are not used in the SAPM DC model. A0-A4
are for the airmass modifier. B0-B5
are for beam IAM. FD
is for diffuse IAM. None of these are required to run the DC portion of the SAPM, implemented in pvlib.pvsystem.sapm
.
However, because these non-DC parameters are listed in _DC_MODEL_PARAMS
, ModelChain
raises an error if you do not supply them when setting dc_model='sapm'
. Here is an example of code that I would like to execute successfully:
import pvlib
sapm_parameters = {
# required parameters
'C0': 1.02, 'C1': -0.018, 'C2': -0.15, 'C3': -12.26,
'Isco': 14.03, 'Impo': 13.38, 'Voco': 51.54, 'Vmpo': 42.89,
'Aisc': 0.00049, 'Aimp': 0.00050, 'Bvoco': -0.132, 'Bvmpo': -0.150,
'Mbvoc': 0, 'Mbvmp': 0,
'N': 1.128, 'Cells_in_Series': 72,
# required parameters, but only for uninteresting outputs, so supply dummy values:
'IXO': 0, 'IXXO': 0,
'C4': 0, 'C5': 0, 'C6': 0, 'C7': 0
}
location = pvlib.location.Location(40, -80)
system = pvlib.pvsystem.PVSystem(module_parameters=sapm_parameters, inverter_parameters={'pdc0': 300})
mc = pvlib.modelchain.ModelChain(system, location, dc_model='sapm', spectral_model='no_loss', aoi_model='no_loss')
However, with the current pvlib, it fails, complaining about the missing non-DC parameters:
ValueError: sapm selected for the DC model but one or more Arrays are missing one or more required parameters : {'B4', 'FD', 'B5', 'B1', 'A3', 'B0', 'B2', 'A0', 'A4', 'A2', 'B3', 'A1'}
I propose we remove the A*
, B*
, and FD
parameters from this dictionary.
I could not locate any previous discussion of this, aside from a very brief exchange when the dictionary was first added: #548 (comment)
Activity