Trouble figuring out how to run IV gold standard test cases in pvlib
See original GitHub issueDescribe the bug
When pvsystem.singlediode
is called with method = 'brentq'
or method = 'newton'
and ivcurve_pnts > 0
, singlediode.bishop88
is called to calculate the voltage and current of the ivcurve points. singlediode.bishop88
expects diode voltage, but pvsystem.singlediode
passes it voltage instead.
To Reproduce Steps to reproduce the behavior:
- Call with
method = 'brentq'
ormethod = 'newton'
,pvlib.pvsystem.singlediode(8, 5e-10, 1, 300, 1.8683643583499283, ivcurve_pnts=100, method='brentq')
- The first few voltage values are negative.
Expected behavior The ivcurve points should be on this curve: https://cwhanse.github.io/ivcurves/test_cases.html#case-21
Versions:
pvlib.__version__
: 0.9.3pandas.__version__
: 1.4.3- python: 3.10
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Calculating a module's IV curves - pvlib python - Read the Docs
Here we use the De Soto model 1 to calculate the electrical parameters for an IV curve at a certain irradiance and temperature...
Read more >python - Running unittest with typical test directory structure
The best solution in my opinion is to use the unittest command line interface which will add the directory to the sys.path so...
Read more >PV Module Performance — PVSC 48 Python Tutorial
The objectives for this tutorial are to use pvlib python to do the following: ... Calculate the single diode model (SDM) parameters at...
Read more >Testing Methods for Decision Support Systems | IntechOpen
Various methods have been proposed for (a) choosing test cases that are ... the gold standard and determine the right output for each...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure what the best place is for this thought, but perhaps it could be useful if IV curve validation data sets actually included the diode voltage as well.
I think in this case I may have given wrong direction to @reepoi. We are attempting to use some precisely computed IV pairs as tests for pvlib single diode equation solutions. We want to supply known voltage and get back the corresponding current. When I first looked, I thought that was the intent of
https://github.com/pvlib/pvlib-python/blob/b7768b424d87ff86a863b3565ee708b3470cccbc/pvlib/pvsystem.py#L2876
On second look, that line is passing voltages that are akin to initial guesses at the cell voltages.
To me it suggests that #418 is still relevant: there are uses when e.g. voltage is known and the corresponding current is desired, and
pvlib.pvsystem.singlediode
doesn’t support that. Maybe it’s a documentation gap, or as @wholmgren pointed out, an incorrect expectation ofsinglediode
raised because of theivcurve_pnts
parameter.