question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auxiliary equation for PVsyst shunt resistance may be incorrect

See original GitHub issue

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.0
  • pandas.__version__: 1.1.3
  • python: 3.8.5

Additional context N/A

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:21 (20 by maintainers)

github_iconTop GitHub Comments

4reactions
cwhansecommented, Apr 4, 2022

@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.

2reactions
campanelli-sunpowercommented, Mar 24, 2022

@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 😃.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PVsyst 7 Help
➢The shunt resistance RShunt. The shunt resistance is defined according to a default value hypothesis chosen by PVsyst: Rshunt = Vmpp / (0.2...
Read more >
Standard one-diode-model - PVsyst
Rsh = Shunt resistance [ohm ]. Gamma= Diode quality factor, theoretically between 1 and 2, often less. q = Charge of the electron...
Read more >
PV module - Rserie and Rshunt effects on Low-light efficiency
The shunt resistance at STC has a very low impact on the Low-light efficiency. However the exponential behavior as function of the irradiance...
Read more >
PV-module shunt resistance - PVsyst
The shunt resistance Rsh is the inverse of the slope of the I/V characteristic in the neighbourhood of the short-circuit point. When a...
Read more >
PVsyst 7 Help
Error in the calculation of DiffEff and Alb_Eff (info only: This is not used in the simulation). 2. Database update. In Version 5.61...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found