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

BUG: fix contrib.gen_coeffs Isat2 temperature dependence #89

Merged
merged 4 commits into from
Sep 28, 2018

Conversation

mikofski
Copy link
Contributor

  • in residual, assume "isat2" in x is at STC, ie "isat2_t0" and calculate
    isat2 using diode.isat_t()
  • also fix all documentation in gen_coeffs to render okay
  • make example a callable script, allow user to specify whether they want
    to fit just STC or all IEC61853, show generated coeffs, and save figure
  • futurize Bennet's module mismatch simulator for py36
  • add contrib, gen_coeffs, and module mismatch simulator to docs in new
    api section called contrib
  • add example output figures
  • fix intersphinx, must use https, leave off trailing slash
  • don't ignore git conflict files, so they can be removed without hiding
  • ignore the new .pytest_cache folder, move python3 pycache folder to
    #build
  • fix underline in README.rst, should be as long as the title

* in residual, assume "isat2" in x is at STC, ie "isat2_t0" and calculate
isat2 using `diode.isat_t()`
* also fix all documentation in gen_coeffs to render okay
* make example a callable script, allow user to specify whether they want
to fit just STC or all IEC61853, show generated coeffs, and save figure
* futurize Bennet's module mismatch simulator for py36
* add contrib, gen_coeffs, and module mismatch simulator to docs in new
api section called contrib
* add example output figures
* fix intersphinx, must use https, leave off trailing slash
* don't ignore git conflict files, so they can be removed without hiding
* ignore the new .pytest_cache folder, move python3 __pycache__ folder to
#build
* fix underline in README.rst, should be as long as the title
@mikofski
Copy link
Contributor Author

@chetan201 somehow we missed this 7 months ago, we made the change to PVMismatch to use temperature in Isat2, but not in the coefficient generation

I also took this opportunity to add gen_coeffs to the documentation.

One result of this, is that it highlights the need for PVMismatch to account for irradiance effect on shunt resistance or some other algorithm.

@mikofski
Copy link
Contributor Author

mikofski commented Sep 21, 2018

here you can see without Rsh irradiance correction the errors are small near 1 sun, but increase as irradiance decreases:

stc

But if I change make Rsh = Rsh_E0 / Ee so it's dependent on irradiance then the errors at low light are around the same as at 1 sun

stc

ignore the STC RMSE, I need to fix that, forgot to account for NP and NS when I made the first plots, but the seconds set of plots have the update from 257e598 that fixes that

the Rsh irradiance dependence is in my shunt_resistance_light_dependence branch now #91


def gen_iec_61853_from_sapm(pvmodule):
"""
Generate an IEC 61853 test from Sandia Array Performance Model (sapm).

:param pvmodule: PV module to be tested
:type pvmodule: dict
:param dict pvmodule: PV module to be tested
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding docstrings everywhere!
Our future users will thanks us plenty for that :)

@chetan201
Copy link
Contributor

chetan201 commented Sep 23, 2018

@mikofski
When I run this locally example.py I get this - The RMSE is quite higher than what your results show. This is what I am running.
I am assuming the results you posted are independent of the shunt resistance dependence PR.
image

@mikofski
Copy link
Contributor Author

mikofski commented Sep 24, 2018

Sorry, I had changed the calculation of the rms error relative to the STC conditions after I made the original plots above, see 257e598 and I've changed them again in 74a0952 to use the actual max power point (mpp) instead of the corresponding voltage corresponding to the IEC61853 Imp, and the current corresponding to the IEC61853 Vmp, which was introducing extra error, and wasn't a good comparison. Also note this is not the residual of the solver, it's the RMS error between the four points on the IV curve for all irradiances in the plot. I also output the Isc and Voc on the plots next to the irradiance level to check that it's calculated correctly, in case that was introducing error too. Here's the RMSE equations used

rmse = sqrt(sum(
    (Vmp_calc - Vmp_meas/Ns)**2 / (Vmp0/Ns)**2,        
    (Imp_calc - Imp_meas/Np)**2 / (Imp0/Np)**2,        
    (Voc_calc - Voc_meas/Ns)**2 / (Voc0/Ns)**2,        
    (Isc_calc - Isc_meas/Np)**2 / (Isc0/Np)**2,        
) / 7 / 4 ) * 100  # 7 irradiance measures, 4 points, 100%

python pvmismatch\contrib\gen_coeffs\example.py STC examples

stc

python pvmismatch\contrib\gen_coeffs\example.py IEC61853 examples

iec61853

This shows there's more spread in the errors from fits using only STC data vs. the entire IEC61853 data set. I think this error is mostly at Voc, you can see that the curves, don't cross through the IEC measurements. This might be because of #91 or #90 or maybe even because there is still a missing temperature band gap energy dependence #75. I think the power error relative to STC is probably more useful. This is also shown on the plot, and I calculated it like this:

dellta_stc = (Pmp_calc - Pmp_meas) / Pmp0 * 100

Note, the reason I used STC everywhere in the denominator was so that at very small irradiance, the errors are not exaggerated because the number are so small, eg: the power at 0.1[sun] is 11X less than at 1.1[suns] so should the relative error would have been (deltaP / a very small number) which would have exaggerated the error compared to 1[sun]. OK?

@chetan201
Copy link
Contributor

@mikofski
I verified the the new plots and they look good. Thanks for improving the gen_coeffs module further.

@chetan201 chetan201 merged commit e733ebb into SunPower:master Sep 28, 2018
@mikofski mikofski deleted the fix_contrib_gencoeffs_Isat2 branch September 29, 2018 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants