Auxiliary equation for PVsyst shunt resistance may be incorrect
See original GitHub issueDescribe 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (20 by maintainers)
Top GitHub Comments
@markcampanelli I’d say yes. It would be necessary to bring some of the PAN and OND files for test purposes, and to explicitly state the Pvsyst versions for which this read capability works. The code should go in a new module in pvlib-python/iotools.
@adriesse Good question. I am not quite there yet with PVfit. (Thanks to @cwhanse’s detective work, the actual implementation of the PVsyst model appears to be nailed down better in pvlib than in PVsyst’s own help documentation!) Nevertheless, when I cross that bridge I’m very inclined to take PVsyst’s advice here: “The RshExp exponential coefficient is always -5.5, according to all our measurements of Rshunt at sun. This should not be modified.” ref
I was never able to track down the origin of non-standard value (
Rp_Exp=1.10
) that triggered this issue.My attention is refocused here because I am working on a translation from the PVsyst model (via PAN file) to SAPM (for SunPower’s PVAPI simulation tool). This is why you’ll see me posting using two different Github users 😃.