 If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.  Simple Calculation of Sunset Time required
 Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

## Simple Calculation of Sunset Time required

#1 February 16th 08, 03:59 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 tomcee external usenet poster Posts: 9 Simple Calculation of Sunset Time required

Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
.. . .
180 20:21
....
365 17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee
#2 February 16th 08, 05:52 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 David White external usenet poster Posts: 2 Simple Calculation of Sunset Time required

tomcee wrote:
Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
. . .
180 20:21
...
365 17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee

Perhaps here
http://www.math.niu.edu/~rusin/uses-math/position.sun/suncalc.ub
somewhere?
#3 February 16th 08, 06:07 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 Dave Houston external usenet poster Posts: 6 Simple Calculation of Sunset Time required

I think you can find this on the web. Try the US Naval Observatory Site
(just stay away from Cheney's house - he's been known to shoot people). You
might try 'astronomical clock' as a search term.

Here's what I use with PureBasic. I use the same basic code with an embedded
ZBasic ZX-40a - it uses less space than a lookup table. I think I originally
got it from USNO. 'Protected' is the same as 'local' in other languages.
Variables declared with .d are double precision floats; those without are
32-bit integers.

DST2 & DST4 are global variables that hold the DST start/end times in hours
since 0000 01-01-yyyy.

Procedure GetDawnDusk() ;calculates sunrise/sunset
Protected
OpenPreferences("roZetta.prf"):PreferenceGroup("Gl obal")
ClosePreferences()
tz=tz*-1
yd=DayOfYear(Date())
If latitude=0
If yd=Val(DST2)/24 And ydVal(DST4)/24
zone=tz-1.0
Else
zone=tz
EndIf
Else
If yd=Val(DST4)/24 Or ydVal(DST2)/24
zone=tz-1.0
Else
zone=tz
EndIf
EndIf
lo=4.8771+0.0172*(yd+0.5-longitude/360.0)
c=0.03342*Sin(lo+1.345)
SD=0.3978*Sin(lo+c)
CD=Sqr(1.0-SD*SD)

n=((6.0-zone-(longitude+C2+C3)/15.0)/24.0)*1440.0
dawn=(n/60)*100+(n%60)
n=((18.0-zone-(longitude+C2-C3)/15.0)/24.0)*1440.0
dusk=(n/60)*100+(n%60)
EndProcedure

tomcee wrote:

Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
. . .
180 20:21
...
365 17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee

http://davehouston.net http://davehouston.org
http://tech.groups.yahoo.com/group/roZetta/

#4 February 16th 08, 06:35 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 Androcles[_8_] external usenet poster Posts: 1,135 Simple Calculation of Sunset Time required

"tomcee" wrote in message
...
| Given a table of sunset times, such as:
|
| Day # Sunset (H:M):
| --------- ----------
| 1 17:10
| 2 17:11
| . . .
| 180 20:21
| ...
| 365 17:10
|
| and plotting this data (of course converting H:M to Decimal hours), we
| get a somewhat sinusoidal relationship between the Day and time of
| Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
| P) This of course is not a pure sinusoid. Observation shows that it
| has a significant 2nd harmonic component.
|
| My application is that I have an automation controller that has a
| calendar, can do calculations (including trig), but is rather memory
| limited. Thus I would like to calculate time of sunset 'on the fly'
| rather than store the data table.
|
| I would like an equation that yields Sunset as a function of day
| number. I would like to keep it simpler than the generic formula
| given latitude and longitude. I would like the formula from the
| tabular data.
|
| It appears to have the form:
|
| Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
| Whe
| D = Day number
| K, A1, A2, k, P1, P2 are constants determined by Long/Lat.
|
| Has anyone determined the basic functions contained within this
| 'Sunset function'? Given the basic functions, I can then calculate the
| constants.
| TomCee

