The Museum of HP Calculators


Local Solar Time for the HP-41

This program is Copyright © 2005 by Jean-Marc Baillard and is used here by permission.

This program is supplied without representation or warranty of any kind. Jean-Marc Baillard and The Museum of HP Calculators therefore assume no responsibility and shall have no liability, consequential or otherwise, of any kind arising from the use of this program material or any part thereof.

Overview

-This program calculates the local solar time defined by:  LST  = 12 h. + the hour angle of the Sun.
-12h are added because it's more convenient to regard the solar day as commencing at midnight rather than at noon.
-The equation of time ( i-e the difference between apparent and mean time ) is obtained by the following formula:

  E = y.sin 2L - 2e.sin M + 4ey.sin M cos 2L - (y2/2).sin 4L - (5e2/4).sin 2M       ( in radians )

where  y = tan2(obl/2)    obl = obliquity of the ecliptic
           L = Sun's mean longitude
           e = eccentricity of the Earth's orbit
          M = Sun's mean anomaly

Program Listing
 

Data Registers:  R00 thru R05
Flag: /
Subroutine:  "J0"  ( cf "Phases of the Moon for the HP-41" )
                        none if you have a Time Module

01  LBL "LST"
02  STO 05
03  RDN
04  HR
05  STO 04
06  24
07  /
08  X<>Y                 if you have a Time module,
09  XEQ "J0"            lines 08-09 may be replaced by   1.012   RCL Z   DDAYS
10  +
11  STO 00
12  1.971295
13  *
14  19.947
15  +
16  STO 01
17  540
18  1/X
19  STO 02
20  SQRT
21  P-R
22  ST+ X
23  .9856
24  RCL 00
25  *
26  2.964
27  -
28  STO 00
29  SIN
30  895.5
31  1/X
32  STO 03
33  SQRT
34  *
35  ST* Y
36  +
37  +
38  RCL 01
39  ST+ X
40  SIN
41  RCL 02
42  *
43  RCL 00
44  ST+ X
45  SIN
46  RCL 03
47  *
48  1.6
49  /
50  +
51  2
52  /
53  +
54  R-D
55  RCL 05
56  HR
57  +
58  15
59  /
60  RCL 04
61  X<>Y
62  -
63  24
64  MOD
65  HMS
66  END

( 112 bytes / SIZE 006 )
 
 
             STACK           INPUTS          OUTPUTS
                  Z       YYYY.MNDD                 /
                  Y       HH.MNSS (UT)                 /
                  X       ° . '  "  (longitude)      HH.MNSS (LST)

Example:   Calculate the solar time on  2004/12/31  12h25mn41s (UT)  in the U.S. Naval Observatory at Washington ( D.C.)  ( Longitude = 77°03'56"W )

      2004.1231  ENTER^
          12.2541  ENTER^
          77.0356  XEQ "LST"   >>>>   LST = 7h14mn13.4s

-Remark that if  UT = 17h11mn33s  ,   LST = 12h  :  the Sun crosses the local meridian at upper culmination.

Notes:   -The longitudes are measured positively westwards from the meridian of Greenwich.
          -If you measure the longitudes positively eastwards, replace line 57 by - ( instead of + )
    -The accuracy is of the order of 1 second between 1900 and 2100.
 

Reference:        Jean Meeus , "Astronomical Algorithms" - Willmann-Bell  -  ISBN 0-943396-35-2

Go back to the HP-41 software library
Go back to the general software library
Go back to the main exhibit hall