Visual walkthrough — Optimal guidance — ZEM - ZEV formulation
We will use exactly three characters throughout. Let me draw them once, plainly, before any maths:
- — where the vehicle is right now (a dot in space, an arrow from the origin to the dot).
- — which way and how fast it is moving right now (an arrow attached to the dot).
- — the push we control (the thrust arrow — the only thing we get to choose).
The bold-face just means "this is an arrow, it has a direction, not only a size." A smart 12-year-old thinks: position is a place, velocity is a speed-arrow, acceleration is a shove. That is all ever mean.
Step 1 — Draw the world: a dot that coasts under gravity
WHAT. Before we steer anything, let's watch the vehicle do nothing — engine off. Only gravity acts. This "do-nothing" future is the whole trick.
WHY. The genius of ZEM/ZEV is to ask "if I quit steering right now, where do I end up?" To answer that we must first know how a coasting dot moves. That motion is double-integrator dynamics: acceleration integrated once gives velocity, integrated twice gives position.
PICTURE. Look at the figure. The white dot starts at with speed-arrow . With the engine off it drifts along the pale-yellow dashed curve, bending because gravity keeps adding downward speed.

The coasting dot lands (at the deadline ) at a place and a speed we can predict with school kinematics, using the countdown :
Each term is a picture: is "speed times time = distance," the classic straight coast; is the extra downward sag gravity produces.
Step 2 — Name the two errors: ZEM and ZEV
WHAT. Compare where the coasting dot ends up with where we want it: the target place and target speed . The gaps are our two errors.
WHY. If those gaps are zero, we don't need to do anything — coasting already wins. So the only reason to burn fuel is to close these gaps. Naming them lets us aim the engine at exactly the thing that's wrong.
PICTURE. Two arrows in the figure: the chalk-blue arrow ZEM points from the coast-landing spot to the target spot (a position gap). The chalk-pink arrow ZEV points from the coast-arrival speed to the target speed (a velocity gap, drawn in the speed-diagram inset).

Reading the ZEM formula term by term: start from the target , then subtract everything the free coast already gives you (, the drift , the sag ). Whatever is left over is the gap the engine must fill.
Step 3 — Write the true ending, engine included
WHAT. Now turn the engine on. The commanded acceleration can be any wiggle over the remaining seconds. We write it as , where is a dummy time variable that sweeps across the flight — it runs from now, , to the deadline, , i.e. . Add up its effect on the final speed and final place.
WHY. We can't choose a good until we know how each instant of pushing changes the endpoint. So we integrate the true dynamics . The symbol just means "add up the contribution of every instant from now until the deadline."
PICTURE. The figure slices the remaining time into thin bars. Each bar is a little push . A push done early (left bars) has a long lever-arm — it keeps moving the position for a long time. A push done late (right bars) barely nudges position. The bar heights times their lever arms is the picture behind the integral.

Step 4 — The constraints become "fill the two gaps"
WHAT. Demand that the true ending equals the target: and . Move the coast parts to the other side.
WHY. The coast parts on the left are exactly the things we subtracted to define ZEM and ZEV. So the boundary conditions collapse into two clean statements about the pushes.
PICTURE. Two "buckets" in the figure. The velocity bucket must be filled to the level ZEV by the raw sum of pushes. The position bucket must be filled to level ZEM, but each push pours in scaled by its lever-arm .

There are infinitely many push-profiles that fill both buckets. Which one is best?
Step 5 — "Best" means least effort → a straight-line push profile
WHAT. Among all profiles that fill both buckets, pick the one that spends least effort. We measure effort by Using calculus of variations with two Lagrange multipliers , the answer is forced to be linear in remaining time.
WHY the profile comes out linear (the proof-in-a-picture). This is the key result, so let's earn it rather than assert it. Lagrange's recipe says: to minimise subject to the two bucket constraints, subtract each constraint times an unknown constant multiplier and minimise the combined quantity freely: Here pays for the position bucket (so it multiplies the lever weight ) and pays for the velocity bucket (weight ). Now here is the crucial idea: because appears separately inside the integral, we can minimise at each instant on its own — pick the best for that one instant. The thing inside the bracket, for a single instant, is a plain upward parabola in : A parabola's bottom is where its slope is zero. The slope (gradient) is , so the minimum sits at That is a straight line in remaining time — a constant plus a slope times — precisely because the cost was a parabola (quadratic) and the constraint weights ( and ) were the only -shapes available to lean on.
PICTURE. The figure shows candidate profiles (wiggly, chalk-blue) all filling the buckets, and the winner (straight pale-yellow line). The straight line is the flattest way to deliver the required amounts — least squared area.

