Hi all,
I apologise in advance if I am making a rookie error here, but I am having trouble interpreting the results of the pvlib.bifacial.infinite_sheds.get_irradiance function for a tracked system with backtrack=True. Specifically the
backtracking somehow makes no difference, which is bizarre to me because that is a totally separate calculation. I can only suppose I am somehow passing in the tracking information incorrectly, though it seemed straightforward. So perhaps there is something else I am doing wrong or don't understand.
Here's my minimal example:
```
import pvlib
import pandas as pd
tz = 'Australia/Melbourne'
dts = pd.date_range(start="2024-01-01", end="2024-01-02", freq='30min', tz=tz, name="Datetime")
df = pd.DataFrame(index=dts)
lat = -36.479
lon = 146.172
gcr = 4/7
axis_tilt = 0 # Flat ground
axis_azimuth = 0 # N-S orientation
max_angle = 90
height = 2
pitch = 5
# Simple clearsky irradiance
loc = pvlib.location.Location(lat, lon, tz)
df_i = loc.get_clearsky(dts)
# Sun position data
solpos = pvlib.solarposition.get_solarposition(dts, lat, lon)
# Tracking
def get_df_tracking(backtrack):
return pvlib.tracking.singleaxis(
solpos.apparent_zenith, solpos.azimuth, axis_tilt, axis_azimuth, max_angle=90, backtrack=backtrack, gcr=gcr
)
# Panel irradiance
def panel_irr(df_tracking, df_irr, bifacial):
if bifacial:
# Parameters set to reduce back panel illumination to zero, for easier comparison to single-face result
irr = pvlib.bifacial.infinite_sheds.get_irradiance(
df_tracking.surface_tilt, df_tracking.surface_azimuth, solpos.apparent_zenith, solpos.azimuth, gcr, height, pitch,
df_irr.ghi, df_irr.dhi, df_irr.dni, albedo=0.18, model='isotropic', iam_front=1,
bifaciality=0, shade_factor=1, transmission_factor=1, vectorize=False
)
else:
poa_sky_diffuse = pvlib.irradiance.isotropic(df_tracking.surface_tilt, df_irr.dhi)
poa_ground_diffuse = pvlib.irradiance.get_ground_diffuse(df_tracking.surface_tilt, df_irr.ghi, surface_type='urban')
irr = pvlib.irradiance.poa_components(df_tracking.aoi, df_irr.dni, poa_sky_diffuse, poa_ground_diffuse)
return irr
df_p_irr = []
names = []
for bifacial in [True, False]:
for backtrack in [True, False]:
df_tracking = get_df_tracking(backtrack)
df_p_irr += [panel_irr(df_tracking, df_i, bifacial)]
names += [f"backtrack={backtrack}; bifacial={bifacial}"]
df_comb = pd.concat([df.poa_global for df in df_p_irr], axis=1)
df_comb.columns = names
df_comb.plot(ylabel="poa_global", style=[".-", ".-", "--", "--"])
```
which produces the attached output.
The bifacial=False case makes sense to me, the irradiance is better without the backtracking since the panels point at the sun longer, and we don't consider shading outside of the tracking calculation.
But it is weird to me that the irradiance comes out the same for backtrack=True/False in the bifacial case. I guess the only explanation I can think of is that the bifacial computation uses the infinite sheds model, which should account for shading, and maybe it works out that the backtracking tracks backwards at exactly the right amount to minimise the impact of the shading? I mean that's kind of the point of it, but in that case shouldn't the bifacial calculation show a worse result without backtracking? Either way I am surprised it comes out so identically. Ok they aren't quite identical, but the impact seems extremely minimal, especially compared to the alternate calculation that neglects shading.
Best regards,
Ben
P.S. The bifacial calculation shows less irradiance overall, which would be odd, but I purposefully blocked all light to the back panel and the calculation is a little different, so I am not worried about that. Unless you think I should be :).