-
Notifications
You must be signed in to change notification settings - Fork 1.1k
singlediode error with very low effective_irradiance #1673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's unexpected, thanks for reporting. I'll note that the negative Voc results from taking the difference of two very large but nearly equal numbers. It's likely limited to the CEC model, where the shunt resistance is inversely proportional to irradiance, which would be about 1e19 at photocurrent of 1e-17 for this case. |
Now this gets strange: the Voc value is positive with pvlib v0.9.3. The function involved I'm starting to think the error depends on python and numpy versions. |
The difference between 0.9.3 and 0.9.4 here may be due to slightly different values returned by |
+1 to #1617 as the likely culprit. I get the positive/negative Voc values with the same python and numpy versions but different pvlib versions. |
To illustrate the challenge, this line computes the Voc. Stripping out the indexing the computation is
With pvlib v0.9.4, Io is 7.145289906185543e-12. a is not affected, since a value of the Boltzmann contant is inherent in the a_ref value from the database. (IL + I0 - I) / Gsh is 107825185636.40567, I * Rs is 0, and a * lambertwterm is 107825185636.40569 With pvlib v0.9.3, Io is 7.145288699667595e-12. (IL + I0 - I) / Gsh is 107825167429.58397, I * Rs is 0, and a * lambertwterm is 107825167429.58395 The difference defining Voc is in the least significant digit. |
Increasing the iterations that solve for lambertwterm doesn't fix this issue. |
This smells to me like the inevitable error from accumulated round-off. FWIW, negative Voc can be achieved in 0.9.3 as well -- try the given example but with |
@pasquierjb I recommend intercepting the effective irradiance and setting values to 0 which are below a minimum on the order of 1e-9 W/m2. That will propagate to shunt resistance = np.inf, which changes the calculation path in pvlib.singlediode and gives Voc=0. I'm not sure we'll be able to extend the numerical solution of the single diode equation to be accurate at very low but non-zero values of photocurrent (and/or enormous but finite values of shunt resistance.) I note that |
Have you tried setting |
Setting |
My workaround for this issue was to first filter very low |
Describe the bug
Since pvlib 0.9.4 release (#1606) I get an error while running the single-diode model with some very low effective irradiance values.
To Reproduce
Expected behavior
This complicates the bifacial modeling procedure as
run_model_from_effective_irradiance
can be called with very low irradiance values estimated by pvfactors (at sunrise or sunset for instance).Versions:
pvlib.__version__
: 0.9.4pandas.__version__
: 1.5.3Additional context
v_oc is negative in this case which causes the error.
The text was updated successfully, but these errors were encountered: