mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Utilities for solving the Kepler problem.
Functions | |
template<typename realT > | |
long | mx::astro::hyperbolic_kepler (realT &E, realT &err, realT e, realT M, realT tol, long itmax) |
Solve the hyperbolic kepler equation (for e> 1). More... | |
template<typename realT > | |
realT | mx::astro::kepler_danby_1 (realT e, realT M, realT Ei) |
Calculate the next iteration of Danby's quartic Newton-Raphson method. More... | |
template<typename realT > | |
long | mx::astro::solve_kepler_danby (realT &E, realT &D, realT e, realT M, realT tol, long itmax) |
Solve Kepler's equation using Danby's quartic Newton-Raphson method. More... | |
template<typename realT > | |
long | mx::astro::solve_kepler (realT &E, realT &D, realT e, realT M, realT tol=KEPLER_TOL, long itmax=KEPLER_ITMAX) |
Solve Kepler's equation for any e. Uses solve_kepler_danby if e < 1.0, hyperbolic_kepler otherwise. More... | |
long mx::astro::hyperbolic_kepler | ( | realT & | E, |
realT & | err, | ||
realT | e, | ||
realT | M, | ||
realT | tol, | ||
long | itmax | ||
) |
Solve the hyperbolic kepler equation (for e> 1).
realT | is the type used for arithmetic |
[out] | E | is the eccentric anomaly |
[out] | err | is the error after the last iteration |
[in] | e | is the eccentricity |
[in] | M | is the mean anomaly |
[in] | tol | is the desired tolerance |
[in] | itmax | is the maximum number of iterations |
Definition at line 50 of file kepler.hpp.
Referenced by mx::astro::solve_kepler().
realT mx::astro::kepler_danby_1 | ( | realT | e, |
realT | M, | ||
realT | Ei | ||
) |
Calculate the next iteration of Danby's quartic Newton-Raphson method.
Definition at line 89 of file kepler.hpp.
Referenced by mx::astro::solve_kepler_danby().
long mx::astro::solve_kepler | ( | realT & | E, |
realT & | D, | ||
realT | e, | ||
realT | M, | ||
realT | tol = KEPLER_TOL , |
||
long | itmax = KEPLER_ITMAX |
||
) |
Solve Kepler's equation for any e. Uses solve_kepler_danby if e < 1.0, hyperbolic_kepler otherwise.
[out] | E | is the eccentric anomaly |
[out] | D | is the error after the last iteration |
[in] | e | is the eccentricity |
[in] | M | is the mean anomaly |
[in] | tol | is the desired tolerance |
[in] | itmax | is the maximum number of iterations |
Definition at line 161 of file kepler.hpp.
References mx::astro::hyperbolic_kepler(), and mx::astro::solve_kepler_danby().
Referenced by mx::astro::orbitElements().
long mx::astro::solve_kepler_danby | ( | realT & | E, |
realT & | D, | ||
realT | e, | ||
realT | M, | ||
realT | tol, | ||
long | itmax | ||
) |
Solve Kepler's equation using Danby's quartic Newton-Raphson method.
[out] | E | is the eccentric anomaly |
[out] | D | is the error after the last iteration |
[in] | e | is the eccentricity |
[in] | M | is the mean anomaly |
[in] | tol | is the desired tolerance |
[in] | itmax | is the maximum number of iterations |
Definition at line 119 of file kepler.hpp.
References mx::astro::kepler_danby_1(), and mx::math::func::sign().
Referenced by mx::astro::solve_kepler().