8000 Singleaxis tracking with non-parallel slope by mikofski · Pull Request #823 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Singleaxis tracking with non-parallel slope #823

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 46 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
e2b7314
add trackers on non-parallel slopes
mikofski Nov 22, 2019
8e18f54
reverse sign for test
mikofski Nov 22, 2019
68dc85a
update test data for sat w/slope
mikofski Nov 22, 2019
3268f26
fix stickler issues
mikofski Nov 22, 2019
b97e2c8
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Nov 27, 2019
e6f679f
add side_slope argument to docstring
mikofski Dec 3, 2019
ff62aa9
change max_angle to conform to convention
mikofski Dec 4, 2019
3ea0dcf
stickler fixes: L459 whitespace, L456 long-line
mikofski Dec 4, 2019
f46d85d
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Dec 4, 2019
202f14e
update test data for max_angle convention
mikofski Dec 4, 2019
8fb75bb
update to numpy-1.12.0
mikofski Dec 4, 2019
c88f061
Merge branch 'numpy-1.12.0' into singleaxis_tracking_wslope
mikofski Dec 4, 2019
287a57e
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Dec 17, 2019
8c00037
use horizontal distance between rows
mikofski Jan 7, 2020
1e42857
update api docs for trackers on side slope
mikofski Jan 7, 2020
1796ff6
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Jan 7, 2020
5dc2c54
update what's new for v0.7.1 for trackers with side-slope
mikofski Jan 7, 2020
7704ae7
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Feb 9, 2020
306c194
use DATA_DIR from conftest
mikofski Feb 9, 2020
316ae7a
use axis tilt instead of tracker zenith
mikofski Feb 9, 2020
24e19f2
change calc tracker axis tilt to degrees
mikofski Feb 9, 2020
4fdc94d
clarify side slope relative to horizontal
mikofski Feb 9, 2020
91f3405
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Aug 27, 2020
ec1adff
update side slope angle convention
mikofski Aug 31, 2020
a27e7ce
fix stickler space complaints, see if indent helps docstring code blocks
mikofski Aug 31, 2020
8e85f77
apply suggested comments:
mikofski Sep 1, 2020
7f6f65e
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Sep 1, 2020
b9c6d00
resolve conflict in what's new v0.8.0
mikofski Sep 1, 2020
b8ed847
use implementation procedure outline in NREL tech report
mikofski Sep 1, 2020
0be974f
fix #824 update tests
mikofski Sep 1, 2020
140e9b8
add units to side slope
mikofski Sep 1, 2020
2e54ba3
add see alsos
mikofski Sep 1, 2020
3f5af19
fix docstring for calc_tracker_side_slope, rm rel_rot
mikofski Sep 1, 2020
658060b
improve side-slope docstring, define rh rotation convention
mikofski Sep 1, 2020
b74120c
Merge branch 'master' into singleaxis_tracking_wslope
mikofski Sep 2, 2020
96362f6
fix arg order in calc side slope
mikofski Sep 3, 2020
e0dfb08
update SingleAxisTracker class with side-slope
mikofski Sep 3, 2020
e210b82
add missing whitespace after comma in test_tracking.py
mikofski Sep 3, 2020
6ed62ff
catch invalid warnings for arccos in singleaxis
mikofski Sep 3, 2020
80c4491
update whats new v0.8.0
mikofski Sep 3, 2020
9e397ff
close #1041 prune old comments
mikofski Sep 3, 2020
879ba91
remove redundant "tracker" from new sat funcs
mikofski Sep 3, 2020
b94f60e
code review suggestions to clarify docs/comments
mikofski Sep 3, 2020
827fb1a
revise slope-aware tracker terms for clarity:
mikofski Sep 4, 2020
3ec39c0
improve docstrings
mikofski Sep 4, 2020
3058f8f
fix typos, py:class, not pv:class, in localized single-axis tracker
mikofski Sep 4, 2020
File filter

Filter by extension

Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clarify side slope relative to horizontal
* change args/retval to degrees
* add check for relative rotation
* remove radians from test
  • Loading branch information
