Visual walkthrough — Powered descent guidance — G-FOLD algorithm (convex optimization)
We will build everything from these plain ideas, one per step. Nothing is assumed.
Step 1 — The falling lander and the four things we can measure
WHAT. Picture a rocket somewhere above a landing pad. To describe it completely at any instant we need only a handful of numbers:
- Where it is — its position. We write this as . The little arrow on top means "this is not one number, it's three: how far East, how far North, how high up." A bold letter with an arrow = a vector = an arrow in space.
- How fast and which way it's moving — its velocity, written . Another arrow. It points along the direction of motion; its length is the speed.
- How heavy it currently is — its mass, written . Just one number (no arrow), because "heaviness" has no direction. It shrinks as fuel burns.
- The push from the engine — the thrust, written . An arrow again, because a push has both a strength and a direction (the engine can gimbal to point the flame).

WHY these four. Newton told us that to predict the future of any object you need its position, its velocity, and the forces on it. Add mass because a rocket loses mass as it burns — and that changes how the same push accelerates it. These four are the complete story.
Step 2 — Newton's law for a burning rocket
WHAT. Two forces act on the lander: the engine push (up-ish) and gravity pulling it down. Gravity near a planet's surface is a constant downward arrow we call (on Mars its length is ; the arrow points at the ground).
Newton says force equals mass times acceleration. The total force is thrust plus the weight :

WHY. This single line is the physics of the fall. Everything downstream is bookkeeping to make a computer able to solve it. Notice the troublemaker already: sits multiplying , and itself is changing every second. A moving target inside the equation.
WHAT IT LOOKS LIKE. In the figure the black arrow fights the orange arrow ; their sum (violet) is the net force, and it points wherever the lander actually accelerates.
Step 3 — How fuel disappears
WHAT. How fast does the rocket lose mass? A rocket makes thrust by throwing exhaust gas out the back very fast. Push out more gas per second → more thrust and faster weight loss. Concretely:
Term by term:
- — rate of mass loss (negative: mass goes down).
- — the length of the thrust arrow, i.e. its strength as one number. The double bars mean "how long is this arrow" (its magnitude).
- (Greek "alpha") — a fixed number for the engine, equal to where is the exhaust speed. Big exhaust speed ⇒ small ⇒ stingy with fuel.
- the minus sign — we're losing mass, not gaining it.

WHY the bars and not ? Fuel doesn't care which way the flame points, only how hard. So the burn rate depends on the arrow's length, a single positive number — hence the magnitude bars. This is our first taste of the Tsiolkovsky Rocket Equation in its instantaneous, differential form.
WHAT IT LOOKS LIKE. The figure is a straight line: thrust strength on the horizontal axis, burn rate on the vertical. Double the push, double the burn.
Step 4 — The villain appears: the throttle annulus
WHAT. A real engine cannot throttle to zero smoothly. It has a floor (below this it flames out) and a ceiling (structural limit):
Draw the set of allowed thrust arrows. All arrows whose length is between two values fill a ring (an annulus) — the region between two circles.

WHY this is the whole problem. A set is convex if the straight line between any two of its points stays inside the set. The disk inside the outer circle is convex — fine. But the ring has a hole in the middle: draw a chord across the doughnut hole and it leaves the set. Non-convex. Non-convex sets are where optimizers get stuck in false "landings."
Step 5 — Divide by mass, take a logarithm (kill the nonlinearity)
WHAT. Two clever renamings. First, divide Newton's law from Step 2 by :
We named the awkward ratio — the acceleration command. The messy vanished from the acceleration equation; it is now perfectly linear in .
Second, for the mass, use (the natural logarithm of mass):
Here (Greek "Gamma") is just a new name for "thrust-per-mass strength," and is the log of mass.

