# What are the sources of error in the formula I derived to estimate sunrise and sunset times, and how can I improve its accuracy? [closed]

I derived the following formula to estimate sunrise and sunset times:

$$t=\pm\cos^{-1}\frac{\sin\theta-\sin L_{loc}\sin L_{sun}}{\cos L_{loc}\cos L_{sun}}$$

• $$L_{loc}$$ is the local latitude
• $$L_{sun}$$ is the solar latitude
• $$\theta$$ is the desired solar altitude angle (for sunset and sunrise, I used $$\theta=0$$)
• $$t$$ is the time, expressed as an angle of a 24-hour clock, and measured from solar noon

I used the solar latitude from here, and the times and local latitude for New York from here (it was October 20, 2020; link to correct month).

I tried this with my location and was about 4 minutes off with sunrise and sunset, and I tried it for New York and was also about 4 minutes off (I got 7:18:15am for sunrise and 6:02:55pm for sunset).

I'm wondering what are the main sources of error in my formula? My goal is for it to be accurate at least within a minute, and hopefully even down to a few seconds. What factors do I need to take into account in order to reach this level of accuracy?

Thanks!

• The symbol for latitude is traditionally $\phi$. Declination is $\delta$. And your $t$ is called the hour angle, $\omega_0$. – JEB Oct 21 at 2:16
• @JEB: Thanks! I'll leave my question as is, but I'll take note of these for the future. Is there a traditional symbol for the solar altitude angle? – Matt Oct 21 at 2:37
• – JEB Oct 21 at 2:57

Your error is assuming that sunrise and sunset occur at $$\theta = 0$$, this is incorrect for two reasons. The first being the sun's disk has a diameter of $$0.5^{\circ}$$, and the second is atmospheric refraction causes distortion which change the sun's apparent location on the horizon. Altogether, at sea level this leads to an angle of correction of about $$-0.83^{\circ}$$, use this as your theta.