Skip to content

implement simplified solis clear sky model #148

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 6 commits into from
Jun 15, 2016
Merged

Conversation

wholmgren
Copy link
Member

@wholmgren wholmgren commented Apr 14, 2016

Here's an implementation of Ineichen's "simplified Solis" clear sky model (see the references below). Though I've only just implemented it and have not tested it against any data or the existing ineichen algorithm, it seems like it could be a useful addition to pvlib. I like the fact that it is simple to program, continuous, and has good limiting behavior. I could easily be missing something, though, since my experience with it is currently limited to the plots below. Does anyone else have any experience with this model? Maybe someone at Sandia, @cwhanse?

For this to be merged we would need to:

  • agree that it is a useful addition
  • think about the function's API (what is required, what is optional? I think that the existing ineichen function does too much.).
  • consider adding some helping functions such as aod converters. These can be added separately.
  • hook it up the Location.get_clearsky method
  • fill in the empty tests

[1] P. Ineichen, "A broadband simplified version of the Solis clear sky model," Solar Energy, 82, 758-762 (2008).

[2] P. Ineichen, "Validation of models that estimate the clear sky global and beam solar irradiance," Solar Energy, 132, 332-344 (2016).

aod0 1_pw0 5
aod0 01_pw0 5
aod0 1_pw5
aod0 01_pw5
dhi
dni
ghi

@cwhanse
Copy link
Member

cwhanse commented Apr 15, 2016

We haven’t implemented either the Solis or Pierre’s simplied Solis models. I agree that it is a useful addition, and would like to port it to Matlab when I can get to it.

Cliff

@wholmgren
Copy link
Member Author

I think this is nearly ready to merge.

@alorenzo175 this may be useful for your work, so you might want to review the code before it goes in.

@alorenzo175
Copy link
Contributor

Looks like all the equations follow the paper. Does it really fail if pw < 0.2? Why put that restriction but leave off the AOD and pressure restrictions?

@wholmgren
Copy link
Member Author

Thanks for double checking.

You can see the algorithm fail for very small PW in the lowest sections of the contour plots in my initial comment. This is because PW is parameterized in powers of ln(w), and ln(w) goes to -inf as w goes to 0. The AOD parameterization only contains powers of AOD, so that has good lower limit behavior. The ln(p/p0) pressure parameterization should work for any reasonable user input. I think that it's reasonable for users to expect the algorithm to work for AOD --> 0 and PW --> 0 (clean, dry atmosphere), but not p --> 0 (high flying solar drones?).

I'm less worried about the upper limits since I don't think that they will be reached using real data and because users should naturally be skeptical of the upper limits.

I just noticed that Fig 3 of Ineichen 2008 shows PW from 0.1 to 10 cm, so maybe 0.1 is a better choice for the limit. I'll try to reproduce that figure and then decide.

@wholmgren
Copy link
Member Author

I might as well share my attempt at reproducing the figure. Unfortunately, the paper does not give enough information to reproduce it with much accuracy, but the differences are large enough that I want to take more time to double check the work against Ineichen's excel tool:

http://www.unige.ch/energie/fr/equipe/ineichen/solis-tool/

The excel tool is "an improved version" so that comparison may or may not turn out right either.

tau_3d

@wholmgren
Copy link
Member Author

I'm going to merge this once the tests pass. Here's a gist with a notebook that demonstrates the usage: https://gist.github.com/wholmgren/fb5043a7d3cd111cf38ce7a7b7779550

I'm fairly confident that the algorithm is implemented as written in the papers above, and I've decided that makes it good enough to merge. However, be aware that there are some discrepancies with the results in the Excel spreadsheet. I'd like to revisit this later, and I hope that others might be interested enough to do their own validations of the implementation once it's merged and released.

The discussion in #83 led me to change the API. Here's how it works now: If you pass a Series into the function, you'll get back a DataFrame, thus making it easy to handle time series data with pandas. If you pass scalars or arrays, you'll get back an OrderedDict of scalars or arrays, thus making it easy to use the function in more complex code. In either case you can use e.g. result['ghi'] to get the GHI, but further indexing/slicing is up to the user.

@mikofski and @MLEEFS might be interested in trying this out when I release 0.3.3 later today.

@wholmgren wholmgren merged commit f773e2d into pvlib:master Jun 15, 2016
@wholmgren wholmgren deleted the solis branch June 28, 2016 22: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