Skip to content

Documentation / @interstellar-tools/equations / solveKeplerHyperbolic

Function: solveKeplerHyperbolic() ​

ts
function solveKeplerHyperbolic(
  Mh: number,
  e: number,
  tolerance?: number,
  maxIter?: number
): number;

Defined in: kepler/solve-kepler-hyperbolic.ts:65

Solve Kepler's equation for a hyperbola: find the hyperbolic anomaly F from the hyperbolic mean anomaly Mh.

Mh=esinh⁡F−F

solved with Newton's method:

Fn+1=Fn−esinh⁡Fn−Fn−Mhecosh⁡Fn−1,F0=min(asinh|Mh|e−1, 6|Mh|e3)

Units

  • Inputs: Mh in radians, e dimensionless.
  • Output: F in radians (dimensionless, unbounded).

Notes

  • The equation is odd in F, so the solver works on |Mh| and restores the sign. Negative values are before periapsis.
  • F0 is an upper bound on the root, since esinh⁡F−F is at least (e−1)sinh⁡F and at least (e−1)F+eF3/6. The function is increasing and convex for F>0, so Newton's method converges monotonically from there, even close to e=1 where the derivative ecosh⁡F−1 is small near periapsis.
  • Unlike an ellipse, a hyperbola isn't periodic: Mh isn't reduced to one turn.
  • solveKeplerHighEccentricity also accepts e>1, but this solver throws when it doesn't converge instead of returning its last estimate.

Parameters ​

ParameterTypeDefault valueDescription
MhnumberundefinedHyperbolic mean anomaly Mh in radians (finite).
enumberundefinedEccentricity e (finite, > 1).
tolerance?number1e-14Stop when a step is smaller than tolerance * max(1, |F|). Defaults to 1e-14.
maxIter?number50Maximum number of Newton steps. Defaults to 50.

Returns ​

number

The hyperbolic anomaly F in radians, with the sign of Mh.

Throws ​

  • If any input is not a finite number.
  • If e <= 1, tolerance <= 0 or maxIter < 1.
  • If the iteration doesn't converge within maxIter steps.

Example ​

ts
import type { Radians } from '@interstellar-tools/types';

const F = solveKeplerHyperbolic(12.66 as Radians, 1.44);
// F ≈ 3.087, and 1.44 * sinh(F) - F ≈ 12.66

See ​