# Need help understanding U.S. Naval Observatory's messed up algorithm

1. Oct 13, 2011

### dwaynie

Hello!

I'm trying to calculate the equation of time and the declination of the sun based on the U.S. Naval Observatory's algorithm:

http://aa.usno.navy.mil/faq/docs/SunApprox.php" [Broken]

But not the U.S. Naval Obseravtory, or any of the astronomers I've tried to contact, has been eager to help me identify what the numbers used in this algorithm actually represent.

Maybe someone here can help?

Here's what I got so far (I'm not sure what I've already identified is correct, astronomically or spelling-wise):

Code (Text):
EPOCHS_JULIAN_DATE = 2451545.0
TROPICAL_YEAR_IN_DAYS = 365.2421897
EARTHS_ECCENTRICITY = 0.01671
EARTHS_ECLIPTIC_OBLIQUITY = 23.439
GEODETIC_PRECESSION = 1.915

UNKNOWN = 357.5291
UNKNOWN = 280.459
UNKNOWN = 0.98560028
UNKNOWN = 1.00014
UNKNOWN = 0.00014
UNKNOWN = 0.00000036
This is all part of a greater attempt to write this algorithm in a high-level programming language in the simplest, most descriptive and self-explanatory way possible.

https://gist.github.com/1278755" [Broken] (criticism welcome)

Many thanks!

--Dwayne

Last edited by a moderator: May 5, 2017
2. Oct 14, 2011

### BobG

Mean anomaly (on 1 Jan 2000 12:00Z) = 357.5291 degrees
Mean longitude of Sun (1 Jan 2000 12:00Z) = 280.459 degrees
Change in mean anomaly per day = 0.98560028

Average Radius of Earth in astronomical units* = 1.00014
*Obviously this can't possibly be true. However, your radius is using mean anomaly to calculate the radius, and mean anomaly is a location in time; not physical space. Since the Earth's orbit is elliptical instead of circular, using mean anomaly in the traditional trajectory equation would give you a wrong answer. This equation allows you to calculate the Earth's radius without first converting the mean anomaly to eccentric anomaly, the eccentric anomaly into true anomaly, and then finally using true anomaly in your standard trajectory equation. In other words, three equations** were blended together and solved as far as possible, given that the mean anomaly is unknown.

Likewise, your mystery parameter equalling 0.00014, which is the eccentricity of earth's orbit squared and then divided by 2 (how could this not be intuitively obvious?). Notice that same amount wound up being added to the Earth's 'mean radius'.

rate of change in the obliquity of the ecliptic (the angle between the equator and the Earth's orbital plane) = 0.00000036

**Given that there is no analytical solution to convert mean anomaly to eccentric anomaly, the answer you get is an approximation that will degrade over time, but I believe the limitations are covered in the link you provided.

I'm impressed you were able to figure this one out. That was a stroke of insight that wouldn't have occurred to most people.:rofl:

Actually, the 1.915 and the 0.02 are just intermediate results stemming from combining multiple equations into one and solving that equation as far as possible, just like the 0.00014 was (it was just easier for me to see how those intermediate results were obtained for the radius - I'd have to actually draw everything out and figure out what went into the L equation to see where the 1.915 and 0.02 came from).

Last edited: Oct 14, 2011
3. Oct 14, 2011

### dwaynie

Man! I can't believe you did it. Thanks a lot!

I was able to piece together this:

https://gist.github.com/1278755" [Broken]

I hope it's all correct?

The unladen swallow part wasn't me though :) It was my Japanese friend, much respect to him! And to you. You did something Navy.mil couldn't. That's pretty alright in my book.

--Dwayne

Last edited by a moderator: May 5, 2017
4. Oct 14, 2011

### BobG

Try purchasing a copy of "The Astronomical Almanac". They come out once a year, but having even one gives you a lot of explanations for how they come up with the data in the book.

Considering it's published jointly by the US Naval Observatory and the UK's Hydrographic Office, you'd think someone at the US Naval Observatory would have read it.

And, to be technically complete, the .98560028 change in mean anomaly is based on an anomalistic year (which it has to be, since mean anomaly is measured from perigee to perigee). Just explains why 360/.98560028 doesn't equal either a tropical year or a sidereal year (just to make sure I'm not tossing in confusion, tropical year is the correct parameter for the mean longitude of the Sun - mean anomaly depends on anomalistic year and mean longitude depends on tropical year)

If you know the Earth is at perigee sometime during the first week of January, the starting mean anomaly makes sense.

And I'd make sure the label or comments for Earth's average radius made it clear that was an adjusted average radius, since it doesn't take too much digging for someone to figure out the actual average Earth radius is one astronimical unit by definition. It's been adjusted by the conversion from mean anomaly to eccentric anomaly to true anomaly.

Last edited: Oct 14, 2011
5. Oct 15, 2011

### dwaynie

Much obliged!

Do you know of any example calculations of the equation of time and the declination of the sun? I gotta test my code with some real results to make sure it's working right.

Also, is it possible to make this algorithm even more accurate? Maybe somebody's running some sorta live feed where one can obtain far more detailed and recent versions of these numbers? There's http://aa.usno.navy.mil/software/mica/micainfo.php" [Broken], but I'd rather make my script as open and universal as possible.

--Dwayne

Last edited by a moderator: May 5, 2017
6. Oct 16, 2011

### D H

Staff Emeritus
7. Oct 16, 2011

### dwaynie

8. Oct 16, 2011