09. Vertical soft landing on the Moon
A lunar lander must fire its engine to touch down at zero speed. Does it save more fuel by braking gently early, or by waiting and braking hard at the end? This problem has an analytic solution for comparison.
| Item | Definition |
|---|---|
| States | Altitude , velocity (positive upward) |
| Control | Thrust |
| Objective | Minimize the thrust integral, proportional to propellant use |
| Phases | Two phases, 12 nodes each; free knot and final times |
| New concepts | An integral objective and an optimized switching time |
Situation
Section titled “Situation”The lander starts 100 m above the surface, descending at 10 m/s. Lunar gravity is 1.62 m/s². Its upward engine thrust ranges from zero to 4000 N. Mass is held constant at 1000 kg, approximating a maneuver whose propellant use is small relative to vehicle mass.
Propellant use is proportional to impulse, the time integral of thrust. We split time into a coast phase and a braking phase, leaving the switching time to optimization.
Formulation
Section titled “Formulation”Dynamics
Section titled “Dynamics”Upward is positive, so descent has . Both phases use the same equations.
Phases and linkage
Section titled “Phases and linkage”At the unknown switch , altitude and velocity remain continuous:
Thrust may jump. Both and are free.
Boundary conditions and constraints
Section titled “Boundary conditions and constraints”The lander cannot go underground, rise above its initial altitude, or reverse into upward flight.
Objective
Section titled “Objective”The constant factor makes the objective roughly order one without changing the optimum. This is a running cost (cost forms).
Parameters and scaling
Section titled “Parameters and scaling”Use m, m/s, m/s², kg, and N. Representative units are 100 m, m/s, , and 4000 N.
Initial guess
Section titled “Initial guess”Use the analytic solution below: free fall followed by maximum thrust, including its switching and final times. This checks whether the numerical solution preserves the analytic answer.
Results
Section titled “Results”
- Thrust is zero throughout phase 1 and 4000 N throughout phase 2.
- Ignition time: 3.632 s, at altitude 53.0 m and velocity -15.88 m/s.
- Touchdown time: 10.305 s; impulse: 26,695 N·s.
- Analytic ignition and touchdown times are 3.632 s and 10.305 s, matching the numerical result.
Explanation
Section titled “Explanation”Less fuel means less time in this model
Section titled “Less fuel means less time in this model”Integrate the velocity equation and use the endpoint conditions:
The initial descent speed must be canceled regardless of the thrust schedule. The other term is gravity loss, which increases with time spent airborne. Thus minimizing fuel here is equivalent to minimizing touchdown time.
The fastest safe descent uses zero thrust as long as possible, then maximum upward braking. Intermediate thrust prolongs the maneuver and increases gravity loss. The optimum is bang-bang control.
Calculate the switching time
Section titled “Calculate the switching time”Let m/s², and let be the positive magnitude of descent velocity at ignition. Free-fall distance plus braking distance equals initial altitude:
Therefore
For comparison, constant gentle braking from the start needs deceleration 0.5 m/s² and takes 20 s. Its impulse is 42 400 N·s, about 1.6 times the optimum.
Why optimize the knot?
Section titled “Why optimize the knot?”Thrust jumps from zero to 4000 N at ignition. Putting that jump at a free knot lets each phase use a constant control without polynomial oscillations. Unlike Example 08, the switching time is determined by optimization.
Try it
Section titled “Try it”- Lower
max_thrustto 3000 N. Compare the earlier ignition, longer duration, and larger impulse with the formulas. - Set
initial_velocityto zero and inspect the free-fall phase. - Replace the thrust guess
[0, p["max_thrust"]]by[2000, 2000]and check whether the solver returns to the same solution.
uv run python examples/09_soft_landing.py