|
| 1 | +""" |
| 2 | +Fixed-Tilt Simulation with pvfactors |
| 3 | +==================================== |
| 4 | +
|
| 5 | +Modeling the irradiance on the rear side of a fixed-tilt array. |
| 6 | +""" |
| 7 | + |
| 8 | +# %% |
| 9 | +# Because pvfactors was originally designed for modeling single-axis |
| 10 | +# tracking systems, it's not necessarily obvious how to use it to model |
| 11 | +# fixed-tilt systems correctly. |
| 12 | +# This example shows how to model rear-side irradiance on a fixed-tilt |
| 13 | +# array using :py:func:`pvlib.bifacial.pvfactors.pvfactors_timeseries`. |
| 14 | + |
| 15 | +import pandas as pd |
| 16 | +from pvlib import location |
| 17 | +from pvlib.bifacial.pvfactors import pvfactors_timeseries |
| 18 | +import matplotlib.pyplot as plt |
| 19 | +import warnings |
| 20 | + |
| 21 | +# supressing shapely warnings that occur on import of pvfactors |
| 22 | +warnings.filterwarnings(action='ignore', module='pvfactors') |
| 23 | + |
| 24 | +# %% |
| 25 | +# First, generate the usual modeling inputs: |
| 26 | + |
| 27 | +times = pd.date_range('2021-06-21', '2021-06-22', freq='1T', tz='Etc/GMT+5') |
| 28 | +loc = location.Location(latitude=40, longitude=-80, tz=times.tz) |
| 29 | +sp = loc.get_solarposition(times) |
| 30 | +cs = loc.get_clearsky(times) |
| 31 | + |
| 32 | +# example array geometry |
| 33 | +pvrow_height = 1 |
| 34 | +pvrow_width = 4 |
| 35 | +pitch = 10 |
| 36 | +gcr = pvrow_width / pitch |
| 37 | +axis_azimuth = 180 |
| 38 | +albedo = 0.2 |
| 39 | + |
| 40 | +# %% |
| 41 | +# Now the trick: since pvfactors only wants to model single-axis tracking |
| 42 | +# arrays, we have to pretend our fixed tilt array is a single-axis tracking |
| 43 | +# array that never rotates. In that case, the "axis of rotation" is |
| 44 | +# along the length of the row, with ``axis_azimuth`` 90 degrees offset from the |
| 45 | +# fixed ``surface_azimuth``. |
| 46 | + |
| 47 | +irrad = pvfactors_timeseries( |
| 48 | + solar_azimuth=sp['azimuth'], |
| 49 | + solar_zenith=sp['apparent_zenith'], |
| 50 | + surface_azimuth=180, # south-facing array |
| 51 | + surface_tilt=20, |
| 52 | + axis_azimuth=90, # 90 degrees off from surface_azimuth. 270 is ok too |
| 53 | + timestamps=times, |
| 54 | + dni=cs['dni'], |
| 55 | + dhi=cs['dhi'], |
| 56 | + gcr=gcr, |
| 57 | + pvrow_height=pvrow_height, |
| 58 | + pvrow_width=pvrow_width, |
| 59 | + albedo=albedo, |
| 60 | + n_pvrows=3, |
| 61 | + index_observed_pvrow=1 |
| 62 | +) |
| 63 | + |
| 64 | +# turn into pandas DataFrame |
| 65 | +irrad = pd.concat(irrad, axis=1) |
| 66 | + |
| 67 | +irrad[['total_inc_back', 'total_abs_back']].plot() |
| 68 | +plt.ylabel('Irradiance [W m$^{-2}$]') |
0 commit comments