pvlib / twoaxistracking

twoaxistracking is a python package for simulating two-axis tracking solar collectors, particularly self-shading.
http://twoaxistracking.rtfd.io/
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Possible error in horizon shading condition #18

Closed kandersolar closed 2 years ago

kandersolar commented 2 years ago

I think this condition is not quite correct:

https://github.com/pvlib/twoaxistracking/blob/860208c2c135ca4472620330cc72b3c894d9656c/twoaxistracking/shading.py#L58-L61

Seems like it should be the tangents of solar_elevation and slope_tilt being compared, not the angles themselves.

AdamRJensen commented 2 years ago

It very well could be. I'll try and look more into it tomorrow.

I made some preliminary comparisons tonight, and as far as I can tell it doesn't have any effect whether they are tangenized or not.

Assuming this is what you mean:

elif np.tan(np.deg2rad(solar_elevation)) < \
    - np.cos(np.deg2rad(slope_azimuth-solar_azimuth)) * np.tan(np.deg2rad(slope_tilt)):
    return 1
AdamRJensen commented 2 years ago

I derived the angle using the definition in Figure 8 of reference [1], and it does indeed include taking the tangent of both angles... so I'm inclined to say that you are correct @kanderso-nrel

[1] Kevin Anderson and Mark Mikofski, "Slope-Aware Backtracking for Single-Axis Trackers", Technical Report NREL/TP-5K00-76626, July 2020. https://www.nrel.gov/docs/fy20osti/76626.pdf

AdamRJensen commented 2 years ago

@kanderso-nrel I suppose the tangent should also be taken of both angles here:

https://github.com/pvlib/twoaxistracking/blob/f435e1ca9a57189a4e6a6f72bb1adc5da943c4fb/twoaxistracking/layout.py#L122-L124

kandersolar commented 2 years ago

Yeah I agree. It's the same math as pvlib.tracking.calc_axis_tilt: https://github.com/pvlib/pvlib-python/blob/df1c56e92d91701319adad4fe5cf98837edad0fb/pvlib/tracking.py#L528-L565