Skip to content

Commit 83d90eb

Browse files
authored
changed w to omega in tracking.py's singleaxis function (#2146)
1 parent 899b10c commit 83d90eb

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

pvlib/tracking.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,16 @@ def singleaxis(apparent_zenith, apparent_azimuth,
127127
if apparent_azimuth.ndim > 1 or apparent_zenith.ndim > 1:
128128
raise ValueError('Input dimensions must not exceed 1')
129129

130-
# The ideal tracking angle wid is the rotation to place the sun position
131-
# vector (xp, yp, zp) in the (x, z) plane, which is normal to the panel and
132-
# contains the axis of rotation. wid = 0 indicates that the panel is
133-
# horizontal. Here, our convention is that a clockwise rotation is
134-
# positive, to view rotation angles in the same frame of reference as
135-
# azimuth. For example, for a system with tracking axis oriented south, a
136-
# rotation toward the east is negative, and a rotation to the west is
137-
# positive. This is a right-handed rotation around the tracker y-axis.
138-
wid = shading.projected_solar_zenith_angle(
130+
# The ideal tracking angle omega_ideal is the rotation to place the sun
131+
# position vector (xp, yp, zp) in the (x, z) plane, which is normal to
132+
# the panel and contains the axis of rotation. omega_ideal= 0 indicates
133+
# that the panel is horizontal. Here, our convention is that a clockwise
134+
# rotation is positive, to view rotation angles in the same frame of
135+
# reference as azimuth. For example, for a system with tracking
136+
# axis oriented south, a rotation toward the east is negative, and a
137+
# rotation to the west is positive. This is a right-handed rotation
138+
# around the tracker y-axis.
139+
omega_ideal = shading.projected_solar_zenith_angle(
139140
axis_tilt=axis_tilt,
140141
axis_azimuth=axis_azimuth,
141142
solar_zenith=apparent_zenith,
@@ -144,7 +145,7 @@ def singleaxis(apparent_zenith, apparent_azimuth,
144145

145146
# filter for sun above panel horizon
146147
zen_gt_90 = apparent_zenith > 90
147-
wid[zen_gt_90] = np.nan
148+
omega_ideal[zen_gt_90] = np.nan
148149

149150
# Account for backtracking
150151
if backtrack:
@@ -153,19 +154,22 @@ def singleaxis(apparent_zenith, apparent_azimuth,
153154
axes_distance = 1/(gcr * cosd(cross_axis_tilt))
154155

155156
# NOTE: account for rare angles below array, see GH 824
156-
temp = np.abs(axes_distance * cosd(wid - cross_axis_tilt))
157+
temp = np.abs(axes_distance * cosd(omega_ideal - cross_axis_tilt))
157158

158159
# backtrack angle using [1], Eq. 14
159160
with np.errstate(invalid='ignore'):
160-
wc = np.degrees(-np.sign(wid)*np.arccos(temp))
161+
omega_correction = np.degrees(
162+
-np.sign(omega_ideal)*np.arccos(temp))
161163

162164
# NOTE: in the middle of the day, arccos(temp) is out of range because
163165
# there's no row-to-row shade to avoid, & backtracking is unnecessary
164166
# [1], Eqs. 15-16
165167
with np.errstate(invalid='ignore'):
166-
tracker_theta = wid + np.where(temp < 1, wc, 0)
168+
tracker_theta = omega_ideal + np.where(
169+
temp < 1, omega_correction,
170+
0)
167171
else:
168-
tracker_theta = wid
172+
tracker_theta = omega_ideal
169173

170174
# NOTE: max_angle defined relative to zero-point rotation, not the
171175
# system-plane normal

0 commit comments

Comments
 (0)