Skip to content

Keplerian Orbital Elements

kepler

Represent Keplerian element sets and convert between cartesian

Notes: * This class is used to represent Keplerian elements and convert between Cartesian coordinates * The class uses the semi-major axis (a), not the semiparameter * All angle units are radians * All length units are meters * All velocity units are meters / second

mean_motion property

Mean motion, radians / second

true_anomaly property

True anomaly, radians

eccentric_anomaly property writable

Eccentric anomaly, radians

mean_anomaly property writable

Mean anomaly, radians

period property

Orbital period, seconds

a property writable

Semi-major axis, meters

eccen property writable

Eccentricity, unitless

inclination property writable

Inclination, radians

raan property writable

Right ascension of ascending node, radians

nu property writable

True anomaly, radians

w property writable

Argument of perigee, radians

__init__(a, e, i, raan, argp, nu=..., *, true_anomaly=..., mean_anomaly=..., eccentric_anomaly=...)

Create Keplerian element set object from input elements

Parameters:

Name Type Description Default
a float

Semi-major axis, meters

required
e float

Eccentricity, unitless

required
i float

Inclination, radians

required
raan float

Right ascension of ascending node, radians

required
argp float

Argument of perigee, radians

required
nu float

True anomaly, radians

...
true_anomaly float

True anomaly, radians (keyword alternative to nu)

...
mean_anomaly float

Mean anomaly, radians (keyword alternative to nu)

...
eccentric_anomaly float

Eccentric anomaly, radians (keyword alternative to nu)

...
Notes

If "nu" is provided (6th argument), it will be used as the true anomaly. Anomaly may also be set via keyword arguments; if so, there should only be 5 positional input arguments.

Example
import math

# Create a ~400 km circular LEO orbit
k = satkit.kepler(
    a=6.781e6,        # semi-major axis, meters
    e=0.001,          # near-circular
    i=math.radians(51.6),
    raan=math.radians(0),
    argp=math.radians(0),
    nu=math.radians(0),
)

to_pv()

Convert Keplerian element set to position and velocity vectors

Returns:

Type Description
tuple[NDArray[float64], NDArray[float64]]

tuple[npt.ArrayLike[np.float64], npt.ArrayLike[np.float64]]: Tuple with two elements representing the position and velocity vectors

Example
pos, vel = k.to_pv()
print(f"Position: {pos} m")
print(f"Velocity: {vel} m/s")

propagate(dt)

Propagate Keplerian element set by input duration

Parameters:

Name Type Description Default
dt duration | float

Duration by which to propagate the Keplerian element set If float, value is seconds

required

Returns:

Type Description
kepler

satkit.kepler: Keplerian element set object after propagation

Example
# Propagate orbit by one orbital period
k2 = k.propagate(k.period)

from_pv(pos, vel) staticmethod

Create Keplerian element set from input position and velocity vectors

Parameters:

Name Type Description Default
pos NDArray[float64]

3-element array representing position vector

required
vel NDArray[float64]

3-element array representing velocity vector

required

Returns:

Type Description
kepler

Keplerian element set object

Example
import numpy as np
pos = np.array([6.781e6, 0, 0])  # meters, GCRF
vel = np.array([0, 7.5e3, 0])    # m/s, GCRF
k = satkit.kepler.from_pv(pos, vel)
print(f"Semi-major axis: {k.a/1e3:.1f} km")
print(f"Eccentricity: {k.e:.6f}")