Since Dec wraps around to Jan, you can fold the left and right to make a tube.
Since 23:59 wraps to 00:00 you can fold the top and bottom of the tube, making a torus (a donut).
For a fixed lat/long, each point on the torus corresponds to the sunlight observed at a particular time throughout the year. Why bother with a torus? The shape itself embeds the continuity of time across days/years that is otherwise left implicit in the typical 2D plot.
I've wanted to plot this in 3D or have it printed on a ring, but never got round to it.
Any one seen anyone do this?
Sounds neat!
https://www.loom.com/share/5665143f2d274bd0bf65ef378fad39a3
There's two toruses in the clip, one with the daylight on the inside, one with the daylight on the outside.
One thought I had while making this is that you could visualize multiple years, or even someone's whole life, as a string winding a long spiraling path down the length of a helix.
It'd also be nice if the colour was not just day/night, but the actual predicted daylight at the time of day, which would result in a continuously changing colour.
I guess at that point, the sine approximation from OP would no longer apply, and https://en.m.wikipedia.org/wiki/Sunrise_equation would have to be used.
https://searke.github.io/2017/01/08/TemperatureGraph.html
Also, coincidentally enough, for Chicago using Wolfram Language. Great minds think alike I guess.
Yep. There error plot clearly shows a 3rd harmonic dominating. IIRC the length of day is constant at the equator and the light/time function is a distorted sinewave as you go north or south from there. I am curious about the slope within a day. It seem to "get dark quickly" these day vs July.
See also, https://www.gaisma.com/en/ for some really good interactive sunlight graphs.
It's as close as the Earth's orbit is to a perfect circle and that the shapes of the earth and sun are to perfect spheres and as the axis of the earth has no wobble and no precession and the sun's rays are truly parallel and and there is no drag in space sapping energy from the dynamics and general relativity effects are sent to zero and so on.
Once everything is perfectly circular and simple and Euclidean, then it does become a perfect sinewave. Then the sinewave has period = 1 year, the amplitude is symmetric by latitude, and it's pretty easy to derive.
All the above (and more) all intorduce measurable errors from the perfect sinewave.
- The north-south component comes from the Earth's axial tilt
- The asymmetry from north to south comes from the elliptical nature of Earth's orbit, which is closer/faster in northern winter + further/slower in northern summer.
- The east-west movement comes from the equation of time, which is mostly a mix of the Earth's axial tilt and the eccentricity of its orbit.
https://en.wikipedia.org/wiki/Fourier_analysis
applies. Note the error looks a lot like a higher frequency sinusoid and if you added in that high frequency sinusoid the error would look like a much higher frequency sinusoid. Traditionally people who did celestial mechanics and positional astronomy would expand everything in terms of sinusoids until they got good enough accuracy.
You can check it out here: https://joe-antognini.github.io/astronomy/daylight
I think the most interesting part of this article is the bit at the end. What really is 'close'? We have so many 'rules of thumb' here but a real definition to target is elusive. Do you go off of pure utility? 'using this definition achieves my requirement to be corret xxx% of the time and now I make money using it' Or do you go off of something more like information content: 'when plotting the error it conforms to a normal curve...' Anyone got a good rule for 'close'?
If you have a system you can reason about completely, then sometimes you have a number that gives the absolute answer. Say you get error below floating point resolution.
But I guess it's otherwise what is perceptible or meaningful, either in quantity or percentage. A penny is not a life changing amount of money and something happening 0.01% of the time is rare enough to be tolerable.
This is infuriatingly difficult (because the lenght of a consecutive day-night pair needs not be 24 hours), and I'm beginning to think that it may not even be true.
We know that the duration between solar noons is the same every day (24hrs + a little bit). So let's slice that up into day and night. Consider the two solar noons that adjoin the maximum night duration. I claim one of those two noons happens during the shortest day.
We have
midnight -> Sunrise -> noon -> sunset -> midnight -> sunrise -> noon -> sunset.
We know noon .. noon is fixed at 24hrs +a bit. Same with midnight..midnight. We know that midnight..noon is about 12 hours (+ half a bit). This is just orbital mechanics.
We know sunset..midnight..sunrise is periodic over the year, with one maximum duration.
Therefore we know that noon..midnight..noon contains a periodic amount of dark time with one maximum. Let that time be |D|.
Let |L| be the "light time" either the preceeding or following midnight..noon..midnight period - whichever has less light.
Since midnight..noon..midnight..noon has 36 hrs (ish), then |D|+|L| = 36 (ish), so maximum darkness must have a minimum light time.
The former trivially proven true, because the sum is constant.
I bet the latter has a counter example somewhere where the summer/winter time transition means the day (or night) length changes more than the difference between then and the solstice.
Even if not that, time zones and calendars can be changed by law, so there's been a few entirely absent days — one of my dad's stamp collection anecdotes was about post where the response was dated before the original message, and neither was incorrect, because one was Gregorian and the other Julian.
[1] https://en.wikipedia.org/wiki/Solar_time#Apparent_solar_time
But suppose you fixed the base frequency (which wouldn't be a bad idea). You still seem to have a nonlinear fit, because the phase (the "f" in the model equation in OP) is buried inside sin(). Why are we needing a nonlinear function-fitting process when the Fourier transform is linear?
Of course, you can bring the phase outside by adding in a cos() term with its own amplitude. Now instead of the phase "f" you have an interplay between the amplitude of the sin and cos terms, and those amplitudes are linear in the data.
The resulting fit (or recursive sequence of fits) would indeed be the Fourier transform.
The key property is the orthogonality of the various harmonics. That's what allows the sequence of single-frequency fits to not step on each other.