Skip to content

Commit 456f228

Browse files
committed
Add explanation of variables and code structure.
1 parent 25d54ab commit 456f228

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

59_Lunar_LEM_Rocket/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,33 @@ http://www.vintage-basic.net/games.html
3535
#### Porting Notes
3636

3737
(please note any difficulties or challenges in porting here)
38+
39+
### LUNAR
40+
41+
Variables:
42+
43+
`A`: Altitude in miles. Up is positive.
44+
`V`: Velocity in miles / sec. Down is positive.
45+
46+
`M`: Weight of capsule in pounds, both fuel and machine
47+
`N`: Empty weight of capsule in pounds. So, weight of fuel is M - N.
48+
49+
`G`: Gravity in miles / sec^2, down is positive.
50+
`Z`: Exhaust velocity in miles / sec
51+
52+
`L`: time in seconds since start of simulation.
53+
`K`: Burn rate for this 10 second turn, pounds of fuel per sec
54+
`T`: Time left in this 10 second turn, in seconds.
55+
`S`: Burn time in this 10 second turn, input to subroutine 420.
56+
57+
Subroutines:
58+
59+
330, Apply updates from one call to subroutine 420.
60+
61+
370, If you started descending and ended ascending, figure out whether you hit the surface in between.
62+
63+
420, Compute new velocity and altitude using the Tsiolkovsky rocket equation for S seconds:
64+
65+
`Q`: Fraction of initial mass that's burnt, i.e. 1 - mf / mo, exactly what we need for the Taylor series of `ln` in the rocket equation. Local to this subroutine.
66+
`J`: Final velocity after S seconds, down is positive. Return value.
67+
`I`: Altitude after S seconds, up is positive. Return value.

0 commit comments

Comments
 (0)