Está en la página 1de 7

hp41programs

http://hp41programs.yolasite.com/phase.php

hp41programs
Home

Phases of the Moon for the HP-41


Overview
-The following programs compute the date & time of a phase of the Moon that occurs near a
given date.
-A few secular terms are used in the first version which is valid over the time-span
[1000,3000] ( the accuracy remains of the order of a few minutes )
-The second program uses more secular terms and an accuracy of the order of 10 minutes is
achieved near 3000 B.C. ( compared to DE406/LE406 )
-See also "Eclipses for the HP-41" for a non-standard definition of the phases.

Program Listing1
Data Registers: R00 = T = instant of the mean phase is expressed in millennia since J2000.
Sun
Moon
F

R01 = M
where M = mean anomaly of the
R04 = phase
R02 = M'-180
where M' = mean anomaly of the
R05 = 0 for a New Moon or a Full Moon, 1 otherwise
R03 = 1 for a Full Moon, 0 otherwise and then 2
R06 = 7.38264721 x 4k
where F = mean argument of latitude of the Moon

Flags: none. However, set flag F04 for dates before 1582/10/15 if you use "J1" and "D1"
1 of 7

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

instead of "J0" & "DT"

Subroutines: "J0" & "DT" ( cf "Julian & Gregorian Calendars for the HP-41" ) or "J1" &
"D1" or "J2" & "D2"
none if you have a TIME Module, provided the dates are after 1582/10/14
-If you have a TIME Module, line 03 may be replaced by 1.012 STO 07 X<>Y DDAYS
-In this case, key in the date in the current format: MDY or DMY
-If you have a TIME Module, lines 148-149 may be replaced by RCL 07 RCL Z DATE+

01 LBL
94 +
32 +
63 RCL 05 95
"PHASE"
33
64 7
02 DEG
RCL 05
4771976.76
65 *
03 XEQ
96 7
34
+
66
"J0"
97 *
35 RCL 00
67 RCL 02 98 5
04
36 *
68 ST+ X
7.38264721
99 +
69 SIN
05 STO 06 37 465
100
38 SQRT
70 *
06 /
RCL 01
39
+
71
+
07 INT
101
72 5
08 STO 00 40 STO 02
RCL 02
73 RCL 05 102 +
09 ST* 06 41 SIN
42 *
74 10 4
103 SIN
43 1
75 ST+ X 104 *
11 MOD
44
RCL
00
76 RCL 00 105 +
12 STO 04
45 40
77
13 2
106
9664016
14 STO 03 46 /
RCL
47 78 *
15 X#Y?
01
48 RCL 00
79 39
16 ST- 03
107 ST+
49
359989.6
80
17 ST/ 03
X
50 *
81 STO 03 108 SIN
18 MOD
82 SIN
19 STO 05 51 13
109 ST+
52 LN
83 *
20 221
X
53 +
84 +
21 *
110 +
54
STO
01
85
RCL
05
22 RCL 03
111
55 SIN
86 ST+ X RCL 05
23 56 *
87 7
24 407
112
57 172
88 25 +
RCL 02
89 RCL 02 113
26 RCL 00 58 RCL 03
59
+
90 RCL 01 RCL 03
27 49474
60 *
91 28 /
114 92 SIN
29 STO 00 61 +
115 SIN
62 16
93 *
30 8
116 ST*

2 of 7

125 *
126 127 5598
128 +
129 E3
130 /
131 RCL
00
132 X^2
133 65
134 /
135 +
136 RCL
06
137 +
138 INT
139
LASTX
140 FRC
141
X<0?
142 DSE
Y
143 ""
144 24
145 ST*
Y
146
MOD
147
HMS
148
X<>Y

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

Y
117 +
118 +
119
RCL 04
120 2
121 122
RCL 05
123 *
124 3

31 %

149
XEQ
"DT"
150 RCL
04
151
END

( 231 bytes / SIZE 007 )

OUTPUTS

STACK INPUTS
Z
Y
X

HH.MNSS

YYYY.MNDD

yyyy.mndd

Phase

where yyyy.mndd is an approximate date


Phase = 0
Phase = 1
Phase = 2
Phase = 3

for a New Moon


for a First Quarter
for a Full Moon
for a Last Quarter

YYYY.MNDD & HH.MNSS are the date & time ( in Terrestrial Time ) of the Phase
Example:
-We want to know the instant of a phase of the Moon near July 4th 2002
2002.0704 XEQ "PHASE" >>>> 3
seconds )
RDN
2002.0702
RDN
17.2314

3 of 7

( Execution time = 17

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

-There is a Last Quarter on July 2nd 2002 at 17h23 TT or 17h22 UT ( the exact value is
17h21 UT )
-If we seek a New Moon, we can guess it happens about 7 days later,
so we execute "PHASE" again with this new initial value:
2002.0709

R/S
RDN
RDN

yields

0
2002.0710
10.2715

-The New Moon occurs on July 10th 2002 at 10h27 TT or 10h26 UT ( the exact value )
Other numerical checks:
1000.0101 XEQ "PHASE" >>>> 0
Moon on 1000/01/09 at 15h33 TT )
1600.0215
R/S
>>>> 1
Quarter on 1600/02/21 at 8h42 TT )
2500.0412
R/S
>>>> 2
Moon on 2500/04/15 at 16h25 TT )
3000.0714
R/S
>>>> 3
Quarter on 3000/07/16 at 21h38 TT )

