Approximating mean daily and hourly temperature beyond Fourier series Summary: What "well-known" and short parametrized mathematical 
function describes daily and hourly temperature for a given location? 
If you look at the mean daily temperature graph for a given location, 
it looks like a sine wave with a period of one year. 
Similarly, the hourly temperature for a given day for a given location 
also looks like a sine wave with a period of one day. 
However, closer inspection (Fourier analysis) shows that they're 
not. There are fairly strong components of frequency 2/year and 3/year 
for the daily temperature, and the hourly temperature also has strong 
non-single-period terms. 
Is there a parametrized function that reasonably describes the daily 
mean temperature and (a separate function) the hourly mean 
temperature? The parameters would be location-based. 
I realize I can keep taking more Fourier terms to increase accuracy, 
but I was hoping for something more elegant. For example, maybe the 
graph is a parametrized version of sin^2(x) or some other 
"well-known" function. 
 A: There's no simple and surely no analytic function describing the daily cycles of the temperature. It's not hard to see why: while you could add some higher harmonics etc., the actual process clearly contains many unsmooth points. During the day, when the Sun is visible, the temperature typically increases, and the rate of increase is maximum around the noon.  The maximum temperature during the day is reached around 2 p.m. in average.
However, after the sunset, the Sun's warming effect goes pretty much strictly to zero. So the second derivative of the temperature is discontinuous after the sunset. Moreover, the time of the sunrise and sunset depend on the seasons and latitude. You can't get any universal answer for what you're looking for, and even a function that would be OK would have to depend on several parameters and contain unsmooth functions such as the absolute value.
A: Even a very simple model, say an infinetly thick conductive slab in space so that you only have to deal with radiative effects (solar absorption, and thermal heat loss) gets messy, the solar input is zero at night but follows a curve during the day (easily computable via geometry), but solar input at sunrise and sunset will be discontuous in the first time derivative, which should introduce high order harmonics. Also the Stefan Boltzmann equation is nonlinear in temperature. Then add an atmosphere, it heats the surface until the thermal structure supports convection, so different transport mechanisms are important during different times of day. Then add clouds and variable weather systems....
If you just want to reasonably reproduce the curves, I'd use only a couple of annual and daily harmonics, otherwise you are probably going to overfit the data. But the statisticians would be the best people to consult about it.
