-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Gallery example for modeling fixed-tilt arrays with pvfactors #1470
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
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
556f517
Create plot_pvfactors_fixed_tilt.py
kandersolar 82b1fcc
whatsnew
kandersolar ea4b8f6
add note in docstring parameter description
kandersolar fc55c8c
typo
kandersolar 4a5a802
Merge branch 'master' into pvfactors_fixed
kandersolar 517c03d
Update pvlib/bifacial/pvfactors.py
kandersolar d003fcc
stickler
kandersolar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| """ | ||
| Fixed-Tilt Simulation with pvfactors | ||
| ==================================== | ||
|
|
||
| Modeling the irradiance on the rear side of a fixed-tilt array. | ||
| """ | ||
|
|
||
| # %% | ||
| # Because pvfactors was originally designed for modeling single-axis | ||
| # tracking systems, it's not necessarily obvious how to use it to model | ||
| # fixed-tilt systems correctly. | ||
| # This example shows how to model rear-side irradiance on a fixed-tilt | ||
| # array using :py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries`. | ||
|
|
||
| import pandas as pd | ||
| from pvlib import location | ||
| from pvlib.bifacial.pvfactors import pvfactors_timeseries | ||
| import matplotlib.pyplot as plt | ||
| import warnings | ||
|
|
||
| # supressing shapely warnings that occur on import of pvfactors | ||
| warnings.filterwarnings(action='ignore', module='pvfactors') | ||
|
|
||
| # %% | ||
| # First, generate the usual modeling inputs: | ||
|
|
||
| times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz='Etc/GMT+5') | ||
| loc = location.Location(latitude=40, longitude=-80, tz=times.tz) | ||
| sp = loc.get_solarposition(times) | ||
| cs = loc.get_clearsky(times) | ||
|
|
||
| # example array geometry | ||
| pvrow_height = 1 | ||
| pvrow_width = 4 | ||
| pitch = 10 | ||
| gcr = pvrow_width / pitch | ||
| axis_azimuth = 180 | ||
| albedo = 0.2 | ||
|
|
||
| # %% | ||
| # Now the trick: since pvfactors only wants to model single-axis tracking | ||
| # arrays, we have to pretend our fixed tilt array is a single-axis tracking | ||
| # array that never rotates. In that case, the "axis of rotation" is | ||
| # along the length of the row, with ``axis_azimuth`` 90 degrees offset from the | ||
| # fixed ``surface_azimuth``. | ||
|
|
||
| irrad = pvfactors_timeseries( | ||
| solar_azimuth=sp['azimuth'], | ||
| solar_zenith=sp['apparent_zenith'], | ||
| surface_azimuth=180, # south-facing array | ||
| surface_tilt=20, | ||
| axis_azimuth=90, # 90 degrees off from surface_azimuth. 270 is ok too | ||
| timestamps=times, | ||
| dni=cs['dni'], | ||
| dhi=cs['dhi'], | ||
| gcr=gcr, | ||
| pvrow_height=pvrow_height, | ||
| pvrow_width=pvrow_width, | ||
| albedo=albedo, | ||
| n_pvrows=3, | ||
| index_observed_pvrow=1 | ||
| ) | ||
|
|
||
| # turn into pandas DataFrame | ||
| irrad = pd.concat(irrad, axis=1) | ||
|
|
||
| irrad[['total_inc_back', 'total_abs_back']].plot() | ||
| plt.ylabel('Irradiance [W m$^{-2}$]') |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.