Here tilts the line and raises it. We don't know their values yet — the buckets will pin them down.
Step 6 — Substitute back and solve the tiny system
WHAT. Put the straight-line into the two bucket-equations. Substitute (remaining time) so the integrals become clean powers of .
WHY. Now the unknowns are just two constant vectors . Two vector equations, two vector unknowns — plain algebra finishes the job.
PICTURE. The figure plots the two moment integrals as coloured areas under and , giving the and factors you literally read off as triangle/curve areas.

Let me name the two equations so the algebra is easy to track:
Eliminate . Multiply (I) by and (II) by so both carry the same coefficient:
Subtract the first scaled line from the second to kill :
Back-substitute into the scaled first line :
Step 7 — The command applied right now
WHAT. We only ever apply the push at the current instant, i.e. at , where . So evaluate .
WHY. Guidance is run as feedback: use the command now, then next cycle recompute fresh ZEM/ZEV. We never store the whole profile — only its value at "now."
PICTURE. The figure highlights the left endpoint of the straight-line profile (at ) — that single dot is the number the thruster obeys this instant.

Now just add. First scale by :
Then add term by term, grouping the pieces and the pieces:
Each bracket is now just adding fractions with the same denominator — no ellipsis, no guesswork:
Step 8 — The interception law: why the coefficient becomes , not
WHAT. For a missile we only care about hitting the target's position; we don't care what velocity we arrive with. So we drop the velocity constraint entirely — there is no ZEV bucket to fill.
WHY the coefficient changes. This is the subtle point the reviewer flagged. You do not simply erase the ZEV term from the soft-landing law; that would leave , which is wrong. The was the answer to a two-constraint problem. With only one constraint we redo the algebra: only the position bucket survives, and the optimal profile has no velocity bucket to lean on.
PICTURE. The figure shows the single-bucket problem: only the position bucket exists now, so the optimal straight line is pinned by just one condition.

Redo Lagrange with one multiplier for the single position constraint. The combined quantity is and minimising the parabola at each instant (slope zero) gives Notice it passes through zero at the deadline (): with no velocity to match, the optimal push naturally fades to nothing at the very end. Now fill the single (position) bucket, using the same substitution as Step 6: The command applied now is :
Step 9 — The edge case: and negative
WHAT. Watch the coefficients and as the clock runs out, and ask what a negative would mean.
WHY. Real thrusters saturate; a command that goes to infinity is a design red flag. And a countdown that has passed zero is a mission state we must recognise, not silently feed into the formula.
PICTURE. The figure plots both coefficients against : two chalk curves rocketing toward the ceiling as . The curve (ZEM) climbs faster than (ZEV).

The one-picture summary

One image, the whole story: coast the dot (yellow), read the two gaps ZEM (blue) and ZEV (pink), fill the buckets with the straight-line optimal push, evaluate at "now" — and out drops .
Recall Feynman retelling — say it back in plain words
Imagine you're throwing a ball at a target and you can keep nudging it mid-flight. Keep three clocks in mind: now (), the deadline (), and the countdown between them (). First, pretend you stop nudging: with only gravity pulling down, where does the ball drift to, and how fast? Two gaps show up — the place gap (ZEM) and the speed gap (ZEV). Now, out of all the ways to nudge that would close both gaps, you want the laziest one — least total shove-squared (where "squared shove" is just the arrow's length times itself). Math says the laziest nudge is a straight-line schedule, and we proved it: at each instant the cost is a simple upward parabola in the push, and a parabola's bottom sits at a push that's a straight line in remaining time. Two facts pin down that line: the raw nudges must add up to the speed gap, and the early-weighted nudges must add up to the place gap. Flip the time variable to "remaining time," read the two areas, solve the little two-by-two — carefully, each fraction over the same denominator — and you get a rule you use this very instant: push six-over-time-squared times the place gap, minus two-over-time times the speed gap. If you don't care about arriving gently (a missile), throw away the speed bucket and redo the Lagrange step with one multiplier — the profile now fades to zero at the deadline, and the "six" becomes a "three," because a single area gives one-third instead of the coupled answer. That three-over-time-squared rule is exactly Proportional Navigation in a costume, with its navigation ratio pinned to three. And if time is almost gone with a gap remaining, the rule screams for infinite thrust — which is exactly why you run it as constant feedback and freeze it before the countdown hits zero, killing errors early while there's still time to be gentle.
Quick self-check
Ex1 landing values
Why the ZEV term is subtracted
What makes the optimal profile a straight line
Why interception uses not
What to do when
Related tools: Optimal Control — LQR · Lambert's Problem · Time-to-go estimation · Double Integrator Dynamics.