Skip to content

add capability for reverse bias #948

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

Merged
merged 12 commits into from
Apr 11, 2020
Merged

add capability for reverse bias #948

merged 12 commits into from
Apr 11, 2020

Conversation

cwhanse
Copy link
Member

@cwhanse cwhanse commented Mar 31, 2020

  • I am familiar with the contributing guidelines
  • Tests added
  • Updates entries to docs/sphinx/source/api.rst 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 and Milestone are assigned to the Pull Request and linked Issue.

Adds reverse bias capability to single diode functions. The Lambert W technique cannot solve the single diode equation with the term for current at reverse bias. The Bishop '88 methods can solve the equation. Tested with method='newton', not clear if method='brentq' is reliable for this application.

@CameronTStark CameronTStark added this to the 0.7.3 milestone Apr 1, 2020
@cwhanse cwhanse added the api label Apr 1, 2020
@cwhanse cwhanse modified the milestones: 0.7.3, 0.7.2 Apr 1, 2020
@cwhanse
Copy link
Member Author

cwhanse commented Apr 1, 2020

Ready for review.

stickler complains about breaks both before and after an operator. Suggestions? Test failures are for test_forecast.py.

d2mutau=0, NsVbi=np.Inf, method='newton'):
d2mutau=0, NsVbi=np.Inf, breakdown_factor=0.,
breakdown_voltage=-5.5, breakdown_exp=3.28,
method='newton'):
Copy link
Contributor

Choose a reason for hiding this comment

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

As a convention, is it better to add new kwargs at the end, E.g. after method='newton', so it doesn't break code that relies on position than explicit kwarg= usage?

I'm half asking if that's something that's been historically done.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree, but would like to keep like arguments grouped together in general order of decreasing interest: required module parameters first, then optional thin-film parameters, reverse bias parameters third, numerical control last.

Copy link
Member

Choose a reason for hiding this comment

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

I think it's bad form to rely on the position of a keyword argument. Don't worry about it.

Copy link
Contributor

@CameronTStark CameronTStark left a comment

Choose a reason for hiding this comment

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

LGTM other than a few NITs and linting.

cwhanse and others added 4 commits April 6, 2020 09:19
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
Co-Authored-By: Cameron Stark <CameronTStark@users.noreply.github.com>
d2mutau=0, NsVbi=np.Inf, method='newton'):
d2mutau=0, NsVbi=np.Inf, breakdown_factor=0.,
breakdown_voltage=-5.5, breakdown_exp=3.28,
method='newton'):
Copy link
Member

Choose a reason for hiding this comment

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

I think it's bad form to rely on the position of a keyword argument. Don't worry about it.

@CameronTStark CameronTStark merged commit 7bd1a3f into pvlib:master Apr 11, 2020
@CameronTStark
Copy link
Contributor

Thanks @cwhanse!

@cwhanse cwhanse deleted the reverse branch June 22, 2020 14:20
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.

3 participants