Add marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs#2824
Open
cbcrespo wants to merge 1 commit into
Open
Add marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs#2824cbcrespo wants to merge 1 commit into
marion_diffuse_tracking, to be used instead of marion_diffuse for vector surface_tilt inputs#2824cbcrespo wants to merge 1 commit into
Conversation
Contributor
|
kudos to @kandersolar for raising the issue and everyone else who contributed to the conceptualization of this. was now thinking that neither me and @cbcrespo have never modelled bifacial, and we have no idea how IAM is calculated for that (not even sure if
likely it's not as simple as this.... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/sphinx/source/referencefor API changes.docs/sphinx/source/whatsnewfor 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`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.As noted in #1402,
marion_diffuseuses too much memory (and takes a long time) when thesurface_tiltinput is a vector, which occurs for trackers.marion_diffusecallsmarion_integratefor eachsurface_tiltand each region (sky, horizon or ground).marion_integrateintegrates over a solid angle for each of those. @cwhanse, @markcampanelli, @adriesse, @kdebrab and others discussed how this issue could be circumvented via interpolation.This PR proposes a solution via a new function called
marion_diffuse_tracking, to be used instead ofmarion_diffusefor trackers.marion_diffuse_trackingcreates vectors of 0-90 or 0-180º (for bifacial arrays) with a 0.5º step,marion_integrateis called for each angle in that vector and each region only once, and the results are used to create an interpolator function (usingscipy.interpolate.PchipInterpolator). This interpolator is then used to obtain an IAM value for each value insurface_tilt.Regardless of the length of
surface_tilt,marion_integrateis called a fixed number of times, helping to contain the computational burden.In addition, the interpolation is cached, meaning that e.g. for a
PVSystemobject with multiple trackerArrays which have identical tilt vectors, the interpolator will only have to be created once for each region.More details on time and memory savings, as well as deviation, here. For one example for a 8760-length vector,
marion_diffuse_trackinguses 4% of the max memory and 2% of the time ofmarion_diffuse.