{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n# Backtracking on sloped terrain\n\nModeling backtracking for single-axis tracker arrays on sloped terrain.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Tracker systems use backtracking to avoid row-to-row shading when the\nsun is low in the sky. The backtracking strategy orients the modules exactly\non the boundary between shaded and unshaded so that the modules are oriented\nas much towards the sun as possible while still remaining unshaded.\nUnlike the true-tracking calculation (which only depends on solar position),\ncalculating the backtracking angle requires knowledge of the relative spacing\nof adjacent tracker rows. This example shows how the backtracking angle\nchanges based on a vertical offset between rows caused by sloped terrain.\nIt uses :py:func:`pvlib.tracking.calc_axis_tilt` and\n:py:func:`pvlib.tracking.calc_cross_axis_tilt` to calculate the necessary\narray geometry parameters and :py:func:`pvlib.tracking.singleaxis` to\ncalculate the backtracking angles.\n\n## Angle conventions\n\nFirst let's go over the sign conventions used for angles. In contrast to\nfixed-tilt arrays where the azimuth is that of the normal to the panels, the\nconvention for the azimuth of a single-axis tracker is along the tracker\naxis. Note that the axis azimuth is a property of the array and is distinct\nfrom the azimuth of the panel orientation, which changes based on tracker\nrotation angle. Because the tracker axis points in two directions, there are\ntwo choices for the axis azimuth angle, and by convention (at least in the\nnorthern hemisphere), the more southward angle is chosen:\n\n\n\nNote that, as with fixed-tilt arrays, the axis azimuth is determined as the\nangle clockwise from north. The azimuth of the terrain's slope is also\ndetermined as an angle clockwise from north, pointing in the direction\nof falling slope. So for example, a hillside that slopes down to the east\nhas an azimuth of 90 degrees.\n\nUsing the axis azimuth convention above, the sign convention for tracker\nrotations is given by the\n`right-hand rule `_.\nPoint the right hand thumb along the axis in the direction of the axis\nazimuth and the fingers curl in the direction of positive rotation angle:\n\n\n\nSo for an array with ``axis_azimuth=180`` (tracker axis aligned perfectly\nnorth-south), pointing the right-hand thumb along the axis azimuth has the\nfingers curling towards the west, meaning rotations towards the west are\npositive and rotations towards the east are negative.\n\nThe ground slope itself is always positive, but the component of the slope\nperpendicular to the tracker axes can be positive or negative. The convention\nfor the cross-axis slope angle follows the right-hand rule: align\nthe right-hand thumb along the tracker axis in the direction of the axis\nazimuth and the fingers curl towards positive angles. So in this example,\nwith the axis azimuth coming out of the page, an east-facing, downward slope\nis a negative rotation from horizontal:\n\n\n\n\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rotation curves\n\nNow, let's plot the simple case where the tracker axes are at right angles\nto the direction of the slope. In this case, the cross-axis tilt angle\nis the same as the slope of the terrain and the tracker axis itself is\nhorizontal.\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"from pvlib import solarposition, tracking\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# PV system parameters\ntz = 'US/Eastern'\nlat, lon = 40, -80\ngcr = 0.4\n\n# calculate the solar position\ntimes = pd.date_range('2019-01-01 06:00', '2019-01-01 18:00', closed='left',\n freq='1min', tz=tz)\nsolpos = solarposition.get_solarposition(times, lat, lon)\n\n# compare the backtracking angle at various terrain slopes\nfig, ax = plt.subplots()\nfor cross_axis_tilt in [0, 5, 10]:\n tracker_data = tracking.singleaxis(\n apparent_zenith=solpos['apparent_zenith'],\n apparent_azimuth=solpos['azimuth'],\n axis_tilt=0, # flat because the axis is perpendicular to the slope\n axis_azimuth=180, # N-S axis, azimuth facing south\n max_angle=90,\n backtrack=True,\n gcr=gcr,\n cross_axis_tilt=cross_axis_tilt)\n\n # tracker rotation is undefined at night\n backtracking_position = tracker_data['tracker_theta'].fillna(0)\n label = 'cross-axis tilt: {}\u00b0'.format(cross_axis_tilt)\n backtracking_position.plot(label=label, ax=ax)\n\nplt.legend()\nplt.title('Backtracking Curves')\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This plot shows how backtracking changes based on the slope between rows.\nFor example, unlike the flat-terrain backtracking curve, the sloped-terrain\ncurves do not approach zero at the end of the day. Because of the vertical\noffset between rows introduced by the sloped terrain, the trackers can be\nslightly tilted without shading each other.\n\nNow let's examine the general case where the terrain slope makes an\ninconvenient angle to the tracker axes. For example, consider an array\nwith north-south axes on terrain that slopes down to the south-south-east.\nAssuming the axes are installed parallel to the ground, the northern ends\nof the axes will be higher than the southern ends. But because the slope\nisn't purely parallel or perpendicular to the axes, the axis tilt and\ncross-axis tilt angles are not immediately obvious. We can use pvlib\nto calculate them for us:\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# terrain slopes 10 degrees downward to the south-south-east. note: because\n# slope_azimuth is defined in the direction of falling slope, slope_tilt is\n# always positive.\nslope_azimuth = 155\nslope_tilt = 10\naxis_azimuth = 180 # tracker axis is still N-S\n\n# calculate the tracker axis tilt, assuming that the axis follows the terrain:\naxis_tilt = tracking.calc_axis_tilt(slope_azimuth, slope_tilt, axis_azimuth)\n\n# calculate the cross-axis tilt:\ncross_axis_tilt = tracking.calc_cross_axis_tilt(slope_azimuth, slope_tilt,\n axis_azimuth, axis_tilt)\n\nprint('Axis tilt:', '{:0.01f}\u00b0'.format(axis_tilt))\nprint('Cross-axis tilt:', '{:0.01f}\u00b0'.format(cross_axis_tilt))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"And now we can pass use these values to generate the tracker curve as\nbefore:\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"tracker_data = tracking.singleaxis(\n apparent_zenith=solpos['apparent_zenith'],\n apparent_azimuth=solpos['azimuth'],\n axis_tilt=axis_tilt, # no longer flat because the terrain imparts a tilt\n axis_azimuth=axis_azimuth,\n max_angle=90,\n backtrack=True,\n gcr=gcr,\n cross_axis_tilt=cross_axis_tilt)\n\nbacktracking_position = tracker_data['tracker_theta'].fillna(0)\nbacktracking_position.plot()\n\ntitle_template = 'Axis tilt: {:0.01f}\u00b0 Cross-axis tilt: {:0.01f}\u00b0'\nplt.title(title_template.format(axis_tilt, cross_axis_tilt))\nplt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note that the backtracking curve is roughly mirrored compared with the\nearlier example -- it is because the terrain is now sloped somewhat to the\neast instead of west.\n\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}