WHY the logarithm? The rate is exactly the derivative of — that's what "log-derivative" means. So by working in the nasty division becomes a clean linear line . Logarithms turn division into subtraction; here they turn a nonlinear tangle into a straight line. The picture shows the curved becoming a straight .
Recall Why can we not just leave
alone? Because multiplying AND appearing in the throttle bounds are the two nonlinear knots. The trick unties the first; unties the second.
Step 6 — Lossless convexification: fill in the doughnut hole
WHAT. Divide the throttle bounds by too. The upper/lower thrust limits become bounds on , but we introduce the slack as a stand-in for the thrust length and demand:
Read the first inequality carefully: instead of forcing (an equation — a thin shell, non-convex), we only ask (allowed to be anywhere inside). The set of obeying this is an ice-cream cone — and a cone is convex. The doughnut hole is filled.

WHY relaxing is FREE. The fuel cost we will minimise is — it wants tiny. But can't go below . So the optimizer squeezes down until it kisses — recovering , the true engine physics, at the answer. This is provable via the Pontryagin Minimum Principle, and it's why the trick is called lossless: we relaxed the constraint but the optimum falls back onto the honest boundary anyway.
WHAT IT LOOKS LIKE. In the figure the optimal solution (magenta dot) always rests on the surface of the cone, never floating inside it — cost pulls it down to the skin.
Step 7 — The last curved wall: the floor
WHAT. One nonlinearity survives. The lower throttle bound, written in , is because , so . That is a curve, and a curve as a lower bound can be non-convex. We approximate it near a reference mass (the mass along a coasting no-thrust path) using a Taylor expansion — replacing the exponential by its own tangent parabola:
- The bracket is the second-order Taylor picture of — a convex parabola that hugs the true curve.
- The upper bound uses only the first two terms (a straight line) — also convex.

WHY Taylor and not something else? A Taylor expansion is the unique polynomial that matches a curve's value, slope, and bend at one point. Keeping it to second order gives us a convex quadratic — the highest fidelity we can afford while staying convex. Now every constraint is either linear or a cone: the problem is a Second-Order Cone Program (SOCP).
WHAT IT LOOKS LIKE. The figure overlays the true curve (violet) and its parabola approximation (orange dashed) touching at — nearly identical across the mass range the lander actually visits.
Step 8 — Add the glide-slope cone and read off the program
WHAT. One safety wall remains: don't fly sideways into a hill. Force the lander to stay inside a funnel that opens upward from the pad. If is height and is horizontal offset, the funnel is
- — the glide-slope angle, how wide the funnel opens.
- — how many metres sideways you're allowed per metre of height (opposite-over-adjacent of the funnel's wall). A cone, again convex.
Now stack everything — this is the finished convex program:

WHY line-search the time . For a fixed flight time every piece above is convex — one solve, global optimum. But making a variable re-introduces a nonlinearity. So we solve the convex problem for many values and pick the cheapest; the fuel-vs- curve has a single dip (unimodal), so a simple 1-D search wins. This outer loop is the seed of onboard replanning on Falcon 9 and Mars landings.
The one-picture summary

The whole derivation on one canvas: nonlinear rocket → (divide by , take ) → linear dynamics → (relax equality to ) → convex cone → SOCP solved to the global optimum.
Recall Feynman retelling — say it like you'd tell a friend
We have a rocket falling toward a pad, and we want to touch down gently, on the dot, using the least fuel. Newton hands us the motion, but two things make it ugly for a computer. First, the rocket's weight keeps changing as it burns — so we rename "push divided by weight" as one clean acceleration knob, and we track the logarithm of the weight so its change becomes a straight line. Second, the engine can't idle to zero — it must push at least a little — which carves a doughnut of allowed pushes with a forbidden hole in the middle. Doughnuts trap optimizers. So we fill the hole: we let the thrust strength be at most the slack variable instead of exactly it, turning the doughnut into an ice-cream cone. And here's the magic — because we're trying to save fuel, and fuel cost is that very slack, the answer naturally slides down onto the cone's surface, giving back the honest engine physics for free. One curved wall (the minimum-throttle floor) we straighten with a Taylor parabola. We wrap a safety funnel so we don't clip a hill. What's left is a smooth bowl with a single lowest point — a second-order cone program — which a computer nails to the global best in a fraction of a second. Try a few flight times, keep the cheapest, and land.