# Controlling suicide burn landing location in a python simulation?

I recently asked a question in stackoverflow about Simulation of suicide burn in openai-gym's LunarLander. Sadly most of my assumptions about suicide burn implementaion were wrong but the answer given to my question solved my problem and able to land the lander gracefully. But if you watch the lander simulation its currently lands on random locations and I want to land the lander between the two flags which is in the range (-0.05,0.05) of x, where x is the x=state[0] .

I can control the lander using 4 actions (nothing,down, left,right) but in my stackoverflow post I did simulations only with 2 of 4 actions. How do I force land my lander between these coordinnates?

A second minor question is regarding this equation

 alt_burn = (y * g + 0.5 * v*v) / (13.0 / env.lander.mass * 0.5)


Why is acceleration of the engines should not be defined as the current acceleration?

Why is acceleration of the engines should not be defined as the current acceleration?

alt_burn is not an acceleration. It is, I think, the altitude to start the suicide burn. I don't know why the other poster called it an acceleration. If part of an answer confuses you, it's usually a good idea to ask for clarification from the person who gave you the answer.

I want to land the lander between the two flags

One approach is to estimate where you're going to land and then make a corrective maneuver if you don't like the answer.

To estimate your landing x position, first estimate how much time you have until touchdown. Your current altitude divided by your current vertical speed is not a very good estimate, because you're going to be accelerated by gravity and then decelerated by your suicide burn, but it might be a good enough estimate for our purposes.

• I don't know why the other poster called it an acceleration I believe he meant this part of alt_burn equation (13.0 / env.lander.mass * 0.5) – Eka Jan 17 at 7:41