Skip to content
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

Update singlediode.bishop88 parameter types in docs #1821

Merged
merged 5 commits into from Sep 12, 2023

Conversation

reepoi
Copy link
Contributor

@reepoi reepoi commented Aug 1, 2023

  • Closes breakdown_factor type in singlediode.bishop88 docs #1820
  • I am familiar with the contributing guidelines
  • [ ] Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • Adds description and name entries in the appropriate "what's new" file in 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`).
  • New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

Update docs of singlediode.bishop88* functions to say that the parameters related to the bishop88 model and PVSyst are float types, not numeric.

I explored the option of modifying these functions to support a numeric breakdown_factor and found that it significantly slows down the common case when breakdown_factor = 0. Here is the Jupyter notebook I used to measure bishop88 performance: https://github.com/reepoi/pvlib-python/blob/bishop88-if/bishop88_speed.ipynb

The notebook compares three implementations of bishop88:

There are two tests in the notebook:

  • Breakdown_factor is a scalar
    • call the functions with 20 IV curves and a single scalar breakdown_factor for all of them
  • Breakdown_factor is an array
    • call the functions with 20 IV curves and a breakdown_factor array with length 20. I try a breakdown_factor array with all zeros, half of its entries are zero, and all entries are nonzero. The original bishop88 implementation is excluded from this test because it doesn’t work when breakdown_factor is an array.

@cwhanse
Copy link
Member

cwhanse commented Aug 1, 2023

+1 for the reverse bias parameters breakdown_factor, breakdown_voltage and breakdown_exp being floats. The common reason to compute the negative voltage portion of IV curves is to get to an IV curve for a series-connected devices, and it's hard to imagine having different diode behavior among the series-connected components.

I'm not sure about making the recombination current term parameters NsVbi and d2mutau to floats. The code lets one use an array. My impression is that these parameters are seldom used, but when they are used, they are probably set to PVsyst's constant defaults. So I don't think it does any harm to expect float.

@reepoi
Copy link
Contributor Author

reepoi commented Aug 2, 2023

Since the code already works when NsVbi and d2mutau are arrays, they should probably be left as numeric.

@cwhanse cwhanse added this to the v0.10.2 milestone Aug 10, 2023
Copy link
Member

@cwhanse cwhanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @reepoi

docs/sphinx/source/whatsnew/v0.10.2.rst Outdated Show resolved Hide resolved
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Copy link
Member

@kandersolar kandersolar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @reepoi!

@kandersolar kandersolar merged commit d2fbfb2 into pvlib:main Sep 12, 2023
18 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

breakdown_factor type in singlediode.bishop88 docs
3 participants