This is a simplistic model for the sun's path through the sky, and the dependence of the amount of daytime upon latitude and time of year. Skipped steps/algebra may be found in the manuscript (624 KB PDF).
Approximations must be made, that this problem be doable. In roughly decreasing order of accuracy (according to my gut):
The last assumption of no refraction is the weakest, usually affecting sunrise and sunset times by several minutes. Later on I give a first-order correction to account for this.
The equatorial coordinate system has origin at the centre of the earth, x-axis pointing towards the northern spring (or March) equinox (春分), and xy-plane the plane of the earth's equator (赤道). Thus the z-axis is the north pole. The earth spins once (relative to the fixed stars) about this axis every sidereal day. The sun revolves once (relative to the fixed stars) every solar year, but its path, the ecliptic (黃道), lies not in the plane of the equator but in the ecliptic plane, which is tilted with respect to the equatorial xy-plane by earth's axial tilt \tau = 23\degree \, 26'.
We also have the associated right-handed spherical coordinates (r, \theta, \phi), given by
Thus r is the distance from the centre of the earth, \theta the angle from the north pole, and \phi the angle east from the spring equinox. Note that \theta = \pi/2 - \delta, where \delta is the astronomer's declination, and that \phi is equivalent to the astronomer's right ascension.
Finally we have the ecliptic coordinate system (\tilde{x}, \tilde{y}, \tilde{z}), whose \tilde{x}-axis coincides with the equatorial x-axis, but whose \tilde{y}- and \tilde{z}-axes are tilted by tilt \tau in the right-handed sense about the positive x-axis:
Let t be the time since the northern spring (or March) equinox. The sun goes once around the ecliptic every solar year (yr), equal to 365.242 days. Defining what I call the year angle
which moves through a full turn each solar year, the sun's position is therefore given in ecliptic coordinates by
where R_\mathrm{es} is the earth–sun distance.
In the northern hemisphere, Y = 0\degree, 90\degree, 180\degree, 270\degree correspond to spring equinox (春分), summer solstice (夏至), autumnal equinox (秋分), and winter solstice (冬至) respectively.
We consider an observer at latitude \delta measured north from the equator. In equatorial spherical coordinates, the observer has radius r_\mathrm{obs} = R_\mathrm{e} (the radius of the earth) and zenith angle \theta_\mathrm{obs} = \pi/2 - \delta.
Now a mean solar day (day), 24 hours, is the time it takes for the earth to spin once relative to the sun, whereas a sidereal day (sd) is the time it takes for the earth to spin once relative to the fixed stars. Since the sun revolves once around the ecliptic every solar year, the number of sidereal days per year is one more than the number of solar days:
Therefore you would be correct in saying that the observer's azimuthal angle is \phi_\mathrm{obs} = 2 \pi t / {\unit{sd}}, which moves through a full turn every sidereal day. However, I won't be doing this. Instead, I shall use the fact that a day (whether solar or sidereal) is much shorter than a year, so that over the course of a day, the year angle Y is almost constant (it only changes by order \unit{day} / {\unit{yr}} = 1 / 365.242 = 0.3\%).
Thus, to make the maths simpler, I shall assert that Y actually is constant over a day, and compensate for the associated error by instead putting \phi_\mathrm{obs} = 2 \pi t / {\unit{day}}. You may doubt me if you like, but my intuition says that this will work.
Defining what I call the day angle
which moves through a full turn every solar day, the observer's position is given in equatorial spherical coordinates by
Moving the sun's position from ecliptic (\tilde{x}, \tilde{y}, \tilde{z}) coordinates to equatorial (x, y, z) coordinates, we obtain
Now the distance from the origin to the observer is the earth's radius R_\mathrm{e}, and by assumption this is infinitesimally small compared to the earth–sun distance R_\mathrm{es}. Thus the direction (or unit vector) from the observer towards the sun is
where
and \basisvec{x}, \basisvec{y}, \basisvec{z} are the Cartesian basis vectors. But since we are interested in what the observer sees, we must transform this into the local spherical basis, i.e. put
where \basisvec{r} points up (上), \basisvec{\theta} points south (南), and \basisvec{\phi} points east (東).
Unlike the Cartesian basis, the spherical basis is dependent upon (the observer's) position, and the components transform as follows:
This looks rather horrible. To simplify it, I define what I call the tilt-reduced unit radius and the tilt-reduced year angle,
where \tan^{-1} (y/x) is an abuse of notation meaning \mathrm{atan2} (y, x) (in other words \varphi is always in the same quadrant as Y).
After some algebra, the components of the direction from the observer towards the sun simplify to
Let us ponder these for a moment. Since Y is constant over the course of a day, so are \rho and \varphi. Thus the components are sinusoidal in D, with a period of one (solar) day. Since \cos\delta is nonnegative, the upward component u_r is maximised at D = \varphi. I would wager (but can't be bothered showing) that the sun's angle of elevation \tan^{-1} (u_r / \sqrt{{u_\theta}^2 + {u_\phi}^2}) is also maximised at D = \varphi, corresponding to solar noon (or high noon). This makes perfect sense; notice that the eastward component u_\phi is zero and decreasing at D = \varphi, i.e. the sun is crossing the local meridian (the north-south arc of the sky) from east to west. (Similarly we have solar midnight at D = \varphi + \pi, when the sun is closest to the nadir, the local downward direction.)
NOTE: Solar noon (or high noon) almost never occurs at 12 pm. There are several reasons for this:
This has been accounted for by our model; notice that solar noon occurs at D = \varphi rather than D = Y.
The sun moves faster and slower at different times of the year.
Clock time jumps discontinuously over their boundaries (which are arbitrary), whereas local solar time is a smooth function of location.
Sunrise and sunset occur when the sun passes through the horizon, i.e. when the upward component u_r vanishes, or
This solves to give
where D = D_- corresponds to sunrise, and D = D_+ to sunset. (Noon, D = \varphi, is halfway between the two.) The day angle which elapses between sunrise and sunset is therefore
Multiplying this by \unit{day} / (2 \pi) gives the amount of time between sunrise and sunset,
NOTE: The argument to the arcsine will exceed unity in magnitude at some time during the year if \abs{\tan\tau \tan\delta} > 1, or
In such a case there is no real solution to the sunrise/sunset equation. This corresponds to midnight sun (24 hr daylight) and polar night (24 hr darkness), which occur for observers north of the Arctic Circle and south of the Antarctic Circle (give or take due to refraction).
Yet it is very interesting to note that taking the real part of the above expression for T will give the correct daytimes, that is, \Re \curlybr{T} = 24 \unit{hr} for midnight sun and \Re \curlybr{T} = 0 for polar night. This is because
Let
Then the sun's altitude (or elevation angle) is given by
At solar noon this becomes
The sun's bearing (measured clockwise from north) is given by
and at sunrise/sunset this becomes
where the lower signs are for sunrise and the upper signs are for sunset. This goes imaginary for midnight sun and polar night, i.e. when \abs{\tan\tau \tan\delta \sin\varphi} > 1.
At the time of writing (of the manuscript) it is Sunday 7 July 2019. The northern spring equinox fell on Thursday 21 March this year at 05:58 (UTC+08:00). Thus we have
Before proceeding any further, we briefly compare our model for daytime against timeanddate.com (T&D) for Hong Kong and Perth:
The errors are just over 1%; not bad for something derived with pen and paper.
Nevertheless our model underestimates daytime by around 10 minutes. The weakest assumptions in our model are the ignoring of atmospheric refraction and the treating of the sun as a point. Because light bends through the atmosphere, the sun is visible even though it is slightly below the horizon. Also sunrise/sunset occur when the leading/trailing edge of the sun passes through the horizon, rather than its centre.
According to a now linked-rotted Hong Kong Observatory article by Tong Yu-fai entitled Effect of atmospheric refraction on the times of sunrise and sunset (which the Wayback Machine could not save at the time of writing), refraction contributes around 0°34' of angular discrepancy, and the apparent radius of the sun contributes 0°16', so that altogether, the sun is 0°50' below the horizon at sunrise/sunset. These values are consistent with those in Allen's Astrophysical Quantities (1973):
In any case I think the final angle of 0°50' is reliable; this Hong Kong Observatory document (archived version) uses it for computing sunrise/sunset times.
A correction to daytime which accounts for refraction and the sun's apparent radius can be obtained by seeking the times at which the sun's altitude \alpha dips to
where \alpha_\mathrm{ref} = 0\degree \, 50'. Presumably these times will not be far from the approximate sunrise/sunset times we have already calculated, so we seek \eps_\pm such that
Assuming \eps_\pm \ll 2 \pi, we obtain (to first order)
so that the amount of daytime is to be corrected by
For the 7 July example above, this evaluates to +8 minutes for Hong Kong and +9 minutes for Perth. In both cases the refined model (with the refraction correction) is able to predict daytime to within two minutes:
Here I have extended the 7 July example above to more locations, again using values from timeanddate.com for reference.
The sun's noon altitude is not computed for the refined model, as the above refraction correction is only valid near the horizon for sunrise and sunset.
Location (\delta) |
Source of values |
Daytime | Sun's altitude at noon |
Sun's bearing at | |
---|---|---|---|---|---|
sunrise | sunset | ||||
Station Nord (+81°36') |
T&D | 24 hr | 31.0° | N/A (midnight sun) |
|
Model | 24 hr | 30.8° (−0.2°) | |||
Refined model | 24 hr | ||||
Reykjavik (+64°9') |
T&D | 20 hr 26' 51" | 48.4° | 24° | 335° |
Model | 19 hr 47' (−3.2%) | 48.3° (−0.1°) | 29.0° (+5.°) | 331.0° (−4.°) | |
Refined model | 20 hr 19' (−0.6%) | 25.4° (+1.°) | 334.6° (−0.°) | ||
London (+51°30') |
T&D | 16 hr 25' 57" | 61.1° | 51° | 309° |
Model | 16 hr 10' (−1.6%) | 60.9° (−0.2°) | 52.2° (+1.°) | 307.8° (−1.°) | |
Refined model | 16 hr 24' (−0.2%) | 50.9° (−0.°) | 309.1° (+0.°) | ||
Hong Kong (+22°19') |
T&D | 13 hr 26' 41" | 89.7° | 65° | 295° |
Model | 13 hr 18' (−1.1%) | 89.9° (+0.2°) | 65.7° (+1.°) | 294.3° (−1.°) | |
Refined model | 13 hr 26' (−0.1%) | 65.3° (+0.°) | 294.7° (−0.°) | ||
Singapore (+1°17') |
T&D | 12 hr 11' 31" | 68.7° | 67° | 293° |
Model | 12 hr 4' (−1.0%) | 68.9° (+0.2°) | 67.6° (+1.°) | 292.4° (−1.°) | |
Refined model | 12 hr 11' (−0.1%) | 67.6° (+1.°) | 292.4° (−1.°) | ||
Perth (−31°57') |
T&D | 10 hr 8' 18" | 35.5° | 64° | 296° |
Model | 10 hr 1' (−1.2%) | 35.6° (+0.1°) | 63.3° (−1.°) | 296.7° (+1.°) | |
Refined model | 10 hr 10' (+0.3%) | 63.9° (−0.°) | 296.1° (+0.°) | ||
Enderby Land @6630103 (−67°30') |
T&D | 2 hr 3' 28" | 0.4° | 14° | 346° |
Model | 0 hr 41' (− 67%) | 0.1° (−0.3°) | 4.7° (− 9°) | 355.3° (+ 9°) | |
Refined model | 4 hr 14' (+106%) | 29.1° (+15°) | 330.9° (−15°) | ||
Concordia Station (−75°6') |
T&D | 0 hr | −7.7° | N/A (polar night) |
|
Model | 0 hr | −7.5° (+0.2°) | |||
Refined model | 0 hr |
With the exception of Enderby Land, the refined model does quite well; the refraction correction brings daytimes to within 0.5%, and sunrise/sunset bearings to within 1°. The refined model performs poorly for Enderby Land because polar night has recently ended on 26 June (just 11 days earlier), so the sun is spending a rather large proportion of the day near the horizon (where refraction is significant); the correction for Enderby Land actually makes things worse (I think this is because the associated value of \abs{\eps_\pm} = 0.46 is not small enough for the perturbation to work properly).
Note that the refraction correction is a first-order perturbation about the no-refraction sunrise and sunset times, and as such it cannot predict the early start and late end of midnight sun, nor the late start and early end of polar night, compared to an hypothetical Earth with no atmosphere.
The amount of daytime (without refraction) is
where
The sun's bearing at sunrise/sunset (measured clockwise from north) is given by
where the lower signs are for sunrise and the upper signs are for sunset.
A first-order correction to daytime which accounts for refraction by angle \alpha_\text{ref} (taken to be 0°50') is given by
The corresponding corrected bearings at sunrise/sunset may be computed by evaluating \beta = \tan^{-1} (E / {-S}) at D = D_\pm + \eps_\pm, where D_\pm is given in the section Daytime duration above, S & E in Assorted angles, and \eps_\pm in Refraction correction.
The sun's altitude (or elevation angle) at noon is given by
Conway (2022). Daytime: dependence on latitude and season. <https://yawnoc.github.io/math/daytime> Accessed yyyy-mm-dd.