# Astrodynamics/The Kepler Problem

## The Kepler Problem[edit | edit source]

The Kepler Problem is a Two-Body Problem to find the position and velocity of an orbiting body over a period of time. Given the masses, position, and velocity, or alternatively the six Keplerian orbit elements.

## Using Kepler's Orbital Elements[edit | edit source]

Given that the orbit is defined by the Semi-Major axis, , the Eccentricity, , the inclination, , the Longitude of the Ascending Node, , and the Argument of Periapsis, . It is possible to find the the position of an orbiting body at time, . The procedure is as follows:

**1. Compute the mean anomaly**

Where, is the gravitational parameter, is the time at which the orbiting body passes the periapsis. For convenience the mean anomaly can be expressed in the interval .

**2. Compute the eccentric anomaly using Kepler's equation**

While Kepler's equation is easy to solve for time, there is no general solution for the reverse problem. To determine eccentric anomaly (and thus spacecraft position) at a given time, generally an iterative numerical method is used, such as Newton's method:

Where

The iteration takes the form

For most elliptical orbits an initial guess of *E _{0}* =

*M*is sufficient; for orbits with eccentricities greater than 0.8,

*E*= π may be used. Better initial guesses are possible, but are not generally required. The iterative process is repeated until required accuracy conditions are achieved, for example:

_{0}Where is the desired accuracy.

Further, like with the mean anomaly the eccentric anomaly can be limited to the interval .

**3. Compute the true anomaly**

Note, that due to the range and domain of the tangent function and it's inverse a quadrant check is needed. If the eccentric anomaly has been limited to the interval then there is no need for a quadrant check when .

## Using Cartesian Cooridnates[edit | edit source]

From the special case of the Two-Body Problem the governing equation of the motion is shown above where is the gravitational parameter. Given an initial position vector, , and corresponding velocity vector, it is possible to solve for the future positions using numerical integration. To use ODE Runge-Kutta method the governing equation must be expressed as a system of first order ODEs as shown below. Note, that the system shown below is a scaler representation of the vectorised governing equation.

The Runge-Kutta method is an iterative semi-implicit numerical method, Many software's include this method such as MATLAB and in Python's SciPy integration method. These methods use an adaptive step where they estimate a local truncation error by using two orders of the method. For example RK45 would use the 4th and 5th orders, RK89 the 8th and 9th order. The error would be compared and checked against a user defined error and adjust the step size making it smaller or bigger depending if the error is too small or too large. A simple constant positive step size, , the 4th order Runge-Kutta method is shown below.

Let a system of ODEs be represented as shown with an initial condition.

Then the 4th order Runge-Kutta method is formulate as

Where,