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.

Trouble figuring out how to run IV gold standard test cases in pvlib

See original GitHub issue

Describe 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:

  1. Call with method = 'brentq' or method = 'newton',
    pvlib.pvsystem.singlediode(8, 5e-10, 1, 300, 1.8683643583499283, ivcurve_pnts=100, method='brentq')
    
  2. 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.3
  • pandas.__version__: 1.4.3
  • python: 3.10

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
adriessecommented, Nov 2, 2022

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.

2reactions
cwhansecommented, Oct 31, 2022

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 of singlediode raised because of the ivcurve_pnts parameter.

Read more comments on GitHub >

github_iconTop 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 >

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