Question:
What data points should I use to create a sine graph of daylight hours in a particular city and year?
alice
2012-11-23 07:04:01 UTC
I need to create a sine graph of the daylight hours for a particular city/year based on a set of data from the US Naval Observatory. I'm not sure how to do this.... What data points should I use on my graph, so that I can eventually create a formula modelling the hours of daylight using the form y=D+A sin [B(t-c)]?
Five answers:
Guru
2012-11-23 07:09:17 UTC
You should plot the daylight hours against the date to get a picture of the sine wave, to see how it looks. To find the values of the constants in y=D+A sin [B(t-c)], you can pick them off the plot (see below on how to do that).



The equation y=D+A sin [B(t-c)] is the general equation for a sine wave. Not all terms are used in all cases. So, first plot the sine wave on a chart, and from that you can discern the parameters for the sine equation.



Start by giving each date of the calendar a number from 0 to 364, from Jan 1 to Dec 31. Lets call this the day number.



Now, from the US Naval Observatory data, plot the hours of daylight against the day number for whatever data you have. You should get a sine-wave looking plot.



Now, lets figure out the equation parameters.

y=D+A sin [B(t-c)]



A = Amplitude, = peak-to-peak value / 2. Lets say that the maximum number of daylight hours is 14, and the minimum number of hours is 8. In this case, A = (14 - 8) / 2 = 3 hours. That is, both the positive and negative peaks of the sine wave will be 3 units away from the mean value of the wave.



D = offset. This is the average value of the sine wave. In the example above, D = (14 + 8) / 2 = 11 hours. The average value of sine wave ( y = sin(x) ) is zero. So, if your sine wave isn't centered about the x-axis, which it wont be in this case, because there's no such thing as negative daylight, the sinewave will have some average value. That is, there is some average value of sunlight across the year, with a maximum and minimum about that average, represented by the amplitude.



C represents the phase of the waveform. From the basic sine equation, y = sin(t), when t = 0, y = 0. That is, the value of the sine wave is right at its average value, with a rising slope. Now, for your equation, when t = 0 (date of Jan 1), the sine wave may not be at its average value. So, find a value of t (the date number) where the sine wave is at its average value and the slope is rising. Let's say that the average value occurs in April 1, so that the date number is 90 (90 days since the start of the year). This is the value that you'd use for C. All C is is an offset along the x-axis that shifts the equation left or right.



t is the date number. This is the input variable.



B is a scaling factor. The sin() function is periodic over a range of 2pi, which is a value of 6.28... But your input ranges from 0 to 364. So you need to scale it so that 0 maps to 0 and 364 maps to 2pi.



Set B = 2pi / 364



Since t ranges from 0 to 364, when you multiply B * t, you'll get a range from 0 to 2pi, which will give you one sine wave period across the full year.



Hope this helps,



-Guru
Elizabeth M
2012-11-23 07:27:39 UTC
Plot a graph of your data and see how well it fits a sine graph. You should join the points

smoothly. This graph should repeat itself regularly which you can estimate the value of pi/B and so B. The value of A is half the distance between a maximum point and a minimum points on the graph.

If a max point on the graph is ymax then ymax=D+A and the minimum value ymin=D-A

so D=(ymax+ymin)/2.

Make your estimates of B,A, c and D by taking several readings then using an average of these

readings.

You do not say what y and t represent. The number of daylight hours per day will vary throughout

the year. If y is the daylight hours it could vary from 0 to 24 and the days t would vary from 1 to 365.
Good guy
2012-11-23 07:31:24 UTC
Hello Alice



Look at what I've done in 2007, it might help. It is an excel file.



http://img593.imageshack.us/img593/1248/daylightsheet.png

http://img706.imageshack.us/img706/5584/daylightgraph.png



If you don't understand french,

- Lever = sunrise

- Coucher = sunset

- Durée j. = Duration of day (in minutes)

- Durée n. = Duration night (in minutes)

On the graph :

- Durée de la journée = daylight duration

- Matin = morning

- Soir = evening



If you know the data at Dec 21st (min) and June 21st (max) you can graph the sinusoid.

The period is 1 year of course.



But I don't remember how to create the formula, sorry



I hope i helped, though



Bye !
Ed I
2012-11-23 07:10:16 UTC
It depends on how accurate you want to make your graph.

At least use sunrise and sunset as basic data.
didomenico
2016-10-14 07:46:25 UTC
b. Quito, Ecuador (selection=0°, longitude=seventy 8.5°W) via fact this is on the equator day and night would be 12 hours each throughout the Vernal Equinox, the sunlight is on the instant overhead at midday


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...