-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add minus sign in front of dEgdT, sdm.py
#2322
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
Add minus sign in front of dEgdT, sdm.py
#2322
Conversation
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com> Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
I'd say no, it confirms the error is inconsequential, for practical purposes. |
This surprises me...
returns different values between |
The error affects The tests for pvlib-python/pvlib/tests/ivtools/test_sdm.py Line 141 in 6af80da
|
At first I thought similar, but I decided to test it and it does not seem to change anything noticeable. My test strategy has been:
There is no difference, I've added my results to the details section down below. Now I wonder whether that term has any impact on the model (I suppose it does, nobody would have put it there without a reason). Is there any check I've missed? Maybe is the max cell temp difference from STC too low (20 ºC)? Same output
fit_desoto_sandia
-----------------
+ 0.0002677
Mismatched elements: 2 / 5 (40%)
Max absolute difference among violations: 10.26629715
Max relative difference among violations: 0.07620939
modeled[params.keys()].values-expected[params.keys()].values =
array([-7.84332362e-05, 7.69714883e-12, 1.02662972e+01, -4.47022678e-03,
7.18454498e-03])
- 0.0002677
Mismatched elements: 2 / 5 (40%)
Max absolute difference among violations: 10.26629715
Max relative difference among violations: 0.07620939
modeled[params.keys()].values-expected[params.keys()].values =
array([-7.84332362e-05, 7.69714883e-12, 1.02662972e+01, -4.47022678e-03,
7.18454498e-03]) |
The way that algorithm works, the value of
Pass
I_L_ref: 5.055921566763837 I_L_ref: 5.055921566763837 |
So the problem is not that the change makes no difference, the problem is that our tests don't check the affected quantities. The test currently only looks at There are other untested values as well ( |
These things have caught my attention:
|
The algorithm (as documented in the reference technical report) regards
That doesn't surprise me. The five returned vectors are the diode equation parameters one for each input IV curve. The five values are determined by fitting. The thought was that fitting each curve would reveal the structure of the relationship between each parameters and irradiance and temperature. The DeSoto model (and other single diode models) assume that structure is described by the model's auxiliary equations, in the case of If we test the diode equation parameters |
This PR should be ready to go. I don't have more time today so feel free to push changes as you need. Thanks @cwhanse for the in-depth explanation, I wasn't aware of all that :) |
Thanks @echedey-ls! |
pvlib.ivtools.sdm.fit_desoto_sandia
has incorrect sign for returneddEgdT
#2321[ ] Updates entries indocs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Fixes the typo in line 874 of
sdm.py
, wheredEgdT = -0.0002677
instead of the same without the minus sign.Inspired by today's AdventOfCode, I've regexed if this typo is everywhere else and I can confirm it isn't. Regex:
(?<!-)0.0002677
Tests are passing locally. @cwhanse , should I create a test with a hella lot of precision to test this?