The Museum of HP Calculators


Orbital Lander for the HP-41C

This program was first published in the HP-41C Users' Library Solutions: Games by Hewlett-Packard and is used here by permission.

This program is supplied without representation or warranty of any kind. Hewlett-Packard Company 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 simulates a Lunar Excursion Module in orbit 100 km above the surface of the moon. The object is to execute a soft landing (velocity less than 5m/sec, at an angle not more than 5° from vertical) given a limited supply of fuel. On each move, you have the option of either free-falling for a specified period of time, or applying a specified thrust during a specified time period. Thrust is calculated and applied from your input of change in velocity over a given amount of time in a given direction from 0° to +/-180°. Your velocity will not actually change by this amount, of course, since gravity is also acting. You are not allowed to apply a thrust of greater than 7 Gees (69m/sec/sec of time period). If you run out of fuel, your thrust will be reduced to the fuel supply on hand. Thereafter, any thrust value you provide will be automatically changed to zero. When you pass zero altitude (i.e., land or crash), the program will calculate and display your velocity at impact. (Note to skilled pilots: try also to land at 0° longitude.)

Because the orbital equations are time-independent, the program has to convert the desired "delta-t" into a variable the equations can work with. This conversion process is not completely accurate, but the only error it introduces is that the actual duration of the jump may be slightly different from the one you specify. No positional error is introduced--you will still be on exactly the correct orbit--but you will find yourself at a slightly different point along that orbit. For example, a 2000 second jump along the initial orbit will take you almost a third of the way around the moon, but the conversion approximation will be about 10 percent shorter than an actual 2000 second jump.

Variable Conventions:

Important: The altitude (A) is from the surface of the moon, not the center.

The angle of velocity (Vangle) is given from horizontal, with 0° being forward and 90° straight up.

Thrust angles also follow Vangle conventions. 180° is a retrofire.

Note: Requires 1 Memory Module on HP-41C

Instructions

Step

Instructions

Input Data/Units

Keys

Output Data/Units

1

Enter program

     

2

Initialize

 

[XEQ] ORBIT 

 

3

*Mission status: altitude

 

 

A=

 

       longitude

 

[R/S]

angle=

         velocity  

[R/S]

V=

         angle of flight  

[R/S]

Vangle=

         fuel remaining  

[R/S]

F=

 4

To free fall: key in number of seconds. Go to step 3 for outputs.

n

[A]

 

  Go to step 3 for outputs.      

5

To fire rockets: key in total change in V

dV(m/s)

[ENTER]

 

      key in angle of thrust

theta (deg)

[ENTER]

 

  

    key in number of seconds for total burn

n (sec)

 [B]

 

      Go to step 3 for outputs.    

 

       

 

 

When A=0.00, you are down.  

 

 

       

 

*

Continuing [R/S]will repeat status.

 

 

 

Example

   Keystrokes:          Display:
[XEQ] [ALPHA] 
SIZE [ALPHA] 015
[XEQ] [ALPHA] 
ORBIT [ALPHA]           A=100000.00 M  (altitude)
[R/S]                   angle=0.00        (longitude)
[R/S]                   V=1631.77 M/S  (velocity)
[R/S]                   Vangle=0.00        (angle from horizontal)
[R/S]                   F=2,000.00     (fuel)
1000 [A]                A=99,957.06 M
[R/S]                   angle=55.65
[R/S]                   V=1,631.80 M/S
[R/S]                   Vangle= 0.00
[R/S]                   F=2,000.00
For 10 seconds apply 7 gravities as retrofire
69 [ENTER] 10 [X]
180 [ENTER]
10 [B]                  A=99,908.77 M
[R/S]                   angle=55.95
[R/S]                   V=941.88 M/S
[R/S]                   Vangle=-0.59
[R/S]                   F=1,310.00
200 [A]                 A=78,392.28 M
[R/S]                   angle=61.89
[R/S]                   V=974.77 M/S
[R/S]                   Vangle=-12.14
[R/S]                   F=1,310.00
  .                        .
  .                        .
  .                        .

The Program

