In orbital mechanics, the universal variable formulation is a method used to solve the two-body Kepler problem. It is a generalized form of Kepler's Equation, extending it to apply not only to elliptic orbits, but also parabolic and hyperbolic orbits common for spacecraft departing from a planetary orbit. It is also applicable to ejection of small bodies in Solar System from the vicinity of massive planets, during which processes the approximating two-body orbits can have widely varying eccentricities, almost always e ≥ 1 .
Introduction
A common problem in orbital mechanics is the following: Given a body in an orbit and a fixed original time
find the position of the body at some later time
For elliptical orbits with a reasonably small eccentricity, solving Kepler's Equation by methods like Newton's method gives excellent results. However, as the orbit approaches an escape trajectory, it becomes more and more eccentric, convergence of numerical iteration may become unusably sluggish, or fail to converge at all for e ≥ 1 .[1][2]
Note that the conventional form of Kepler's equation cannot be applied to parabolic and hyperbolic orbits without special adaptions, to accommodate imaginary numbers, since its ordinary form is specifically tailored to sines and cosines; escape trajectories instead use sinh and cosh (hyperbolic functions).
Derivation
Although equations similar to Kepler's equation can be derived for parabolic and hyperbolic orbits, it is more convenient to introduce a new independent variable to take the place of the eccentric anomaly
and having a single equation that can be solved regardless of the eccentricity of the orbit. The new variable
is defined by the following differential equation:

- where
is the time-dependent scalar distance to the center of attraction.
(In all of the following formulas, carefully note the distinction between scalars
in italics, and vectors
in upright bold.)
We can regularize the fundamental equation

- where
is the system gravitational scaling constant,
by applying the change of variable from time
to
which yields[2]

where
is some t.b.d. constant vector and :
is the orbital energy, defined by

The equation is the same as the equation for the harmonic oscillator, a well-known equation in both physics and mathematics, however, the unknown constant vector is somewhat inconvenient. Taking the derivative again, we eliminate the constant vector
at the price of getting a third-degree differential equation:

The family of solutions to this differential equation[2] are for convenience written symbolically in terms of the three functions
and
where the functions
called Stumpff functions, which are truncated generalizations of sine and cosine series. The change-of-variable equation
gives the scalar integral equation

After extensive algebra and back-substitutions, its solution results in[2]: Eq. 6.9.26

which is the universal variable formulation of Kepler's equation.
There is no closed analytic solution, but this universal variable form of Kepler's equation can be solved numerically for
using a root-finding algorithm such as Newton's method or Laguerre's method for a given time
The value of
so-obtained is then used in turn to compute the
and
functions and the
and
functions needed to find the current position and velocity:
![{\displaystyle {\begin{aligned}\ f(s)&=1-\left({\frac {\ \mu \ }{~r_{\mathsf {o}}\ }}\right)s^{2}c_{2}\!\!\left(\ \alpha s^{2}\ \right)\ ,\\[1.5ex]\ g(s)&=t-t_{\mathsf {o}}-\mu \ s^{3}c_{3}\!\!\left(\ \alpha s^{2}\ \right)\ ,\\[1.5ex]\ {\dot {f}}(s)\equiv {\frac {\ \operatorname {d} f\ }{\ \operatorname {d} t\ }}&=-\left({\frac {\ \mu \ }{\ r_{\mathsf {o}}r\ }}\right)s\ c_{1}\!\!\left(\ \alpha s^{2}\ \right)\ ,\\[1.5ex]\ {\dot {g}}(s)\equiv {\frac {\ \operatorname {d} g\ }{\ \operatorname {d} t\ }}&=1-\left({\frac {\ \mu \ }{r}}\right)\ s^{2}c_{2}\!\!\left(\ \alpha s^{2}\ \right)~.\\[-1ex]\end{aligned}}}](./78cb59f8aa785c6be9a5b065d779215fd7fe1dd0.svg)
The values of the
and
functions determine the position of the body at the time
:
In addition the velocity of the body at time
can be found using
and
as follows:

- where
and
are respectively the position and velocity vectors at time
and
and
are the position and velocity at arbitrary initial time 
References
- ^
Stiefel, Eduard L.; Scheifele, Gerhard (1971). Linear and Regular Celestial Mechanics: Perturbed two-body motion, numerical methods, canonical theory. Springer-Verlag.
- ^ a b c d
Danby, J.M.A. (1988). Fundamentals of Celestial Mechanics (2nd ed.). Willmann-Bell. ISBN 0943396204.