Φferromotion · textbook · chapter 15 rust → wasm · on-device

Landing a rocket

A powered descent is a hard optimization: the dynamics are nonlinear — thrust divided by a mass that burns away as you fire — and the trajectory must end, exactly, on the pad at zero velocity. Successive convexification cracks it by solving a sequence of easy convex problems, each a better linear picture of the last. This page runs that solver, on your device, and lets you watch it converge.

01 — the problemA guess that isn't a trajectory

Start with the simplest possible plan: a straight line from where the vehicle is to the pad. It has the right endpoints and is completely, physically impossible — it ignores gravity, ignores that thrust acts through a shrinking mass, ignores that you cannot pull downward. It is not a trajectory at all; it is a shape with the correct ends. The job is to bend that shape until every step obeys the real dynamics, without ever leaving the pad constraint or the thrust limits.

02 — convexify, repeatedly

The dynamics are non-convex, so we cannot optimize them directly. But we can linearize them about the current guess — and a linear model with a quadratic cost is a convex problem, which solves fast and exactly. The catch is that a linearization is only trustworthy near where it was taken. So SCvx does not solve once; it solves, re-linearizes about the new answer, and solves again — each convex subproblem a sharper local picture, the sequence marching toward a trajectory that satisfies the true nonlinear dynamics.

Scrub the iterations below, or play them. The dashed line is the impossible initial guess; the solid curve is where SCvx has bent it. Watch it turn from a straight line into a real descent.

iteration
dynamics defect
trust radius
trajectory

the defect is how badly the path violates the true dynamics; feasible when it reaches ~zero

03 — three safeguardsWhy the sequence converges

Naively iterating linearizations diverges. SCvx adds three safeguards, and they are the whole reason it works:

Virtual controls. A slack term is added to the linearized dynamics and then punished by a steep penalty. It guarantees every subproblem has a solution — the method can never stall because a linearization momentarily has none — and at convergence the penalty has driven that slack to zero, which is exactly dynamic feasibility.

A trust region. Each step is bounded so the solution cannot wander past where the linearization is believable. Without it the convex model, trusted too far, would fly off to a meaningless "optimum."

A ratio test. After each solve, SCvx compares the actual reduction in nonlinear cost to the reduction the convex model predicted. Agree well? The step is good — accept it and enlarge the trust region. Disagree? The linearization was overtrusted — reject and shrink. That single adaptive number is what turns the loop from fragile into superlinearly convergent.

Look at the defect plot as you scrub. For the first iterations it falls steadily; near the end it drops by orders of magnitude per step — the hallmark of superlinear convergence. Once the guess is close enough that the linearization is nearly exact, each convex solve almost lands it, and the error collapses.

04 — the checkFrom impossible line to real landing

On load, this page ran SCvx from the straight-line guess to convergence:

defect of the initial straight-line guess
defect after convergence
touchdown point (pad is the origin)
iterations to converge
verdict

The defect falls from a wholly-infeasible guess to machine-negligible, and the final trajectory arrives at the pad at rest, inside the thrust limits, having burned finite fuel. Nothing about the landing was designed by hand — it was found, as the fixed point of a sequence of convex problems.

05 — the pointSolve the hard problem as a sequence of easy ones

Don't solve the non-convex problem — solve a sequence of convex ones.

Linearize, bound the step, add slack you then punish away, and judge each move by whether reality agreed with the model. Repeat. A problem no convex solver can touch becomes a short list of problems every convex solver eats for breakfast — and the fixed point they converge to is your trajectory.

This is the guidance idea behind autonomous rocket landing, and the same machinery replans robot arms, drones, and legged gaits through non-convex constraints. It closes the book's planning arc: where the contact chapter smoothed a kink and bounded the step, this one linearizes the whole trajectory and bounds the step — the same instinct, believe the model only where it holds, applied to an entire flight.

What you just drove: the ScvxProblem solver from ferromotion-control, compiled to WebAssembly — the same code the native tools link against. Every iteration's trajectory, defect, and trust radius was computed live from a straight-line guess; the convex subproblems are QPs solved on-device.

Verified in the library: the analytic dynamics Jacobian matches finite differences; a linear system reaches zero defect in one solve (the linearization is exact); from an infeasible guess the rocket lands with defect → ~1e-9 (superlinear); the virtual controls vanish at convergence; and the defect falls >100× while the trust radius adapts. Each is a test in cargo test, not a claim in prose. See also ch.14 — planning through contact · the full textbook.

Institute for Physical AI · the Rust library · crates.io