(HP-67/97) Position of the Sun - Josef - 08-08-2023 08:24 PM
As promised, I have made a program to calculate the position of the Sun that works correctly and with significantly higher accuracy. As you can see, it does not fit into 224 steps and is split into two parts. It can still be optimized and shortened, but with less clarity and manageability, for example, by omitting the initial data entry sequence. I want to add more accurate planet calculations later so that the program will be significantly longer.
I attach the files for the LXVII emulator for Mac OS.
Code:
A = Day
B = Month
C = Year
R/S
****** Program 1 ******
001: 31 25 11 LBL A
002: 33 01 STO 1 day
003: 35 22 RTN
004: 31 25 12 LBL B
005: 33 02 STO 2 month
006: 35 22 RTN
007: 31 25 13 LBL C
008: 33 03 STO 3 year
009: 35 22 RTN
010: 31 25 14 LBL D
011: 02 2
012: 34 02 RCL 2
013: 32 71 XLEY first or second month?
014: 31 22 07 GSB 7 correct month and year
015: 02 2
016: 34 03 RCL 3
017: 01 1
018: 00 0
019: 00 0
020: 81 /
021: 31 83 INT
022: 33 08 STO 8
023: 51 -
024: 34 08 RCL 8
025: 04 4
026: 81 /
027: 31 83 INT
028: 61 +
029: 33 04 STO 4
030: 34 03 RCL 3
031: 03 3
032: 06 6
033: 05 5
034: 83 .
035: 02 2
036: 05 5
037: 71 x
038: 31 83 INT
039: 33 05 STO 5
040: 03 3
041: 00 0
042: 83 .
043: 06 6
044: 41 ENTER
045: 34 02 RCL 2
046: 01 1
047: 61 +
048: 71 x
049: 31 83 INT
050: 33 06 STO 6
051: 34 04 RCL 4
052: 61 +
053: 34 05 RCL 5
054: 61 +
055: 34 01 RCL 1
056: 61 +
057: 34 12 RCL B 1720994.5
058: 61 +
059: 33 00 STO 0 Julian Date
060: 22 15 GTO E
061: 31 25 07 LBL 7
062: 34 03 RCL 3
063: 01 1
064: 51 -
065: 33 03 STO 3
066: 34 02 RCL 2
067: 01 1
068: 02 2
069: 61 +
070: 33 02 STO 2
071: 35 22 RTN
------ Mean Anomality ------
072: 31 25 15 LBL E
073: 01 1
074: 08 8
075: 35 33 ST I
076: 34 00 RCL 0
077: 34 24 RCL (i)
078: 51 -
079: 03 3
080: 06 6
081: 05 5
082: 02 2
083: 05 5
084: 81 /
085: 33 09 STO 9
086: 01 1
087: 00 0
088: 35 33 ST I
089: 34 24 RCL (i)
090: 31 34 ISZ
091: 34 24 RCL (i)
092: 34 09 RCL 9
093: 71 x
094: 61 +
095: 83 .
096: 00 0
097: 00 0
098: 00 0
099: 03 3
100: 34 09 RCL 9
101: 32 54 x^2
102: 71 x
103: 61 +
104: 33 00 STO 0
105: 31 22 01 GSB 1
106: 33 00 STO 0
107: 31 34 ISZ
108: 34 24 RCL (i)
109: 31 34 ISZ
110: 34 24 RCL (i)
111: 34 09 RCL 9
112: 71 x
113: 61 +
114: 83 .
115: 00 0
116: 00 0
117: 00 0
118: 05 5
119: 34 09 RCL 9
120: 32 54 x^2
121: 71 x
122: 61 +
123: 33 13 STO C
124: 31 34 ISZ
125: 34 24 RCL (i)
126: 31 34 ISZ
127: 34 24 RCL (i)
128: 34 09 RCL 9
129: 71 x
130: 51 -
131: 33 14 STO D
132: 34 00 RCL 0
133: 34 13 RCL C
134: 51 -
135: 31 71 XLT0
136: 31 22 06 GSB 6
137: 32 73 D>R
138: 33 11 STO A Mean Anomality
139: 33 00 STO 0
140: 22 02 GTO 2
141: 31 25 01 LBL 1
142: 34 15 RCL E
143: 81 /
144: 31 83 INT
145: 34 15 RCL E
146: 71 x
147: 34 00 RCL 0
148: 35 52 X<>Y
149: 51 -
150: 35 22 RTN
151: 31 25 06 LBL 6
152: 34 15 RCL E
153: 61 +
154: 35 22 RTN
------ Kepler equation ------
155: 31 25 02 LBL 2
156: 35 42 RAD
157: 02 2
158: 03 3
159: 35 33 ST I
160: 34 11 RCL A
161: 34 24 RCL (i)
162: 34 00 RCL 0
163: 31 62 SIN
164: 71 x
165: 61 +
166: 34 00 RCL 0
167: 32 51 XEQY
168: 22 03 GTO 3
169: 35 53 R DN
170: 33 00 STO 0 Eccentric Anomaly
171: 22 02 GTO 2
------ True Anomality ------
172: 31 25 03 LBL 3
173: 35 41 DEG
174: 01 1
175: 41 ENTER
176: 34 24 RCL (i)
177: 61 +
178: 01 1
179: 34 24 RCL (i)
180: 51 -
181: 81 /
182: 31 54 SQRT
183: 34 00 RCL 0
184: 31 73 D<R
185: 02 2
186: 81 /
187: 31 64 TAN
188: 71 x
189: 32 64 TAN-1
190: 02 2
191: 71 x
192: 31 81 XGT0
193: 22 04 GTO 4
194: 34 15 RCL E
195: 61 +
------ Ecliptic Longitude ------
196: 31 25 04 LBL 4
197: 34 13 RCL C
198: 61 +
199: 34 15 RCL E
200: 51 -
201: 33 00 STO 0
------ Mean Obliquity ------
202: 35 34 RC I
203: 07 7
204: 51 -
205: 35 33 ST I
206: 34 24 RCL (i)
207: 31 34 ISZ
208: 34 24 RCL (i)
209: 34 09 RCL 9
210: 71 x
211: 51 -
212: 33 06 STO 6
Push A: α - Right Ascension SUN
R/S: δ - Declination SUN
****** Program 2 ******
------ RA and DEC ------
001: 31 25 11 LBL A
002: 34 00 RCL 0
003: 31 62 SIN
004: 34 06 RCL 6
005: 31 63 COS
006: 71 x
007: 34 00 RCL 0
008: 31 63 COS
009: 81 /
010: 32 64 TAN-1
011: 01 1
012: 08 8
013: 00 0
014: 61 +
015: 01 1
016: 05 5
017: 81 /
018: 32 74 H>H.MS α - Right Ascension SUN
019: 84 R/S
020: 34 06 RCL 6
021: 31 62 SIN
022: 34 00 RCL 0
023: 31 62 SIN
024: 71 x
025: 32 62 SIN-1
026: 32 74 H>H.MS δ - Declination SUN
RE: (HP-67/97) Position of the Sun - Josef - 08-09-2023 12:00 PM
I found a bug in the program, I am attaching the new version.
Code:
A = Day
B = Month
C = Year
R/S
****** Program 1 v. 1.1 ******
001: 31 25 11 LBL A
002: 33 01 STO 1 day
003: 35 22 RTN
004: 31 25 12 LBL B
005: 33 02 STO 2 month
006: 35 22 RTN
007: 31 25 13 LBL C
008: 33 03 STO 3 year
009: 35 22 RTN
010: 31 25 14 LBL D
011: 02 2
012: 34 02 RCL 2
013: 32 71 XLEY first or second month?
014: 31 22 07 GSB 7 correct month and year
015: 02 2
016: 34 03 RCL 3
017: 01 1
018: 00 0
019: 00 0
020: 81 /
021: 31 83 INT
022: 33 08 STO 8
023: 51 -
024: 34 08 RCL 8
025: 04 4
026: 81 /
027: 31 83 INT
028: 61 +
029: 33 04 STO 4
030: 34 03 RCL 3
031: 03 3
032: 06 6
033: 05 5
034: 83 .
035: 02 2
036: 05 5
037: 71 x
038: 31 83 INT
039: 33 05 STO 5
040: 03 3
041: 00 0
042: 83 .
043: 06 6
044: 41 ENTER
045: 34 02 RCL 2
046: 01 1
047: 61 +
048: 71 x
049: 31 83 INT
050: 33 06 STO 6
051: 34 04 RCL 4
052: 61 +
053: 34 05 RCL 5
054: 61 +
055: 34 01 RCL 1
056: 61 +
057: 34 12 RCL B 1720994.5
058: 61 +
059: 33 00 STO 0 Julian Date
060: 22 15 GTO E
061: 31 25 07 LBL 7
062: 34 03 RCL 3
063: 01 1
064: 51 -
065: 33 03 STO 3
066: 34 02 RCL 2
067: 01 1
068: 02 2
069: 61 +
070: 33 02 STO 2
071: 35 22 RTN
------ Mean Anomality ------
072: 31 25 15 LBL E
073: 01 1
074: 08 8
075: 35 33 ST I
076: 34 00 RCL 0
077: 34 24 RCL (i)
078: 51 -
079: 03 3
080: 06 6
081: 05 5
082: 02 2
083: 05 5
084: 81 /
085: 33 09 STO 9
086: 01 1
087: 00 0
088: 35 33 ST I
089: 34 24 RCL (i)
090: 31 34 ISZ
091: 34 24 RCL (i)
092: 34 09 RCL 9
093: 71 x
094: 61 +
095: 83 .
096: 00 0
097: 00 0
098: 00 0
099: 03 3
100: 34 09 RCL 9
101: 32 54 x^2
102: 71 x
103: 61 +
104: 33 00 STO 0
105: 31 22 01 GSB 1
106: 33 00 STO 0
107: 31 34 ISZ
108: 34 24 RCL (i)
109: 31 34 ISZ
110: 34 24 RCL (i)
111: 34 09 RCL 9
112: 71 x
113: 61 +
114: 83 .
115: 00 0
116: 00 0
117: 00 0
118: 05 5
119: 34 09 RCL 9
120: 32 54 x^2
121: 71 x
122: 61 +
123: 33 13 STO C
124: 31 34 ISZ
125: 34 24 RCL (i)
126: 31 34 ISZ
127: 34 24 RCL (i)
128: 34 09 RCL 9
129: 71 x
130: 51 -
131: 33 14 STO D
132: 34 00 RCL 0
133: 34 13 RCL C
134: 51 -
135: 31 71 XLT0
136: 31 22 06 GSB 6
137: 32 73 D>R
138: 33 11 STO A Mean Anomality
139: 33 00 STO 0
140: 22 02 GTO 2
141: 31 25 01 LBL 1
142: 34 15 RCL E
143: 81 /
144: 31 83 INT
145: 34 15 RCL E
146: 71 x
147: 34 00 RCL 0
148: 35 52 X<>Y
149: 51 -
150: 35 22 RTN
151: 31 25 06 LBL 6
152: 34 15 RCL E
153: 61 +
154: 35 22 RTN
------ Kepler equation ------
155: 31 25 02 LBL 2
156: 35 42 RAD
157: 02 2
158: 03 3
159: 35 33 ST I
160: 34 11 RCL A
161: 34 24 RCL (i)
162: 34 00 RCL 0
163: 31 62 SIN
164: 71 x
165: 61 +
166: 34 00 RCL 0
167: 32 51 XEQY
168: 22 03 GTO 3
169: 35 53 R DN
170: 33 00 STO 0 Eccentric Anomaly
171: 22 02 GTO 2
------ True Anomality ------
172: 31 25 03 LBL 3
173: 35 41 DEG
174: 01 1
175: 41 ENTER
176: 34 24 RCL (i)
177: 61 +
178: 01 1
179: 34 24 RCL (i)
180: 51 -
181: 81 /
182: 31 54 SQRT
183: 34 00 RCL 0
184: 31 73 D<R
185: 02 2
186: 81 /
187: 31 64 TAN
188: 71 x
189: 32 64 TAN-1
190: 02 2
191: 71 x
192: 31 81 XGT0
193: 22 04 GTO 4
194: 34 15 RCL E
195: 61 +
------ Ecliptic Longitude ------
196: 31 25 04 LBL 4
197: 34 13 RCL C
198: 61 +
199: 34 15 RCL E
200: 51 -
201: 33 00 STO 0
------ Mean Obliquity ------
202: 35 34 RC I
203: 07 7
204: 51 -
205: 35 33 ST I
206: 34 24 RCL (i)
207: 31 34 ISZ
208: 34 24 RCL (i)
209: 34 09 RCL 9
210: 71 x
211: 51 -
212: 33 06 STO 6
Push A: α - Right Ascension SUN
R/S: δ - Declination SUN
****** Program 2 ******
------ RA and DEC ------
001: 31 25 11 LBL A
002: 34 00 RCL 0
003: 31 62 SIN
004: 31 71 XLT0
005: 35 51 01 SF 1 TAN Quadrant Setting
006: 34 06 RCL 6
007: 31 63 COS
008: 71 x
009: 34 00 RCL 0
010: 31 63 COS
011: 81 /
012: 32 64 TAN-1
013: 31 71 XLT0
014: 31 22 01 GSB 1
015: 35 71 01 F? 1
016: 31 22 01 GSB 1
017: 01 1
018: 05 5
019: 81 /
020: 32 74 H>H.MS α - Right Ascension SUN
021: 84 R/S
022: 34 06 RCL 6
023: 31 62 SIN
024: 34 00 RCL 0
025: 31 62 SIN
026: 71 x
027: 32 62 SIN-1
028: 32 74 H>H.MS δ - Declination SUN
029: 35 61 01 CF 1
030: 84 R/S
031: 84 R/S
032: 31 25 01 LBL 1
033: 01 1
034: 08 8
035: 00 0
036: 61 +
037: 35 22 RTN
RE: (HP-67/97) Position of the Sun - Hiwi - 01-13-2024 04:13 PM
Hi,
anyone tested this program?
i get an error on line 143, division by zero.
If anyone has it working, can you post an example?
Doey the program need prerecorded dataregister?
Ralf
RE: (HP-67/97) Position of the Sun - Hiwi - 01-14-2024 12:19 PM
Reg E is not assigned, so RCL E / will cause an Devision by Zero in any case.
Ralf
RE: (HP-67/97) Position of the Sun - Hiwi - 02-17-2024 11:14 AM
Sorry my fault, program works as expected, the datacard File was not included in the Version 1.1 Zip file, you have to use it from Version 1.0 file, should be the same.
Ralf
|