EPHEM: Astronomical Ephemeris ------------------------------ Version: 1.0/S -- SysRPL version 23 Jun 97 Keith J. Farmer -- kfarmer@geocities.com ROMID: 1631 ----- This library is intended to provide the user with various ephemeris- generating routines, particularly in the calculation of planetary, solar, and lunar positions, and in the estimation of eclipse parameters. Most of the routines used may be found in Duffet-Smith (see the bibliography), although the iterative solution for Kepler's equation is found on pages 85-87 of the AE Roy reference, and none of the routines claim to be speedy or efficient -- mostly due to repeated calculations of positions with no saving of previous results. They have been tested against the examples provided in the sources and match with a reasonable amount of error (probably due to round-off in the examples). Planetary longitudes have been checked against the Menzel and Duffet-Smith sources at random, and are within a degree. A level of familiarity with astronomy and orbital mechanics is assumed. The SysRPL version was taken directly from UserRPL and includes most of the algorithms of that version. A comparison of the two will reveal a few commands that were deleted -- either through insignificance to the user or through obselescence due to the nature of SysRPL (not having to check for DEG/RAD status, for example). Also, Kepler's equation is now being solved as exactly as the HP will allow in long-floats. I do not think that this should create any problems, but you should still expect to wait a long time for high-eccentricity orbits (such as Halley's). The time spent should be less than in the UserRPL version in any case. The code is also much smaller. The source was compiled with Jazz 6.5 on an GX model P and does not, to my knowlege, use any unsupported entries. Back up your memory as usual, just in case -- this is after all my first SysRPL project -- and don't try too hard to break the code, since no error checking is being done (call it a Darwinian test to weed out foolish users). I welcome any comments on making the code more robust or, especially, more time-efficient. I have attempted to update this doc file for the differences between the two versions, but some error probably exists. ----- Nomenclature: [a]: alpha [b]: beta [d]: delta [e]: epsilon [l]: lambda [p]: pi [r]: rho [t]: theta [O]: Omega (capital) [w]: omega (lowercase) [lb]: lambda, beta -- equatorial coordinates [ad]: right ascension, declination -- ecliptic coordinates JD: Julian Day Number P : Planet number 1: Moon 2: Sun 3: Mercury 6: Mars 9: Uranus 4: Venus 7: Jupiter 10: Neptune 5: Earth 8: Saturn 11: Pluto 12: Halley's Comet ----- [lb]<-PJD P JD -> [l] [b] Calculates equatorial coordinates given P and JD. This routine may take a few seconds. [ad]<-[lb]JD [l] [b] JD -> [a] [d] Given [lb] and JD, calculate the corresponding [ad]. PH<-PJD P JD -> F Calculates the phase of the planet P, at time JD. If P==1 (the Moon), FMOON<-JD is called; if P==2 (the Sun), then 1 is returned. [lb]FMOON<-JD JD -> [l] [b] F lm-l0 l2-N2 Calculate the position and phase of the moon, and return the separation in [l] between the sun and the moon (lm-l0), and between the nodes (l2-N2), useful for calculating eclipse conditions. This routine may take up to 13-15s (or less!) to complete. [ad]FMOON<-JD JD -> [a] [d] F lm-l0 l2-N2 As above, replacing [lb] with [ad]. FMOON<-JD JD -> F Calculates the phase of the moon at any given JD. Note that F=0 is a New Moon, F=1 is Full. The routine calls [lb]FMOON<-JD, since the value F is derived from the value of [l] (and [l0], the solar longitude), and merely drops the excess information. ECLIPSE?<-JD JD -> "Eclipse Conditions" This routine calls [lb]FMOON<-JD, and returns: cos(lm-l0)<0: Lunar eclipse ln-N2>12.25: "TOT LUNAR IMP" > 9.50: "TOT LUNAR POSS" < 9.50: "TOT LUNAR MUST" cos(lm-l0)>0: Solar eclipse ln-N2>18.50: "SOLAR IMP" >15.50: "SOALR POSS" <15.50: "SOLAR MUST" d<-[ad]12 [a]1 [d]1 [a]2 [d]2 -> d Find the angular separation d, between two bodies at coordinates [ad]1 and [ad]2. [t]<-PPJD P0 P1 JD -> [t] Angular size of P1 in arcs as seen from P0, given JD. [r]<-PPJD P0 P1 JD -> [r] Calculates the distance between two planets P0 and P1 at time JD. MAG<-PJD P JD -> mag Calculates the approximate magnitude of planet P, viewed from earth. This does not account for atmospheric extinction, and can take up to 30s or so to complete. JDNOW -> JD Calculates the current JD. JD<-DT Date Time -> JD Date and Time is assumed to be UT. DT<-JD JD -> Date Time Reverse of JD<-DT. ESTR<-Y Y -> Date Given year Y, calculate the date of Easter in that year. lp<-PJD P JD -> lp lp is the projected heliocentric longitude (l). lp<-Pl P l -> lp lp, given P and heliocentric longitude. rp<-PJD P JD -> rp rp is the heliocentric radius vector r, projected onto the plane of the ecliptic. rp<-rpsi r psi -> rp As above, given psi, the heliocentric latitude. psi<-PJD P JD -> psi Calculate the heliocentric latitude, psi, for planet P. psi<-Pl P l -> psi Calculate psi, given P and l. l<-PJD P JD -> l Calculate the heliocentric longitude l, for planet P. l<-v[w] v [w] -> l Heliocentric longitude, given true anomaly v and longitude of perihelion. r<-PJD P JD -> r Calculate the heliocentric radius vector r. r<-Pv P v -> r Heliocentric radius. E<-PJD P JD -> E Solve Kepler's equation for E, given P and JD. E<-eM e M -> E Solve Kepler's equation iteratively, given eccentricity e, and M. vANOM<-PJD P JD -> v Calculate the true anomaly v. vANOM<-eE e E -> v Calculate v, from eccentricity e, and eccentric anomaly E. MANOM<-PJD P JD -> M Calculation the mean anomaly M. [e]<-JD JD -> [e] Calculates the mean obliquity of the ecliptic at time JD. ORBELEM P elem -> value Return the value of planet P's orbital element "elem". elem: "EPOCH" epoch (JD) "T.P" period, (tropical years) "[e]" longitude at epoch (deg) "[w]" longitude of perihelion (deg) "e" eccentricity "a" semi-major axis of orbit (au) "i" inclination of orbit (deg) "[O]" longitude of ascending node (deg) "[t]0" Angular size at 1au (arcs) [at $a for moon] "A" brightness factor (au^2) "[p]0" parallax at 1au [lunar $a] The data is stored as a matrix and can be updated easily with any library editor. Planet P cooresponds to row (P+2) of the matrix. Data was taken from Duffet-Smith, pages 82 (Table 6 -- Sun), 100 (Table 7), and 140 (Table 10 -- Moon), and is for the most part reference to the epoch of 0.0 Jan 1980 (JD 2444238.5). ----- Bibliography ------------ Duffet-Smith, Peter. "Practical Astronomy With Your Calculator", 2 ed. New York: Cambridge University Press. 1981. Menzel, Donald H. and Jay M. Pasachoff, "A Field Guide to the Stars and Planets", 2 ed. rev. Boston: Houghton Mifflin Company. 1983. Roy, Archie Edmiston. "Orbital Motion", 3 ed Student Text. Philadelphia: Institute of Physics Publishing. 1988.