RDN 1000.0109 RDN 15h32m33s TT ( New


RDN 1600.0221 RDN

8h41m43s TT ( First

RDN 2500.0415 RDN 16h24m58s TT ( Full


RDN 3000.0716 RDN 21h38m01s TT ( Last

-Errors can reach about 1 hour near 3000 B.C.


-Using more secular terms will increase accuracy:

Program Listing2
Data Registers: R00 = T = instant of the mean phase ( expressed in unit of 10000 julian
years since J2000 )

R01 = M
where M = mean anomaly of the
R04 = phase
R02 = M'-180
where M' = mean anomaly of the
R05 = 0 for a New Moon or a Full Moon, 1 otherwise
R03 = 1 for a Full Moon, 0 otherwise and then 2
R06 = E

Moon

where F = mean argument of latitude of the


R07 = 7.382647215 x 4k

Sun
Moon

Flags: none. However, set flag F04 for dates before 1582/10/15 if you use "J1" and "D1"
4 of 7

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

instead of "J0" & "DT"

Subroutines: "J0" & "DT" ( cf "Julian & Gregorian Calendars for the HP-41" ) or "J1" &
"D1" or "J2" & "D2"

01 LBL
39
77 "PHASE"
3599896
78 SIN
02 DEG
40 79
03 XEQ
41 RCL 00 RCL 05
"J0"
42 *
80 ST+
04
43 X
7.382647215 44 STO 01 81 7
05 STO 07
45 ST+ X
82 06 /
46 SIN
83 *
07 INT
47 ST+ X
84 +
08 STO 00
48 *
85
09 ST* 07
49 RCL 01 RCL 05
10 4
50 SIN
86 7
11 MOD
51 172
87 *
12 STO 04
52 RCL 03 88 5
13 2
53 +
89 +
14 STO 03
54 *
90
15 X#Y?
55 +
RCL 01
16 ST- 03
56 465
91
17 ST/ 03
57 SQRT
RCL
18 MOD
58 RCL 00 02
19 STO 05
59 5.8
92 +
20 1
60 *
93 SIN
21 RCL 00
61 12.38
94 *
22 494740
62 95 +
23 /
63 RCL 00 96
24 STO 00
64 *
RCL 06
25 13
65 6164
97 *
26 /
66 D-R
98
27 .252
67 RCL 05
28 +
68 RCL 00 99 221
29 RCL 00
69 *
100 *
30 *
70
101
31 47719767.64 RCL 03
32 STO 06
71 102 33 13
72 RCL 00 103 407
34 LN
73 *
104 +
35 RCL 00
74 105

5 of 7

115 ST+ X
116 SIN
117 *
118 +
119 RCL 00
120 ST+ X
121 5
122 123 RCL 00
124 X^2
125 *
126
96640162
127 +
128 RCL 00
129 *
130 39
131 132 STO 03
133 SIN
134 5
135 RCL 05
136 137 ST+ X
138 *
139 +
140 RCL 05
141 RCL 02
142 RCL 03
143 144 SIN
145 ST* Y
146 +
147 +
148 RCL 04
149 2
150 151 RCL 05

153 3
154 *
155 156
5598
157 +
158 73
159 RCL
00
160 *
161 150
162 163 RCL
00
164 *
165
1544
166 +
167 RCL
00
168 X^2
169 *
170 +
171 E3
172 /
173 RCL
07
174 +
175 INT
176
LASTX
177 FRC
178
X<0?
179 DSE
Y
180 ""
181 24

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

36 X^2
37 9
38 /

RCL 02
106 SIN
107 *
108 +
109 16
75 STO 02 110
152 *
76 RCL 01 RCL 05
111 7
112 *
113 114
RCL 02

182 ST*
Y
183
MOD
184
HMS
185
X<>Y
186
XEQ
"DT"
187 RCL
04
188
END

( 289 bytes / SIZE 008 )

OUTPUTS

STACK INPUTS
Z
Y
X

HH.MNSS

YYYY.MNDD

yyyy.mndd

Phase

where yyyy.mndd is an approximate date


Phase = 0
Phase = 1
Phase = 2
Phase = 3

for a New Moon


for a First Quarter
for a Full Moon
for a Last Quarter

YYYY.MNDD & HH.MNSS are the date & time ( in Terrestrial Time ) of the Phase
Example:
-3101.0210

XEQ "PHASE"
0

6 of 7

returns:

---Execution time = 20s---

A New Moon occured

8/28/13 2:09 PM

hp41programs

http://hp41programs.yolasite.com/phase.php

RDN -3101.0217
-3101 = 3102 B.C. )
RDN
22.5512

on -3101/02/17

Julian Calendar

at 22h55m TT

Notes:
-All results are expressed in Terrestrial Time. The difference TT - UT can be approximated by
a formula given by Morrison & Stephenson:
TT - UT ( in seconds ) = -15 + ( 32.5 +/- 2 ).( t - 0.1 )2 where t is measured in centuries from
AD 1800.
-Many other periodic terms are given in "Astronomical Algorithms"

Reference:
[1] Jean Meeus , "Astronomical Algorithms" - Willmann-Bell - ISBN 0-943396-61-1

Make a Free Website with Yola.

7 of 7

8/28/13 2:09 PM

También podría gustarte