LINE  KEYS
 01 <>LBL "ORBIT"       Initialize
 02  SF 27
 03  CLRG
 04  CF 05
 05  2000
 06  STO 00
 07  1839000
 08  STO 01
 09  4.89663 E12
 10  STO 03
 11  1631.765625
 12  STO 05
 13  1739000
 14  STO 11
 15  0
 16  GTO 01
 17 <>LBL B
 18  STO 12             Thrust
 19  69
 20  *
 21  R^
 22  RCL 00
 23  X<=Y?
 24  X<>Y               No greater than 7 gees
 25  RDN
 26  X<=Y?
 27  X<>Y
 28  RDN
 29  ST- 00
 30  P-R
 31  ST+ 05
 32  RCL 05
 33  9
 34  X>Y?
 35  GTO 21
 36  R^
 37  ST+ 04
 38 <>LBL 01
 39  RCL 04             Compute new orbit
 40  X^2
 41  RCL 05
 42  X^2
 43  +
 44  2
 45  /
 46  RCL 03
 47  RCL 01
 48  /
 49  -
 50  STO 06
 51  RCL 01
 52  RCL 05
 53  *
 54  STO 07
 55  X^2
 56  RCL 03
 57  /
 58  STO 08
 59  *
 60  2
 61  *
 62  RCL 03
 63  /
 64  1
 65  +
 66  SQRT
 67  STO 09
 68  RCL 08
 69  RCL 01
 70  /
 71  1
 72  -
 73  RCL 09
 74  /
 75  FIX 7
 76  RND
 77  ACOS
 78  RCL 04
 79  RCL 05
 80  *
 81  X>0?
 82  SF 05
 83  RDN
 84  FS?C 05
 85  CHS
 86  RCL 02
 87  +
 88  360
 89  MOD
 90  STO 10
 91  RCL 12
 92 <>LBL A
 93  STO 12             Free fall
 94  0
 95  ENTER^
 96  ENTER^
 97  RCL 05
 98  9
 99  X>Y?
100  GTO 21
101  RDN
102  RCL 12
103  *
104  RCL 03
105  RCL 01
106  X^2
107  /                  g
108  RCL 12
109  *
110  2
111  /
112  RCL 04
113  X<>Y
114  -
115  RCL 12
116  *
117  RCL 01
118  +
119  R-P
120  RDN
121  ST+ 02
122  RCL 08
123  RCL 09
124  RCL 02
125  RCL 10
126  -
127  COS
128  *
129  1
130  +
131  /
132  STO 01
133  RCL 03
134  X<>Y
135  /
136  RCL 06
137  +
138  2
139  *
140  SQRT
141  STO 13
142  RCL 01
143  *
144 <>LBL 06
145  X<>Y
146  X!=0?
147  FIX 7
148  RND
149  ACOS
150  RCL 07
151  RCL 02
152  RCL 10
153  -
154  SIN
155  *
156  X<0?
157  SF 05
158  RDN
159  FS?C 05
160  CHS
161 <>LBL 20
162  STO 14
163  RCL 13
164  P-R
165  STO 05
166  RDN
167  STO 04
168  RCL 01
169  RCL 11
170  -
171  X<0?
172  GTO 22
173 <>LBL 10
174  FIX 2              Output
175  ADV
176  "A="
177  RCL 01
178  RCL 11
179  -
180  X<0?
181  CLX
182  ARCL X
183  "|- M"
184  AVIEW              Altitude
185  STOP
186  "angle="
187  RCL 02
188  1
189  P-R
190  R-P
191  ARCL Y
192  AVIEW              Longitude
193  STOP
194  "V="
195  ARCL 13
196  "|- M/S"           Velocity
197  AVIEW
198  STOP
199  "Vangle="
200  ARCL 14            Angle from horizon
201  AVIEW
202  STOP
203  "F="
204  ARCL 00            Fuel
205  AVIEW
206  STOP
207  GTO 10
208 <>LBL 21
209  RDN
210  RDN                Vector sums
211  2
212  /
213  CHS
214  RCL 05
215  +
216  RCL 12
217  *
218  X<>Y
219  RCL 03
220  RCL 01
221  X^2
222  /
223  RCL 12
224  *
225  -
226  ST+ 04
227  2
228  /
229  CHS
230  RCL 04
231  +
232  RCL 12
233  *
234  RCL 01
235  +
236  R-P
237  STO 01
238  X<>Y
239  ST+ 02
240 <>LBL 00
241  RCL 04
242  RCL 05
243  R-P
244  STO 13
245  X<>Y
246  GTO 20
247 <>LBL 22
248  ST- 01             Impact
249  3
250  *
251  RCL 04
252  X^2
253  +
254  ABS
255  SQRT
256  CHS
257  STO 04
258  GTO 00
259  .END.

Register Use

R00  Fuel
R01  Ri
R02  i
R03  Gm
R04  Vr
R05  Ve
R06  E
R07  1
R08  Ko
R09  e
R10  '
R11  surface
R12  t
R13  V
R14  v

Flags

05 Used

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