-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Incorrect AOI from pvlib.tracking.singleaxis #1221
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
Comments
I agree that |
This is an ancient line first committed April 3, 2015: pvlib-python/pvlib/tracking.py Line 219 in 46f69bf
|
Yes, my initial port of the matlab code was as close to 1:1 as I could make it. I don't recall second guessing the |
We (Dan and I) concluded that line is in error, in the matlab code. |
Should we just replace that entire line with a call to |
@kanderso-nrel the shortcoming with using COINCIDENTALLY, ALSO, I was thrown for a bit in Anyway, back to this, should we consider adjusting # in irradiance.py
def aoi(surface_tilt, surface_azimuth, solar_zenith, solar_azimuth,
projection=None):
if projection is None:
projection = aoi_projection(
surface_tilt, surface_azimuth, solar_zenith, solar_azimuth)
# from here it's the same
aoi_value = np.rad2deg(np.arccos(projection))
... then in # calculate angle-of-incidence on panel
# aoi = np.degrees(np.arccos(np.abs(np.sum(sun_vec*panel_norm, axis=0))))
projection = (xp * panel_norm[0]
+ yp * panel_norm[1]
+ zp * panel_norm[2])
# can't use np.dot for 2D matrices
# expanding arrays is about 1.5x faster than sum
# can skip sun_vec array formation, but still need panel norm for later
aoi = irradiance.aoi(None, None, None, None, projection=projection) |
or maybe just to get this ball roling we use clip for now and just close it with a #TODO |
FYI: the repro steps at the top are for a vertical tracker. |
after #1273 |
pvlib.tracking.singleaxis
produces an incorrect AOI when the sun is above the earth horizon but behind the module plane.To Reproduce
Model a fixed tilt system (90 tilt, 180 azimuth) and compare to a vertical single axis tracker with very small rotation limit.
Expected behavior
The AOI for the fixed tilt system shows values greater than 90 when the sun is behind the module plane. The AOI from
singleaxis
does not.I think the source of the error is the use of
abs
in this line.Screenshots

Versions:
pvlib.__version__
: 0.8.1First reported by email from Jim Wilzcak (NOAA) for the PVlib Matlab function pvl_singleaxis.m
The text was updated successfully, but these errors were encountered: