pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

PV efficiency models from pvpltools-python

Open adriesse opened this issue 3 years ago • 3 comments

  • [x] Closes #1544
  • [x] 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.

adriesse avatar Oct 14 '22 11:10 adriesse

I'm getting the ball rolling on this PR because there is some overlap with #1354 and it may be better to think ahead about how to best sort this out (assuming we want all these efficiency models in pvlib-python of course).

Both PR have a similar efficiency model function (mpm6() vs. mlfm_6() ) and both PR have a fitting function (fit_efficiency_model() vs. mlfm_fit() ). My opening suggestion would be to:

  • keep the efficiency model function with its peers in the new pvefficiency module
  • simplify mlfm_fit() by calling fit_efficiency_model() with the appropriate bounds as kwarg.

adriesse avatar Oct 14 '22 12:10 adriesse

I agree we should unify coding into sensible locations as soon as possible.

  1. mpm fits not just the performance ratio but also other normalised coefficients such as i_sc, r_sc, i_mp, i_ff ... v_oc, ff. Will this code only fit performance ratio or are other parameters allowed?

  2. The SAPM has 4 different equations to fit measured i_sc, i_mp, v_mp and v_oc, which can then be used to generate p_mp, pr_dc. Will this be added?

  3. The equation you used for PVGIS needs a correction factor for any degradation or eta_meas/eta_nameplate at STC

steve-ransome avatar Oct 14 '22 16:10 steve-ransome

I agree we should unify coding into sensible locations as soon as possible.

  1. mpm fits not just the performance ratio but also other normalised coefficients such as i_sc, r_sc, i_mp, i_ff ... v_oc, ff. Will this code only fit performance ratio or are other parameters allowed?

Yes, if mpm has those capabilities, why not? Is that in the current code already, or something you're thinking about adding later?

  1. The SAPM has 4 different equations to fit measured i_sc, i_mp, v_mp and v_oc, which can then be used to generate p_mp, pr_dc. Will this be added?

That's not on my radar, but clearly both 1. and 2. could lead to different code organization ideas.

  1. The equation you used for PVGIS needs a correction factor for any degradation or eta_meas/eta_nameplate at STC

Yes, I wrote about this problem, but for me the model is primarily of historical interest.

adriesse avatar Oct 14 '22 19:10 adriesse

I agree we should unify coding into sensible locations as soon as possible.

  1. mpm fits not just the performance ratio but also other normalised coefficients such as i_sc, r_sc, i_mp, i_ff ... v_oc, ff. Will this code only fit performance ratio or are other parameters allowed?

Yes, if mpm has those capabilities, why not? Is that in the current code already, or something you're thinking about adding later?

It's already in the code. You make var_to_fit as 'pr_dc', 'v_mp', 'r_sc' or whatever and it will fit it. The jupyter notebooks only have the 'pr_dc' in there but I've fitted all the other parameters in my publications such as this http://www.steveransome.com/pubs/2206_PVSC_49_Ransome_to_be_presented.pdf

def mlfm_fit(data, var_to_fit): var_to_fit : string Column name in data containing variable being fitted.

  1. The SAPM has 4 different equations to fit measured i_sc, i_mp, v_mp and v_oc, which can then be used to generate p_mp, pr_dc. Will this be added?

That's not on my radar, but clearly both 1. and 2. could lead to different code organization ideas.

OK, as I knew SAPM and PVGIS are commonly used I analysed them in the paper I just linked. I also looked at the bilinear interpolation but as we've discussed before I really don't think it's a good idea at all. The traces are not linear with irradiance.

  1. The equation you used for PVGIS needs a correction factor for any degradation or eta_meas/eta_nameplate at STC

Yes, I wrote about this problem, but for me the model is primarily of historical interest.

OK, I have seen others acknowledge the problem and correct for it. I changed the 1 to be k_0 to solve that.

steve-ransome avatar Oct 15 '22 17:10 steve-ransome

Well, maybe my opening suggestion was not the best in light of mpm/mlfm being used with a gradually expanding number of predictors and also applied to a multiple response variables. Perhaps it is better to see how #1354 evolves before trying to solve this.

adriesse avatar Oct 16 '22 12:10 adriesse

FYI: I messed up my branch so I started over in #1602

adriesse avatar Nov 27 '22 21:11 adriesse