Demystifying Solar Position and Sunrise/Sunset Calculations

The accurate determination of solar position is essential in various fields, including solar energy production, architecture, agriculture, and even photography. By understanding the position of the sun at any given time and location, we can optimize the efficiency of solar panels, design buildings with better natural lighting, plan crop planting schedules, and capture stunning sunrises and sunsets in photography.

In this blog post, we will cover the necessary equations and calculations for determining solar positions and predicting sunrise and sunset times. With these tools, you will be well-equipped to apply this knowledge in various applications and make more informed decisions based on the sun’s position.


Solar Position Calculations

Calculating the fractional year (γ)

The concept of the fractional year refers to representing a specific day and time within a year as a fraction. This fraction is essential for solar position calculations, as it helps in determining the sun’s position relative to Earth throughout the year. The fractional year is measured in radians and accounts for the Earth’s elliptical orbit around the sun.

The equation for calculating the fractional year (γ) is as follows:

γ = (2π / 365) * (day_of_year – 1 + (hour – 12) / 24)

Here, the day_of_year refers to the number of days passed since the beginning of the year, and the hour represents the current hour (in a 24-hour format). The value of 365 in the denominator represents the number of days in a non-leap year.

For leap years, the denominator should be adjusted to 366 to account for the extra day. The modified equation for leap years is:

γ = (2π / 366) * (day_of_year – 1 + (hour – 12) / 24)

By calculating the fractional year (γ), we can estimate various solar parameters, such as the equation of time and solar declination angle, which are crucial for solar position calculations.


Estimating the equation of time and solar declination angle

The equation of time is a measure of the difference between the time measured by a sundial (apparent solar time) and the time measured by a clock (mean solar time). This difference arises due to the Earth’s elliptical orbit and axial tilt, causing the sun to appear faster or slower than the average solar day (24 hours). The equation of time is typically expressed in minutes.

Earth’s orbit
Axial Tilt

The solar declination angle is the angle between the rays of the sun and the plane of the Earth’s equator. This angle varies throughout the year due to the Earth’s axial tilt and its orbit around the sun. The declination angle is crucial for determining the sun’s altitude and azimuth angles, which are essential for solar position calculations. The solar declination angle is measured in radians.

solar declination angle

Using the fractional year (γ) calculated in the previous section, we can estimate the equation of time (eqtime) and the solar declination angle (decl) using the following equations:

eqtime = 229.18 * (0.000075 + 0.001868 * cos(γ) – 0.032077 * sin(γ) – 0.014615 * cos(2γ) – 0.040849 * sin(2γ))

decl = 0.006918 – 0.399912 * cos(γ) + 0.070257 * sin(γ) – 0.006758 * cos(2γ) + 0.000907 * sin(2γ) – 0.002697 * cos(3γ) + 0.00148 * sin(3γ)

In these equations, cos() and sin() represent the cosine and sine trigonometric functions, respectively. The values for eqtime and decl, derived from these equations, are essential components for further solar position calculations, such as true solar time and solar zenith and azimuth angles.


Calculating true solar time

True solar time is a measure of the actual position of the sun in the sky relative to a specific location on Earth. It is based on the sun’s transit across the local meridian (the imaginary line in the sky that runs from the north celestial pole to the south celestial pole, passing directly overhead). At true solar noon, the sun reaches its highest point in the sky for that day, directly above the local meridian. True solar time is essential for solar position calculations, as it accounts for the variations caused by the equation of time and the observer’s longitude.

The sun’s position vector relative to the earth-centre frame

To calculate the true solar time, we first need to find the time offset (in minutes), which is the difference between the local solar time and the mean solar time. The equation for time_offset is:

time_offset = eqtime + 4 * longitude – 60 * timezone

In this equation, eqtime is the equation of time (in minutes), longitude is the observer’s longitude in degrees (positive to the east of the Prime Meridian), and timezone is the observer’s time zone in hours from UTC (e.g., U.S. Mountain Standard Time = -7 hours).

Once we have the time offset, we can calculate the true solar time (tst) in minutes using the following equation:

tst = hr * 60 + mn + sc / 60 + time_offset

In this equation, hr represents the current hour (0 – 23), mn represents the current minute (0 – 59), and sc represents the current second (0 – 59). By calculating the true solar time (tst), we can determine the sun’s position in the sky for any given location and time.

With the true solar time (tst) at hand, we can proceed to calculate other essential solar parameters, such as the solar hour angle, and ultimately the solar zenith and azimuth angles.


Finding the solar hour angle

The solar hour angle is a measure of the sun’s position in the sky relative to the observer’s local meridian. It is expressed in degrees and represents the elapsed time (in hours) since solar noon, with each hour corresponding to 15 degrees of rotation. The solar hour angle is an essential parameter for calculating the solar zenith and azimuth angles, which provide the precise position of the sun in the sky at a given location and time.

Solar hour angle

The equation for the solar hour angle (ha) is as follows:

ha = (tst / 4) – 180

In this equation, tst is the true solar time calculated in the previous section, expressed in minutes. The solar hour angle (ha) ranges from -180 degrees at solar midnight to +180 degrees at solar noon.

By determining the solar hour angle, we can use it along with other parameters such as the solar declination angle and the observer’s latitude to calculate the solar zenith and azimuth angles, providing a complete understanding of the sun’s position in the sky.


Calculating solar zenith and azimuth angles

The solar zenith angle (Φ) is the angle between the sun’s rays and a line perpendicular to the Earth’s surface (the zenith) at a specific location and time. It is measured from directly overhead (0 degrees) to the horizon (90 degrees). The solar zenith angle provides information about the sun’s elevation in the sky and is essential for various applications, including solar energy production and architectural design.

