-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WIP] Implement engerer2 decomposition model and threlkeld-jordan clear-sky model #1366
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
Conversation
Good detective work! |
In case it is decided not to implement the engerer2 model, is it perhaps worth still implementing the Threlkeld-Jordan clear-sky model? Especially given that it has been incorrectly implemented previously by others, I think that it would be great having a reference of it in pvlib. |
Yes, agreed, the clear-sky model is not corrupted by the engerer2 coefficient issue. For context: engerer2 is a model that predicts diffuse fraction using what is essentially a logistic regression on a few input parameters, including clear-sky GHI modeled using this T-J model. However, it seems that the recommended coefficient values to the engerer2 logistic regression were fit to ground station data using an implementation of the T-J clear-sky model with a minor flaw, meaning the fitted coefficients are likely flawed to some extent as well. I don't think we can estimate the degree of the error without significant effort, so I'm hesitant to merge engerer2. But the underlying clear-sky model is still fine. Also from what I was seeing in some older references this model might be better called some kind of ASHRAE model instead of T-J. Need to look a bit more into that. |
@kanderso-nrel have you located a copy of the 1958 T-J paper? |
This is my (tenuous) understanding of how the equations implemented in this PR's
It seems that ASHRAE adopted the model and the monthly coefficients somewhere along the way as well, but I don't have a link handy for that. |
My understanding regarding flawed coefficients in the engerer2 decomposition model remains unchanged, but it seems that the TJ clear-sky model is obscure enough that I probably won't ever get the motivation to add it on its own. In that case, no need to keep this PR open. It's there if anyone wants to someday pick it up and write tests. |
I could probably pick up the bugs in the engerer2 model and refit it if of interest. I was pretty gutted to learn i had a flawed TJ model. Not my finest hour! |
I think it is of interest, and you get another publication! :) |
docs/sphinx/source/api.rst
for API changes.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`
).I took a stab at implementing the engerer2 decomposition model. Its reference suggests using it with the threlkeld-jordan clear-sky model, so I implemented that as well. However, on comparing this implementation with the code published for the engerer2 reference, an issue in the original emerged (JamieMBright/Engerer2-separation-model#2) that might call the reference's coefficients into question. Unclear at this point whether we'll want to merge this, but at the suggestion of @AdamRJensen I'm opening this PR so that at least this implementation is available in the meantime.