-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
The implementation of PVsyst's auxiliary equation for the shunt resistance as a function of irradiance at
https://github.com/pvlib/pvlib-python/blob/v0.8.0/pvlib/pvsystem.py#L1326-L1331
does not match the description given by equation (5) in this reference
https://www.pvsyst.com/wp-content/uploads/2019/01/thf_article_valence_2010.pdf
It is unclear from the code what pvlib's version is trying to compensate for and why it deviates from at least one of the references given and PVsyst's online documentation at
https://www.pvsyst.com/help/index.html?pvmodule_rshexp.htm
My guess is that it might be trying to make shunt resistance at the reference irradiance precisely equal to Rshunt. See below.
The PVsyst documentation/notation is confusing because Rsh(Gref) (also denoted as Rshunt) is not precisely the shunt resistance at reference conditions. Rather, it appears that it is a reasonable approximation of the shunt resistance at the reference irradiance for larger values of the exponent parameter, e.g., for the common PVsyst default value of 5.5. However, this approximation can be quite poor, as evidenced by the second example below taken from an actual PAN file:
import numpy
def R_sh_at_G(*, G, R_sh_ref, R_sh_zero, R_sh_exp, G_ref=1000.):
return R_sh_ref + (R_sh_zero - R_sh_ref) * numpy.exp(-R_sh_exp * (G / G_ref))
G = 1000.
R_sh_ref, R_sh_zero, R_sh_exp = 9000, 10000, 5.5
print(f"R_sh_at_G(G={G}, R_sh_ref={R_sh_ref}, R_sh_zero={R_sh_zero}, R_sh_exp={R_sh_exp}) = {R_sh_at_G(G=G, R_sh_ref=R_sh_ref, R_sh_zero=R_sh_zero, R_sh_exp=R_sh_exp)} vs. Rshunt={R_sh_ref}")
R_sh_ref, R_sh_zero, R_sh_exp = 900, 960000, 1.10
print(f"R_sh_at_G(G={G}, R_sh_ref={R_sh_ref}, R_sh_zero={R_sh_zero}, R_sh_exp={R_sh_exp}) = {R_sh_at_G(G=G, R_sh_ref=R_sh_ref, R_sh_zero=R_sh_zero, R_sh_exp=R_sh_exp)} vs. Rshunt={R_sh_ref}")
which gives
R_sh_at_G(G=1000.0, R_sh_ref=9000, R_sh_zero=10000, R_sh_exp=5.5) = 9004.086771438464 vs. Rshunt=9000
R_sh_at_G(G=1000.0, R_sh_ref=900, R_sh_zero=960000, R_sh_exp=1.1) = 320156.6563748281 vs. Rshunt=900
Furthermore, for these parameters, pvlib.pvsystem.calcparams_pvsyst()
calculates 9000.000000000002
and 319556.2403501564
, respectively
This discrepancy is particularly concerning for algorithms that make the assumption that Rshunt in the PAN file is actually the value at the reference irradiance, such as (cc @frivollier)
https://github.com/frivollier/pvsyst_tools/blob/master/pvsyst/module.py#L275-L278
To Reproduce
See code snippets above.
Expected behavior
Implement the auxiliary equation for shunt resistance given in the PVsyst reference and online documentation, or better justify and document the difference.
Screenshots
N/A
Versions:
pvlib.__version__
: 0.8.0pandas.__version__
: 1.1.3- python: 3.8.5
Additional context
N/A