Ok, first understand the problem.
Imagine (because it isn't so, but it helps) that the Earth
has no tilt and moves in a perfect circle around the Sun
and the Sun itself is a point of light, not a ball 1/2 a degree
wide.
Sunrise and sunset will be at the same time every day,
6:00 am and 6:00 pm at the equator, earlier and later as
you move North or South. When you reach either Pole
it will not set at all, but goes around the horizon.
The function for this is the cosine of latitude, cos(90 degrees) = 0.
Now we tilt the Earth, and we do so in our imagination by 90 degrees.
The North pole faces the Sun on mid-summer's day, and
the south pole faces the Sun 6 months later. As you know,
Northern Summer is Southern Winter and vice versa.
With our 90 degree tilt the Sun doesn't rise or set at the equator
on mid-summer's day OR mid-winter's day, equal day and night
occur mid-spring and mid-autumn.

Okay, so much for latitude and tilt, next is orbital eccentricity.
We imagined that the Earth moved in a perfect circle, but it doesn't.
It is closest to the Sun on or about Jan 3rd at 91,000,000 miles
and furthest 6 months later at 94,000,000 miles, moving in
an elliptical orbit. As we did above, we again imagine an
extreme case where the Earth passes very close to our
point-like Sun and then 6 months later is way out near Pluto.
The orbit is almost a straight line. The Earth falls toward
the Sun going faster and faster (as comets do) and then
swings around the back where gravity is at its greatest,
climbs away again and slows as it gets toward Pluto's
orbit where it stops climbing and falls once again, just
as a ball thrown straight up would do. Now, when far
from the Sun the Earth turns once a day, sunset and sunrise
are about the same each day, but when close to the sun
we have a problem with that. The Earth turns on its axis
360 degrees in what is called a sidereal day
(1 sidereal day = 23.9344696 hours)
and there are 366, (not 365) sidereal days in a year.
http://en.wikipedia.org/wiki/Sidereal_day
That is when the Earth has turned not to face the sun
once a day, but to face the other stars.
You will notice that the night sky has different stars
directly overheard between Summer and Winter.
This means that when (in our imagination) the Earth
passes very close by the sun, noon, when the sun is overhead,
can last for 12 hours.
Look at the diagram at
http://en.wikipedia.org/wiki/Sidereal_day
and you'll see why.
Last and least, the Sun is NOT a point.
Now... the computation of Earth's orbit is something you
do NOT want to do.
http://mathworld.wolfram.com/KeplersEquation.html

In conclusion, a look-up table is the simplest solution for you.

#5 February 16th 08, 07:30 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 OG external usenet poster Posts: 780 Simple Calculation of Sunset Time required

"tomcee" wrote in message
...
Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
. . .
180 20:21
...
365 17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee

What level of accuracy are you looking for ?

#6 February 16th 08, 08:44 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 oriel36[_2_] external usenet poster Posts: 8,478 Simple Calculation of Sunset Time required

On Feb 16, 7:35*pm, "Androcles" wrote:

The Earth turns on its axis
360 degrees in what is called a sidereal day
(1 sidereal day = 23.9344696 hours) or 23 hours 56 minutes 04 seconds

Surely there is a sane and reasonable person around who can appreciate
how timekeeping astronomers transfered the Equation of Time corrected
natural noon cycle to the average 24 hour cycle and when axial
rotation was discovered to be the cause of the daily cycle they
exploited the human devised 24 hour cycle are transfered it from
'Average' to 'Constant' without requiring an external reference.

That value you give (sidereal day) requires the noon cycles to be
equal in order to create a solar/sidereal fiction using the axial and
orbital motions of the Earth -

To think that the work of Huygens and Harrison is in competition with
the sidereal junk is apalling,-

I cannot,cannot acount for why this most enjoyable and profound work
is set aside for destructive and cartoonlike conceptions that never
worked.You can openly promote the sidereal value without the slightest
sign of an objection when before all of you is the jewel of Huyegns
representing millenia of refinements which go into the correlation
between clocks,the daily cycle and terrestrial longitudes.

I never doubted that many people know exactly what went wrong but did
not count on the lack of courage to change matters quickly or to
intepret correctly the changing enviroment in celestial/terrestrial
studies.

#7 February 16th 08, 11:24 PM posted to sci.astro,sci.astro.amateur,comp.home.automation
 tomcee external usenet poster Posts: 9 Simple Calculation of Sunset Time required

On Feb 16, 2:30*pm, "OG" wrote:
"tomcee" wrote in message

...

Given a table of sunset times, such as:

Day # * *Sunset (H:M):
--------- * *----------
1 * * * * * *17:10
2 * * * * * * 17:11
. . .
180 * * * * *20:21
...
365 * * * * *17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: *Sunset = f(Day); or more specifically: *Sunset = f(A*sin(k*D-
P) *This of course is not a pure sinusoid. *Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. *Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. *I would like to keep it simpler than the generic formula
given latitude and longitude. *I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee

What level of accuracy are you looking for ?- Hide quoted text -

- Show quoted text -

OG:

Thanks for asking; I had intended to mention this in my original
post. I would like accuracy to within 5 minutes; preferably biased
towards the negative so that if anything, the lights would turn on
early, rather than late.

TomCee
#8 February 17th 08, 12:07 AM posted to sci.astro,sci.astro.amateur,comp.home.automation
 John J. Bengii external usenet poster Posts: 2 Simple Calculation of Sunset Time required

Ask in alt.solar.photovoltaic. I know there are several people that
can point you to their own or website software to do this.

Univ or Oregon website is big into this and has lots of info.

"tomcee" wrote in message
...
On Feb 16, 2:30 pm, "OG" wrote:
"tomcee" wrote in message

...

Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
. . .
180 20:21
...
365 17:10

and plotting this data (of course converting H:M to Decimal
hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset =
f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that
it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather
memory
limited. Thus I would like to calculate time of sunset 'on the
fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate
the
constants.
TomCee

What level of accuracy are you looking for ?- Hide quoted text -

- Show quoted text -

OG:

Thanks for asking; I had intended to mention this in my original
post. I would like accuracy to within 5 minutes; preferably biased
towards the negative so that if anything, the lights would turn on
early, rather than late.

TomCee

#9 February 17th 08, 12:13 AM posted to sci.astro,sci.astro.amateur,comp.home.automation
 Perihelion external usenet poster Posts: 6 Simple Calculation of Sunset Time required

tomcee wrote:

On Feb 16, 2:30=A0pm, "OG" wrote:
"tomcee" wrote in message

...

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. =A0Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

...
Thanks for asking; I had intended to mention this in my original
post. I would like accuracy to within 5 minutes; preferably biased
towards the negative so that if anything, the lights would turn on
early, rather than late.

TomCee

Store monthly values and interpolate. That's likely to be the fastest
and least memory intensive technique.
#10 February 17th 08, 12:19 AM posted to sci.astro,sci.astro.amateur,comp.home.automation
 Androcles[_8_] external usenet poster Posts: 1,135 Simple Calculation of Sunset Time required

"tomcee" wrote in message
...
On Feb 16, 2:30 pm, "OG" wrote:
"tomcee" wrote in message

...

Given a table of sunset times, such as:

Day # Sunset (H:M):
--------- ----------
1 17:10
2 17:11
. . .
180 20:21
...
365 17:10

and plotting this data (of course converting H:M to Decimal hours), we
get a somewhat sinusoidal relationship between the Day and time of
Sunset: Sunset = f(Day); or more specifically: Sunset = f(A*sin(k*D-
P) This of course is not a pure sinusoid. Observation shows that it
has a significant 2nd harmonic component.

My application is that I have an automation controller that has a
calendar, can do calculations (including trig), but is rather memory
limited. Thus I would like to calculate time of sunset 'on the fly'
rather than store the data table.

I would like an equation that yields Sunset as a function of day
number. I would like to keep it simpler than the generic formula
given latitude and longitude. I would like the formula from the
tabular data.

It appears to have the form:

Sunset = K + A1*sin(k*D-P1) + A2*sin(2*k*D-P2) + ???
Whe
D = Day number
K, A1, A2, k, P1, P2 are constants determined by Long/Lat.

Has anyone determined the basic functions contained within this
'Sunset function'? Given the basic functions, I can then calculate the
constants.
TomCee

What level of accuracy are you looking for ?- Hide quoted text -

- Show quoted text -

OG:

| Thanks for asking; I had intended to mention this in my original
| post. I would like accuracy to within 5 minutes; preferably biased
| towards the negative so that if anything, the lights would turn on
| early, rather than late.

| TomCee

15 entries in a look-up table, each entry reused for 12 days.
12 * 15 = 180.

Day
1-12 17:10
13-24 17:25
24- 36 17:40
...
169-180 20:20

 Thread Tools Show Printable Version Email this Page Display Modes Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Space Science     Space Science Misc     News     Space Shuttle     Space Station     Science     Technology     Policy     History Astronomy and Astrophysics     Astronomy Misc     Amateur Astronomy     CCD Imaging     Research     FITS     Satellites     Hubble     SETI Others     Astro Pictures     Solar     UK Astronomy     Misc About SpaceBanter     About this forum Similar Threads Thread Thread Starter Forum Replies Last Post Simple Calculation of Sunset Time required tomcee Astronomy Misc 120 April 24th 08 12:09 AM ephemeris calculation Gour Astronomy Misc 12 January 16th 08 09:42 PM Time constant calculation for proton and electron Jerry UK Astronomy 4 May 8th 06 06:27 AM Arclength Calculation Jon Astronomy Misc 1 March 28th 04 10:06 AM Looking for tide calculation algorithm Chuck S. Astronomy Misc 5 October 11th 03 01:53 PM

All times are GMT +1. The time now is 08:43 AM. - Contact Us - SpaceBanter Home - FAQ - Links - Privacy Statement - Top