Several other presentations of the problem of determining solar position. ============================================================================== Newsgroups: sci.math From: bj253@FreeNet.Carleton.CA (John McGowan) Subject: Re: Earthly Problem Date: Thu, 16 Mar 1995 08:57:58 GMT In a previous posting, Kevin Przybocki (kap@thebeach.mfg.sgi.com) writes: > Does anyone have a mathematical relationship describing the length of a day > at a location on the earth as a function of: > > 1) degrees of latitude and 2) month and day of the year (or number of days > before/after a solstice)? > > Let's assume the earth is a sphere and length of day + length of night = 24 > hours (forget about dusk and dawn). You want the relation between the Hour Angle (H), Solar Declination (D), Latitude (L) and the solar altitude (A). sin(A) = sin(D)*sin(L) + cos(D)*cos(L)*cos(H) (true for astronomical bodies, not just the sun). Neglecting refraction and parallax, A=0 at sun{rise|set}, or: cos(H) = -tan(D)*tan(L) at sunrise and sunset. The hour angle is zero when the object is on the meridian (due south, say) and changes... for an object "fixed with respect to the stars" 15 degrees every sideral hour. For the mean sun, it changes 15 degress every (solar) hour. Neglecting the change in the equation of time during the day, the sun's hour angle changes 15 degrees per hour. In the coordinates I have given, H=0 at "solar noon", increasing during the afternoon. (note: tan(D)*tan(L)=+/-1, i.e. tan(L)=+/-cot(D), give the latitudes of the midnight sun (24 hours of daylight) and no sun (24 hours of darkness)) Take 2*ARCCOS(-tan(D)*tan(L))[in degrees]/15 to get the length of the day in hours (arccos from 0 to 180 degrees) Length of day (hours) = 2*ARCCOS(-tan(D)tan(L))[degrees]/15 (the root to cos(H)=-tan(D)tan(L), -ARCCOS(-tan(D)tan(L)) which is <0 is the hour angle at sunrise... the root >0 is the hour angle at sunset time. The difference in these two: ARCCOS(-tan(D)tan(L))-[-ARCCOS(-tan(D)tan(L))] giving the factor of two, gives the change in the hour angle. We take this at 15 degrees per hour. The hour angle changes from the root ARCCOS(-tan(D)tan(L)) (sunset) to the root 360_degrees - ARCCOS(-tan(D)tan(L)), neglecting the change in the declination during one day, during the night, so the change in the hour angle during the night is the difference: 360_degrees - 2*ARCCOS(-tan(D)tan(L))[degrees] or dividing by 15 to get the number of hours, the length of night is: 24 hours - length of day To get the declination, look in the Old Farmer's Almanac (south=negative, north=positive). Note that for L=0 (equator) or D=0 (equinox), the length of the day is 2*90/15=12 hours. During the summer, one has (northern hemisphere) D>0, L>0 so ARCCOS(-tan(D)tan(L)) > 90 degrees (days are long in the summer in the northern hemisphere). To get the declination one has to worry about the elliptic nature of the earth's orbit. if one ignores the eccentricity and treats the orbit as a cirle, then the declination varies smoothly: sin(D)=sin(O)sin(SL) where O=the obliquity of the ecliptic (23.5_degrees, approximately) and SL is the solar longitude (ecliptic coordinates) which changes from 0 to 360 degrees in a year (about 1 degree per day) having a value of zero at the vernal equinox. (so, one can take an approximation of: sin(D) = sin(23.5_degrees)*sin(days*360_degrees/365) D = ARCSIN(sin(23.5_degrees)*sin(days*360_degrees/365)) (D between -23.5 degrees and 23.5 degrees) where days=number of days since the vernal equinox) So.. find D from the Old Farmer's Almanac or something (or use the circular orbit approximation, above, or whatever) and then use the formula for the length of the day in terms of the Declination and the Latitude. The solar declination changes during the day, the earth's orbit is elliptic and the relationship between uniformly increasing time and the change in the hour angle (the equation of time) is not constant during the day... plus the fact that the earth is not a sphere and we have neglected refraction and parallax are the reasons the above is not exact. Summary: D = ARCSIN(sin(23.5_degrees)*sin(days*360_degrees/365)) (approx) days=number of days since the vernal equinox Length of day (hours) = 2*ARCCOS(-tan(D)*tan(L))[degrees]/15 L=latitude, D=declination from the first (approximate) equation. ============================================================================== From: PT-PMR IT Dept Newsgroups: sci.math Subject: Re: Earthly Problem Date: 16 Mar 1995 10:48:51 GMT kap@thebeach.mfg.sgi.com (Kevin Przybocki) wrote: > > Does anyone have a mathematical relationship describing the length of a day > at a location on the earth as a function of: > > 1) degrees of latitude and 2) month and day of the year (or number of days > before/after a solstice)? > > Let's assume the earth is a sphere and length of day + length of night = 24 > hours (forget about dusk and dawn). First you need the declination of the sun (how far it is north of the equator.) It isn't easy to calculate this precisely due to the eccentricity of the earth's orbit, but as an approximation take D = EarthsInclination * sin(2*pi/365 * DaysSinceSpringEquinox) EarthsInclination = 23.45 degrees = 0.4093 radians Then at dawn at the point you are considering, there is a spherical triangle whose corners are at the North Pole, your point, and the dawn point on the equator, the sides opposite the corners are respectively part of the 'teminator', 90degrees of the meridian at 0600 solar time, and the part of the meridian through your point northwards to the pole. The angle at the point on the equator is D, so call the angle at the North Pole theta and we can derive - sin(theta) = tan(LatitudeOfPoint) * tan(D) theta as an arc represents how long dawn is before 0600 hours solar time, and again how long sunset is after 1800, so the day length is 12 + 2 * theta * 24 / (2 * pi) hours caveats - - within the polar circles there may be no solution for theta, hence either 0 or 24 hours daylight. - solar time is not mean time - dawn and sunset may not be the same time before and after 1200 mean time (the eccentricity of the orbit strikes again). ============================================================================== From: shagged@perth.DIALix.oz.au (Iain Macquarie) Newsgroups: sci.math Subject: Re: Earthy problem. Date: 18 Mar 1995 23:27:17 +0800 > Does anyone have a mathematical relationship describing the length of a day > at a location on the earth as a function of: > 1) degrees of latitude and 2) month and day of the year (or number of days > before/after a solstice)? > Let's assume the earth is a sphere and length of day + length of night = 24 > hours (forget about dusk and dawn). Here's one: Let L be degrees lattitude (0 degrees at equator) R be the radius of Earth sphere B be the angle of the Earth's tilt (about 23 degrees isn't it?) a be the angle the line connecting the centre of the Sun with the centre of the Earth makes with the equatorial plane. b be the angle the Earth has traversed around the Sun from the summer solstice Now a has the following relationship with b: cos(a) = sqrt((cos(b) * cos(B))^2 + (sin(b))^2) The formula I present to you is: h = 24 / Pi * arctan(sqrt((cos(a))^2 - (sin(L))^2) / (sin(a) * sin(L))) Where h is the length of the period of sunlight in hours. Of course, the first equation may be coerced into the second by eliminating a, but it would become even uglier and harder to read. In real life, the position of the Earth about the Sun would change very slightly during one day. This formula neglects this. In (your) summer (B is within -Pi/2 and Pi/2 radians or equiv.) do not let L be less than -(Pi/2 - a). Also in winter (B is any other value not equiv.) do not let L be greater than (Pi/2 + a). If you do, you will get complex results. It's equivalent to finding the length of daylight in places in Antarctica where the sun never rises when it's summer. This formula does not account for refraction due to the optical density of the atmosphere, or scattering due to debris, or anything else which causes the bending of light. It also assumes that the eluminated portion of the Earth's surface always forms a perfect hemisphere. shagged@perth.DIALix.oz.au ============================================================================== From: ascoly@freenet3.scri.fsu.edu (Joe Ascoly) Newsgroups: sci.math,sci.math.num_analysis Subject: Re: Sunrise,sunset alogorithm Date: 29 Jun 1994 23:35:05 -0400 Ramona Hill (disc1@netcom.com) wrote: : Is there an algorithm that I can use to generate sunrise and sunset time : for a given longitude,latitude, and day of the year ? The AA has the information to program this problem but it is not easy. The movement from Greenwich to your longitude is also needed as well as DST adjustment. I think the best bet is getting the ICE = Interactive Computer Ephmeris from Willmann Bell in Richmond Va. for about 35 dollars. It does more than just sunrise sunset and is put out by Naval Observatory. The event is defined by angles. The rise and set is not 90 degrees as you might expect. Also there is an angle 108 defined for what is called astro rise and set. There is already some light before sunrise called twlight or astro rise. The Muslims I believe use a black thread and if there is enough light to see the thread it is time to pray. ============================================================================== Newsgroups: sci.math,sci.math.num_analysis From: hdev@cp.tn.tudelft.nl (Hans de Vreught) Subject: Re: Sunrise,sunset alogorithm Date: Thu, 30 Jun 1994 09:55:50 GMT ... There is a program called ephem which you can get for free. There are versions for several platforms. There is also an X-version (but you need motif to compile this). Try looking for ephrem with archie. -- Hans de Vreught | John von Neumann: J.P.M.deVreught@CP.TN.TUDelft.NL | Young man, in mathematics Delft University of Technology | you don't understand things, The Netherlands | you just get used to them.