Solar angles

The solar azimuth angle (θ) represents the sun’s position in the sky relative to the observer’s location, measured in degrees clockwise from the north. This angle helps to determine the direction of the sun in the sky and is crucial for accurately positioning solar panels and understanding the sun’s path throughout the day.

Using the solar hour angle (ha), latitude (lat), and solar declination angle (decl) calculated in the previous sections, we can find the solar zenith angle (Φ) using the following equation:

cos(Φ) = sin(lat) * sin(decl) + cos(lat) * cos(decl) * cos(ha)

To calculate the solar azimuth angle (θ), we use the following equation:

cos(180 – 𝜃) = – (sin(lat) * cos(Φ) – sin(decl) * cos(lat) * sin(Φ)) / (cos(decl) * cos(Φ))

By determining both the solar zenith and azimuth angles, we obtain a complete understanding of the sun’s position in the sky at any given location and time, which is essential for various applications, such as optimizing solar panel orientation and predicting sunlight patterns in architectural design.


Sunrise and Sunset Calculations

Setting the zenith for sunrise/sunset

When calculating sunrise and sunset times, it is necessary to adjust the solar zenith angle to account for specific factors that influence the moment the sun appears or disappears below the horizon. The solar zenith angle is set to 90.833° for sunrise and sunset calculations. This value represents a correction that accounts for two main factors:

  • Atmospheric refraction: As sunlight passes through the Earth’s atmosphere, its path is bent, causing the sun to appear slightly higher in the sky than its actual position. The bending effect is more significant when the sun is close to the horizon, such as during sunrise and sunset. The 0.833° correction accounts for this refraction effect.
  • Solar disk size: The sun appears as a disk in the sky, rather than a single point of light. As a result, sunrise is defined as the moment when the upper edge of the sun’s disk appears above the horizon, and sunset is when the upper edge disappears below the horizon. The 0.000° correction accounts for the sun’s angular diameter, which is approximately 0.53°.

By setting the zenith to 90.833° for sunrise and sunset calculations, we can accurately determine the time at which these events occur, accounting for atmospheric refraction and the sun’s angular diameter.


Calculating the hour angle for sunrise/sunset

To calculate the hour angle for sunrise and sunset, we use the following equation:

ha = ± arccos{ (cos(90.833) / (cos(lat) * cos(decl))) – (tan(lat) * tan(decl)) }

In this equation, lat represents the observer’s latitude, and decl represents the solar declination angle. The positive value of the hour angle (ha) corresponds to sunrise, while the negative value corresponds to sunset.


Determining the UTC time of sunrise and sunset

To determine the UTC time of sunrise (or sunset), we use the following equation:

sunrise = 720 – 4 * (longitude + ha) – eqtime

In this equation, longitude represents the observer’s longitude in degrees (positive to the east of the Prime Meridian), ha is the hour angle calculated in the previous step, and eqtime is the equation of time (in minutes). For calculating the time of sunset, the same equation is used, with the negative value of ha.

The importance of longitude, hour angle, and equation of time in the calculation lies in their contributions to accurately determining the sun’s position relative to the observer’s location on Earth. Longitude helps account for the Earth’s rotation, ensuring the calculation is specific to the observer’s geographic location. The hour angle represents the elapsed time since solar noon, which is crucial for determining the sun’s position in the sky. The equation of time accounts for variations in the Earth’s orbit and axial tilt, which affect the sun’s apparent motion in the sky. By incorporating these factors into the calculation, we can accurately determine the UTC time of sunrise and sunset for any location on Earth.

It is important to note that the result of the equation is given in UTC time, so you may need to convert it to your local time, considering daylight saving time if applicable, to obtain the exact time of sunrise or sunset for your specific location.

In summary, the combination of longitude, hour angle, and equation of time in the sunrise and sunset calculations provides a precise understanding of these events, which is essential for various applications, such as optimizing solar energy production, planning outdoor activities, or predicting daylight hours for agricultural purposes.

Calculating solar noon

Solar noon is the moment when the sun is at its highest point in the sky for a specific location, directly above the local meridian. It is the time when the sun is precisely due north or south (depending on the observer’s latitude) and when shadows are the shortest. Solar noon is essential for various applications, such as solar panel alignment and architectural design, as it represents the sun’s peak daily elevation.

The equation for solar noon (snoon) is as follows:

snoon = 720 – 4 * longitude – eqtime

In this equation, longitude represents the observer’s longitude in degrees (positive to the east of the Prime Meridian), and eqtime is the equation of time (in minutes). The result indicates the time of solar noon in UTC, which can be converted to local time as needed.


Conclusion

Understanding solar position and sunrise/sunset calculations is vital for numerous applications, such as optimizing solar energy production, architectural design, agriculture, and outdoor event planning. The equations and concepts provided in this blog post allow you to accurately determine the sun’s position in the sky and the timing of sunrise, sunset, and solar noon for any location on Earth.

We encourage readers to use these equations and concepts in their own projects or research, as they offer valuable insights into the sun’s behavior and its impact on our daily lives. Accurate solar position and sunrise/sunset calculations can significantly benefit engineering fields related to solar energy, such as photovoltaic system design and solar thermal applications, by enabling the optimization of solar panel orientation, maximizing energy capture, and improving overall system efficiency. Additionally, these calculations can contribute to architectural design, allowing for better use of natural light and passive solar heating, which can lead to energy savings and enhanced occupant comfort.