mikofski committed Feb 9, 2020
commit 4fdc94d349d23b7aec1b992c935f59096ee4f252
12 changes: 4 additions & 8 deletions pvlib/tests/test_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,14 @@ def test_calc_axis_tilt():
max_angle = 75.0
# Note: GCR is relative to horizontal distance between rows
gcr = 0.33292759 # GCR = length / horizontal_pitch = 1.64 / 5 / cos(-9.86)
# convert to radians
sys_az, sys_ze = np.radians(system_plane)
tr_az = np.radians(axis_azimuth)
# calculate tracker axis zenith
axis_tilt = tracking.calc_tracker_axis_tilt(
*system_plane, axis_azimuth=tr_az)
tr_ze = np.radians(axis_tilt)
*system_plane, axis_azimuth=axis_azimuth)
assert np.isclose(axis_tilt, expected_axis_tilt)
# calculate side slope and relative rotation
ss, rel_rot = tracking.calc_system_tracker_side_slope(
tr_az, tr_ze, sys_az, sys_ze)
side_slope = np.degrees(ss)
side_slope, rel_rot = tracking.calc_system_tracker_side_slope(
axis_azimuth, axis_tilt, *system_plane)
assert np.isclose(rel_rot, -77.14671562495475) # relative rotation
assert np.isclose(side_slope, expected_side_slope)
sat = tracking.singleaxis(
solpos.apparent_zenith, solpos.azimuth, axis_tilt, axis_azimuth,
Expand Down
42 changes: 24 additions & 18 deletions pvlib/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,49 +687,55 @@ def calc_tracker_axis_tilt(system_azimuth, system_zenith, axis_azimuth):
def calc_system_tracker_side_slope(
axis_azimuth, axis_tilt, system_azimuth, system_zenith):
"""
Calculate the slope perpendicular to the tracker axis relative to the
system plane containing the axes as well as the rotation of the tracker
axes relative to the system plane. Note in order for the backtracking
algorithm to work correctly on a sloped system plane, the side slope must
be applied to the tracker rotation.
Calculate the component of the slope perpendicular to the tracker axis
relative to the horizontal plane as well as the rotation of the tracker
axes relative to the "system" plane containing all of the tracker axes.
Note in order for the backtracking algorithm to work correctly on a sloped
system plane, the side slope must be applied to the tracker rotation.

Parameters
----------
system_azimuth : float
direction of normal to slope on horizontal [radians]
direction of normal to slope on horizontal [degrees]
system_zenith : float
tilt of normal to slope relative to vertical [radians]
tilt of normal to slope relative to vertical [degrees]
axis_azimuth : float
direction of tracker axes on horizontal [radians]
direction of tracker axes on horizontal [degrees]
axis_tilt : float
tilt of tracker [radians]
tilt of tracker [degrees]

Returns
-------
tracker side slope and rotation relative to system plane [radians]
tracker side slope and rotation relative to system plane [degrees]
"""
# convert to radians
system_azimuth_rad = np.radians(system_azimuth)
system_zenith_rad = np.radians(system_zenith)
axis_azimuth_rad = np.radians(axis_azimuth)
axis_tilt_rad = np.radians(axis_tilt)
sin_axis_tilt = np.sin(axis_tilt_rad) # sin(-x) = -sin(x)
# find the relative rotation of the trackers in the system plane
# 1. tracker axis vector
cos_tr_ze = np.cos(-axis_tilt)
sin_tr_az = np.sin(axis_azimuth)
cos_tr_az = np.cos(axis_azimuth)
cos_tr_ze = np.cos(-axis_tilt_rad)
sin_tr_az = np.sin(axis_azimuth_rad)
cos_tr_az = np.cos(axis_azimuth_rad)
tr_ax = np.array([
[cos_tr_ze*sin_tr_az],
[cos_tr_ze*cos_tr_az],
[np.sin(-axis_tilt)]])
[-sin_axis_tilt]])
# 2. rotate tracker axis vector from global to system reference frame
sys_z_rot = _get_rotation_matrix(system_azimuth, axis=2)
sys_z_rot = _get_rotation_matrix(system_azimuth_rad, axis=2)
# first around the z-axis
tr_ax_sys_z_rot = np.dot(sys_z_rot, tr_ax)
# then around x-axis so that xy-plane is the plane with slope and trackers
sys_x_rot = _get_rotation_matrix(system_zenith)
sys_x_rot = _get_rotation_matrix(system_zenith_rad)
tr_ax_sys = np.dot(sys_x_rot, tr_ax_sys_z_rot)
# now that tracker axis is in coordinate system of slope, the relative
# rotation is the angle from the y axis
tr_rel_rot = np.arctan2(tr_ax_sys[0, 0], tr_ax_sys[1, 0])
# find side slope
# 1. tracker normal vector
sin_tr_ze = np.sin(axis_tilt)
sin_tr_ze = sin_axis_tilt
tr_norm = np.array([
[sin_tr_ze*sin_tr_az],
[sin_tr_ze*cos_tr_az],
Expand All @@ -744,4 +750,4 @@ def calc_system_tracker_side_slope(
sys_tr_z_rot = _get_rotation_matrix(tr_rel_rot, axis=2)
tr_norm_sys_tr = np.dot(sys_tr_z_rot, tr_norm_sys)
side_slope = np.arctan2(tr_norm_sys_tr[0, 0], tr_norm_sys_tr[2, 0])
return side_slope, tr_rel_rot
return np.degrees(side_slope), np.degrees(tr_rel_rot)
0