# Lunar lander: How to calc acceleration in each step

I'm trying to make a lunar lander simulator. I'm going to use a simple Euler integration. AFAIK all I've to calculate is the acceleration in each step, and then I should be able to update velocity and position.

There's a paragraph I don't really understand:

Although most operations are self-explanatory, a brief description of acceleration is warranted. Acceleration is broken down into vertical and horizontal components, where the vertical component is normal to the Moon's surface. The instantaneous vertical and horizontal accelerations of a moving body in reference to this surface are Av=Vh^2/r and Ah=–VhVv/r. To this we add the accelerations resulting from gravity and thrust. Gravity, of course, acts vertically downward. The vertical and horizontal components of thrust are a function of the pitch angle.

The author is making a much more realistic simulation here and because of that he is not assuming the Moon is flat. He comes up with two initial values for each acceleration component:

    Av=Vh^2/r

Ah=–VhVv/r


1- Seems that Av is the centripetal acceleration, but where does the Ah come from?

2- Are those initial values really needed? In my game the Moon is going to be flat. I thought taking into account thrust/mass and gravity would suffice.

Those are not initial values. They are the instantaneous (for each moment in time) components of acceleration, in a polar coordinate system, of an object that is moving tangentially with respect to that coordinate system's origin. Av is the 'vertical' component away from the moon's center and Ah is the 'horizontal' component along the surface of the moon. Note that the same motion in a cartesian coordinate system would be a non-accelerated one.
• Well, my flat simulation does not match the expected behavior. I'm taking into account initial values for altitude, speed and acceleration, yet my lander keeps falling to the ground at increasing speed, and crashes at -230 m/s in the first minute of the descent. Ay is constant (lunar gravity) but doing vy += ay*dt seems to increase descent rate faster than it should. – Mister Smith Dec 11 '13 at 14:01