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

NREL non-uniform irradiance mismatch loss for bifacial modules #2046

Merged
merged 87 commits into from
Jul 1, 2024

Conversation

echedey-ls
Copy link
Contributor

@echedey-ls echedey-ls commented May 10, 2024

  • Closes Reduced order electrical mismatch model #1541
  • 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.

Adds the model described in #1541, also in #2045, NREL source.

Doc links

@echedey-ls echedey-ls marked this pull request as ready for review May 13, 2024 21:47
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
@kandersolar kandersolar added this to the 0.11.0 milestone May 17, 2024
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 @echedey-ls!

When we are happy with this PR, let's ask the model authors to review as well (they are on github). Just making a note now so that we do not forget.

pvlib/pvsystem.py Outdated Show resolved Hide resolved
pvlib/pvsystem.py Outdated Show resolved Hide resolved
pvlib/pvsystem.py Outdated Show resolved Hide resolved
pvlib/pvsystem.py Outdated Show resolved Hide resolved
pvlib/pvsystem.py Outdated Show resolved Hide resolved
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
@echedey-ls
Copy link
Contributor Author

Thanks @kandersolar for the feedback.

I'm going to read the published paper well - most of the upgradeable parts are due to me using the preprint - and I will come up with many changes to the current PR. I plan on selecting the polynomial model from a string and optionally by specifying its coefficients.

@echedey-ls echedey-ls marked this pull request as draft May 18, 2024 19:27
Pending second section of example, and checking docs

Co-Authored-By: César Domínguez <48208196+cesardd@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
echedey-ls and others added 4 commits June 28, 2024 18:36
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
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.

Sorry to keep complaining about percentages vs unitless...

The default coefficient values (0.142, 0.032) are intended to be used with RMAD in %, but we're using them with RMAD [-], so currently the function is calculating incorrect values. To fix it, we need to make the coefficients compatible with the RMAD input. That means we need to do one of the following:

  1. Take RMAD input in [%]
  2. Have the function take coefficients that are applicable to RMAD [-] (and rescale the default coefficients accordingly)
  3. Take RMAD input [-] but translate it to [%] before applying the polynomial

There are pros and cons to each. (1) is confusing, since most pvlib functions take unitless values, not percent. (2) makes the function a little more disconnected from the reference. (3) is confusing since the inputs will be a mix of unitless and %.

I think I favor option 2. But if we go that way, it will need some explanation in the docstring explaining the difference, and how to input suitable coefficient values. @echedey-ls what do you think?

echedey-ls and others added 3 commits June 29, 2024 00:41
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
@echedey-ls
Copy link
Contributor Author

No worries @kandersolar , I overlooked that. In my mind it all made sense, but the quadratic parameter clearly needed to be modified. I also find no. 2 to be more convenient. I've made the required changes with a deeper reviewing than the previous suggestions. I'm confident this is alright. Please have a look whenever you want.

Copy link
Contributor

@markcampanelli markcampanelli left a comment

Choose a reason for hiding this comment

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

I’m wondering if the Variables and Symbols section of the RTD is due for an update w.r.t. the bifacial modeling additions to pvlib. If so, then it might be worth a followup ticket.

https://pvlib-python.readthedocs.io/en/stable/user_guide/variables_style_rules.html

@echedey-ls
Copy link
Contributor Author

Thx for the review @markcampanelli !
Which variables do you miss from that table? rmad, coefficients, fill_factor[_reference]? I'd say the first one and fill_factor_reference are niche of this function. I find coefficients self-explanatory. IMO fill_factor is a good candidate.

@markcampanelli
Copy link
Contributor

@echedey-ls TBH: I did not make a detailed review here. I am very inexperienced with bifacial modeling, and this MR seemed to introduce some new concepts, so I thought I’d see where the “newbie terminology” documentation was at w.r.t. bifacials. I don’t think I’m the best judge what to add and what to not add, and it doesn’t have to be decided in this MR. Maybe when all the various GSoC projects are wrapping up it could be reassessed more holistically?

@echedey-ls
Copy link
Contributor Author

Don't worry, I'm practically self-taught on PV so you can imagine how bad my criteria is. Nevertheless there is a lot more value in what somebody without a deep understanding can acquire than an expert IMHO. I ask you, would you be able to apply this model to any modelling after reading it? Do you have any doubts regarding it? Except for the part that the backside cell-by-cell irradiance data usually lacks.

Maybe when all the various GSoC projects are wrapping up it could be reassessed more holistically?

I'm pretty sure this PR will be the last one bifacial-related among us GSoC students.

@kandersolar
Copy link
Member

Variables and Symbols is very much overdue for an update! See #1253

@cwhanse
Copy link
Member

cwhanse commented Jun 30, 2024

IMO fill_factor is a good candidate.

Agree. rmad, not yet, should be added if another use emerges.

docs/sphinx/source/whatsnew/v0.11.1.rst Outdated Show resolved Hide resolved
pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
echedey-ls and others added 2 commits June 30, 2024 18:53
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-Authored-By: Cliff Hansen <5393711+cwhanse@users.noreply.github.com>
@echedey-ls
Copy link
Contributor Author

Thx for the review @cwhanse

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.

A couple more nitpicks but otherwise LGTM!

pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
pvlib/bifacial/loss_models.py Outdated Show resolved Hide resolved
echedey-ls and others added 2 commits July 1, 2024 19:06
Co-Authored-By: Kevin Anderson <57452607+kandersolar@users.noreply.github.com>
@kandersolar kandersolar merged commit 8d172c4 into pvlib:main Jul 1, 2024
30 checks passed
@kandersolar
Copy link
Member

Thanks @echedey-ls!

@cdeline
Copy link
Contributor

cdeline commented Jul 1, 2024

Hi @kandersolar, @echedey-ls and others. Thanks for going through this, and sorry for not engaging any sooner. If you'd like to see worked examples of the mismatch function and pytests for it, please check out the bifacial_radiance.mismatch module with includes mad_fn and mismatch_fit3 which may be relevant. I think these files are current as of Nov. 2023. https://github.com/NREL/bifacial_radiance/blob/development/bifacial_radiance/mismatch.py
At the least we should compare results for consistency. I can't claim that we have it worked 100% correctly, so I'm glad for the double-check here.

@cdeline
Copy link
Contributor

cdeline commented Jul 1, 2024

Oops, just seeing that you merged already. Sorry - you guys are too efficient. :)

@kandersolar
Copy link
Member

+1 from me to do a cross-comparison, but I won't have time for it myself. Any volunteers? :)

@cdeline fyi the next pvlib release isn't scheduled for a little while, so reviews on this PR are still very welcome! We can always do a follow-up if you or @shirubana have any suggestions.

@echedey-ls
Copy link
Contributor Author

I suppose I can do it once I free some time, although I prefer another pair of eyes to review it.

@echedey-ls echedey-ls mentioned this pull request Jul 29, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement GSoC Contributions related to Google Summer of Code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduced order electrical mismatch model
7 participants