Skip to content

Commit 8749240

Browse files
authored
Fix bug in calculation of declination angle
The calculation of the declination angle (`delta_r`) was incorrect due to a missing backslash which resulted in the second half of the equation being ignored. For reference see the pvlib implementation [pvlib.solarposition.spencer71](https://pvlib-python.readthedocs.io/en/stable/generated/pvlib.solarposition.declination_spencer71.html#pvlib.solarposition.declination_spencer71).
1 parent cada115 commit 8749240

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Engerer2Separation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def engerer2separation(ghi, latitudes, longitudes, time, averaging_period):
107107

108108
# Declination angle
109109
phi_r = (2 * np.pi / 365) * (day_of_year + (decimal_time / 24) - 1)
110-
delta_r = 0.006918 - 0.399912 * np.cos(phi_r) + 0.070257 * np.sin(phi_r) - 0.006758 * np.cos(2 * phi_r)
111-
+ 0.000907 * np.sin(2 * phi_r) - 0.002697 * np.cos(3 * phi_r) + 0.001480 * np.sin(3 * phi_r)
110+
delta_r = 0.006918 - 0.399912 * np.cos(phi_r) + 0.070257 * np.sin(phi_r) - 0.006758 * np.cos(2 * phi_r) \
111+
+ 0.000907 * np.sin(2 * phi_r) - 0.002697 * np.cos(3 * phi_r) + 0.001480 * np.sin(3 * phi_r)
112112

113113
# Zenith angle
114114
zen = np.arccos(np.sin(np.pi / 180 * latitudes) * np.sin(delta_r) + np.cos(np.pi / 180 * latitudes) *

0 commit comments

Comments
 (0)