Post Reply 
Lunar landing game madness
04-11-2024, 06:45 PM (This post was last modified: 04-11-2024 06:46 PM by robve.)
Post: #6
RE: Lunar landing game madness
(04-07-2024 06:55 AM)EdS2 Wrote:  What happens in your case if you start one round earlier, so your table of 5 preliminary burns becomes a table of four burns?

A bit of experimentation with the code shows that decreasing n by one or more may not produce better solutions or may produce no solution at all. For example, reducing n by one, as shown in the Lua code update below, gives no solutions for the Mathemagician's lunar lander game:

  n = n - 1
  k = (n - 1) * g - s


That's because reducing n limits the control we have with burns even further, which makes things worse, as you've also surmised. The Mathemagician's version of this game gives very little control with tight tolerances (I've edited the post to add HP-71B code that emulates the game.) On the other hand, increasing n might produce more solutions, but at a cost of higher fuel consumption, simply because we linger longer in the descent.

(04-07-2024 06:55 AM)EdS2 Wrote:  Maybe the problem is in the lack of fine control. If one or more of the final burns is not a 9 but an 8, there would be a need for more thrust in the early stage. That's a degree of freedom for fine-tuning, I think?

Yes. We can set the final burn to the lunar surface to a=8 and the other burns a=9, which we can simulate by starting with a=8 and adding a=9 to the code like so:

  print(string.format("%4d %4d %5d %6d %6.1f %6.1f", f, a, v, h, t, b))
  a = 9


then we find seven possible sequences of six initial engine burn steps:

6 9 0 0 0 0
7 7 1 0 0 0
8 5 2 0 0 0
8 6 0 1 0 0
9 3 3 0 0 0
9 4 1 1 0 0
9 5 0 0 1 0

These have all only 4 units of fuel left, instead of the 9 units of fuel left that we had before.

Changing the weight factor w=3 (from w=1) to go autopilot produces a lot of solutions with seven initial burns, but with only 4 units of fuel left.

It's neat that we can play with the parameters of this code to answer questions like these. It's also useful to make these games a bit harder to play and check if and how many possible solutions exist.

- Rob

"I count on old friends to remain rational"
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Lunar landing game madness - robve - 04-07-2024, 02:03 AM
RE: Lunar landing game madness - EdS2 - 04-07-2024, 06:55 AM
RE: Lunar landing game madness - robve - 04-11-2024 06:45 PM
RE: Lunar landing game madness - Jim Horn - 04-08-2024, 09:36 PM



User(s) browsing this thread: 1 Guest(s)