The one solve that does not ask which conic it is
Assumes Angular momentum, Conic sections and Vis-viva.
An inverse-square force allows four curves and the eccentricity alone decides which. That is a statement about shape, and it is clean. The statement about time is not clean at all. Position against time on an ellipse comes from solving ; on a parabola from a cubic in ; on a hyperbola from . Three equations, three variables that mean three different things, and a program that computes an orbit has to ask which one it is holding before it can say where the body will be.
The awkward part is not the asking. It is that each of the three is at its worst exactly where the next one begins.
Three equations that are one equation
Kepler’s equation is a statement about area. The eccentric anomaly is an angle on the circle that circumscribes the ellipse, the mean anomaly is proportional to the area swept, and is the equal-area law written as a relation between two angles. It is transcendental, has no closed form, and is solved anyway — in four Newton steps for a planet, in seven for a comet. Push towards 1 and the construction loses its meaning by degrees. The circumscribing circle grows without bound; the ellipse it circumscribes becomes a long thin sliver; and , the angle on that circle, comes to be a quantity of which almost all values describe the far end of an orbit nobody is looking at. At the whole of the interesting motion — the part near periapsis, where the comet is bright and the observations are — occupies a fraction of a degree of . The equation still holds. The parameterisation has become a bad set of coordinates for the question.
At exactly there is a different equation and it is better than either neighbour: Barker’s,
a depressed cubic with one real root, solvable in closed form by Cardano. No iteration, no transcendence, no difficulty of any kind. And it applies to precisely one value of the eccentricity, which no real orbit has.
Above 1 the hyperbolic form takes over, , and it inherits its own version of the trouble from below. Just above the two terms are nearly equal and their difference is the answer; subtracting them throws away digits in proportion to how nearly parabolic the orbit is.
The substitution that has no branch in it
The universal formulation begins by refusing to use and using instead.
That is the whole trick, and it is worth pausing on because it looks like nothing. The semi-major axis is finite and positive on an ellipse, infinite on a parabola, and finite and negative on a hyperbola. Any formula written in terms of therefore has a singularity in the middle of the family, and every branch in the classical treatment is that singularity being stepped around. The reciprocal has none: runs smoothly from positive through zero to negative as the eccentricity passes 1, and zero is not a special value of it in any way. Since with the specific orbital energy, what has really happened is that the parameter has been changed from a length to an energy — and energy passes through zero without noticing. The independent variable changes too. In place of an angle, a quantity with dimensions of the square root of a length, defined so that . Then the time of flight from a state is
with , and the radius along the way is
The functions and are the Stumpff functions. On an ellipse and the first equation reduces to Kepler’s; on a hyperbola and it reduces to the hyperbolic form; at it reduces to Barker’s cubic, since and and the expression becomes a polynomial in of degree three. The three classical equations are not analogous. They are the same equation at three values of one parameter.
Why the derivative is the thing to look at
Newton’s method on any of these forms needs the derivative of the left-hand side, and in the universal form that derivative is
The distance from the primary. Not an approximation to it, not a quantity resembling it: the radius itself, which the formulation is computing anyway. This is why the iteration does not care which conic it is on. A Newton step divides by the derivative, so a solve becomes ill-conditioned where its derivative approaches zero — and is strictly positive on every orbit of every class. It is small at periapsis and large far out, so the step size varies, but the sign never changes and the value never vanishes. Compare Kepler’s equation, whose derivative is : at and that goes to zero, and the near-parabolic ellipse near periapsis is precisely the case where a Newton step wants to divide by almost nothing.
The step counts in the figure above make the point without argument. Six steps at , ten at the parabola, eleven a ten-thousandth above it, nine well beyond. Whatever varies there is the quality of the first guess. Nothing varies at .
What the series is for
Between the mathematics and the arithmetic there is one more layer, and it is the only place a case split survives.
Written in closed form, . As the numerator is a difference of two numbers that agree to more and more digits, and floating-point subtraction of nearly equal numbers destroys precision in exact proportion to how nearly equal they are. At , differs from 1 in the twelfth decimal place; subtracting gives four significant digits out of sixteen, and dividing by scales the error up rather than away.
The series has no such problem. is a sum of terms of decreasing size with no cancellation between them, and it converges fastest exactly where the closed form is worst.
So an implementation uses the closed form away from the origin and the series near it, and the switch is at a threshold chosen by measuring where the two agree to full precision. It is worth being exact about what that case split is and is not. It is not the branch on the conic class returning by another door: it does not test the eccentricity, it does not distinguish an ellipse from a hyperbola, and it does not change the function being computed. It tests whether a subtraction is about to lose digits. The mathematical object has no branch; the machine that evaluates it has a floating-point format.
What was actually computed, and what was measured
Nothing on this page is an observation. Every number here comes out of arithmetic performed on two given quantities, and the honest description of the whole essay is that it is about a method rather than about the sky.
The observations enter one step earlier and they are worth naming, because the method exists to serve them. An orbit is fitted to a sequence of astrometric positions — two angles at a time, with no distance in any of them — and the fit works by predicting where the body should have been at each observed epoch and adjusting the elements until the predictions land on the observations. That prediction is a solve of exactly the kind above, performed once per observation per iteration of the fit, thousands of times for a well-observed object. A solve that needs a different code path either side of is a fit whose derivatives with respect to the elements are discontinuous at , which is where a marginally-unbound comet’s fit spends its time.
The measurement that shows this is real, rather than tidy, is the population of comets catalogued with eccentricities between 0.999 and 1.001. Their elements were determined by iterating the very quantity that all three classical forms handle badly. The reason a distinguished body of numerical literature exists about near-parabolic motion is not aesthetic.
The case this repository could not draw
There is a specific and slightly embarrassing piece of evidence for all of this, and it is on this site.
The generator that draws hyperbolic orbits here computes distance against time from , in the classical way. It carries an assertion of its own — that the drawn curve’s secants agree with the radial energy equation — and at that assertion fails: the residual comes out at several per cent of the local radial speed against a two per cent tolerance. The failure was chased, two unrelated defects in the tolerance were found and fixed along the way, and the case still would not draw. It was recorded in the fleet’s consolidation notes as an open item with the cause unknown, and the note ends by guessing that the parameterisation wants the universal-variable form.
That guess was right, and the figure above is what it looks like when it is taken up. The curve there is drawn by the universal solve and checked against the classical answer at its midpoint; the two agree, and the classical form’s cancellation is measured rather than asserted — 3.3 digits of sixteen at that point, against 0.2 digits for the comfortable hyperbola beside it. Three lost digits do not stop a plot. They do stop an ephemeris that is differencing positions to get a velocity, which is what an orbit determination does at every step.
The surprising part is which direction the difficulty runs. A reader meeting the three classical forms for the first time would guess that the hard case is the extreme one — the wildly hyperbolic orbit, the nearly circular one — and that the ordinary middle of the range is safe. It is the opposite. The boundary between two well-behaved regimes is where both are worst, and it is worst there because it is a boundary: each form’s variable is defined by a construction that degenerates as the other’s takes over.
The problem where the class is not known in advance
Everything above assumes the orbit is in hand and the question is where the body will be. There is a second problem, at least as common, in which the conic class is not merely inconvenient to branch on — it is unknown until the answer is found.
Given two positions and the time to go between them, find the orbit. That is Lambert’s problem, and it is what a trajectory designer solves to connect a departure to an arrival, and what an orbit determination solves to turn two observations into a first guess.
The awkwardness is immediate. Fix the two positions and shorten the time of flight: the orbit connecting them is an ellipse, then a longer and flatter ellipse, then at one particular flight time exactly a parabola, and for anything faster a hyperbola. The conic class is a function of the input, and it is the input the designer is sweeping across — a porkchop plot is precisely a scan over departure and arrival dates, and its contours run straight through the parabolic case without pausing.
A solver built on the classical forms therefore has to guess the class before it can begin, discover it was wrong, and switch. Worse, the quantity being iterated on differs between the branches, so the switch discards the progress made. And the case where this happens is not exotic: the parabolic boundary sits in the middle of the useful region for fast transfers to the outer planets, which is exactly where the interesting trajectories are.
The universal formulation removes the question rather than answering it. The same variable , the same Stumpff functions, and one iteration that walks from the elliptical side to the hyperbolic side without any code noticing which side it is on — because passing through zero is not an event. A designer sweeping a grid of departure dates gets a surface that is smooth in the quantity being optimised, and a smooth surface is what every optimiser downstream requires.
That is the practical argument for the whole apparatus, and it is stronger than the argument from tidiness. A branch on the conic class is not merely ugly; it puts a discontinuity into the derivative of a function that something else is about to differentiate.
The gain from the change of variable is largest exactly where the ordinary variable is worst, and it is worth seeing at an eccentricity where a fixed time step is hopeless.
That is the whole of what regularisation buys, and it is an adaptive step size obtained without any adaptation. A conventional integrator with a fixed step must be sized for the fastest part of the motion and therefore wastes almost all of its work on the slow part; one with a controller re-sizes the step by measuring an error estimate and paying for the measurement. The change of variable does it by construction, because the fictitious time advances in proportion to the distance and the distance is exactly the thing that sets how fast the motion is.
The cost is that the answer arrives on the wrong axis. A solution parameterised by has to be converted back to to be useful, and that conversion is itself an equation to be solved. What makes it worthwhile is that the equation to be solved is smooth and monotonic in every regime, which is precisely what the original Kepler equation is not. The trade is therefore one awkward equation for two well-behaved ones, and it is worth taking because the awkwardness in the original is concentrated exactly where trajectories are most interesting — at close approach, at high eccentricity, near the parabolic boundary — while the awkwardness in the replacement is uniform and small.
Where the model stops
The universal formulation solves the two-body problem and nothing else. Everything it removes is a difficulty of parameterisation; nothing it removes is a difficulty of physics.
It does not help with a third body. It does not help with perturbations, which change the elements the solve is performed with. It has nothing to say about the Roche limit, tides, or radiation pressure. An orbit that is being pushed on is not a conic, and no parameterisation of conics will make it one. It also has a failure mode of its own, and it is the mirror image of the classical ones. The starting guess for is not as well understood as the starting guess for on a nearly circular orbit, where is famously good. For a strongly hyperbolic orbit far from periapsis the Newton iteration on can be slow to find its footing, and production implementations bracket it or fall back on a bisection first. The universal form removes a discontinuity and does not remove the need to think.
And there is a limit that is not numerical at all. On a hyperbola, grows without bound as the body recedes; the products that appear in the equation are then differences of large quantities, and precision has to be watched again — for a different reason, in a different regime, by a different remedy. Every parameterisation is good over some range and no parameterisation is good over all of them. What the universal variable buys is not universality in the strong sense; it is one continuous family where there were three, with the seams moved away from the place the objects actually live.
That is the whole argument for the universal formulation: not that it is faster, and not that it is more accurate, but that it removes a branch from code that has to run without supervision for decades.
What the picture cannot show
The figures here plot a radius against a time and a residual against a step. Three things they cannot carry:
The plane. Every curve is a distance from the primary, and a distance is one number. Turning it into a position needs three further angles, and the whole of the orientation problem sits outside these axes.
Which way the body is going. A radius-against-time curve is symmetric about periapsis for every conic here, so an inbound body and an outbound one give the same drawing. The distinction lives in the sign of , which no axis on this page carries.
Whether the orbit is real. The curve is drawn to eleven digits and belongs to an object whose eccentricity, if it had one, would be known to perhaps three. The figure asserts a distinction between bound and unbound that the observations behind any such orbit could not support, and the amplification of that uncertainty is the reason marginal comets are catalogued as parabolas by convention.
Where the ladder goes next
Later rungs on this anchor: the and functions, which turn a solved back into a position and velocity without ever forming the elements — the form in which the universal variable is actually used, and the reason a Lambert solver can be written in twenty lines. The Sundman transformation, of which is one case, and what regularising a collision singularity means. The Kustaanheimo–Stiefel transformation, which takes the same idea into four dimensions and makes the two-body problem into a harmonic oscillator exactly. Starting guesses, as a subject: the literature on how to begin a Newton iteration for is longer than the literature on the iteration. And the accuracy of a sequence of solves, which is where an ephemeris lives and where losing three digits per call stops being invisible.
Barker’s equation was published in 1757 and is a cubic that Cardano could have solved two centuries earlier. Kepler’s is from 1609 and has no closed form at all. That the harder-looking of the two is the special case, and the impossible-looking one the general rule, is the sort of thing a single parameterisation makes look like an accident — and a better one makes look like the two ends of a curve.
What this makes readable
Essays that name this one as a prerequisite.
- A step that must not be adapted gravitation
- The singularity that is a change of variable orbits
About the same objects
Not linked from either essay — found by the objects both name.
- The average depends on what is being averaged eccentricity · kepler's equation · semi-major axis
- Two places and a clock decide the path conic sections · kepler's equation · semi-major axis
- Wrong about where, and right about how much conditioning · kepler's equation · orbital energy
- An orbit can look exactly like a circle and still not be one eccentricity · semi-major axis
- The orbit is an ellipse, and the Sun is not in the middle of it eccentricity · semi-major axis
- The planet pays, and it shows hyperbolic orbit · orbital energy
What links here
Essays that link to this one from their own argument.
The objects this essay names
Each one links to every other essay that touches it.
Barkers equationConditioningConic sectionsEccentricityHyperbolic orbitKepler's equationNewton's methodOrbital energySemi-major axisStumpff functionsUniversal variables