AstrodynamicsUtilities

Documentation for AstrodynamicsUtilities.

API

State Representations

AstrodynamicsUtilities.transformMethod
function transform(old::CartesianState{TP}, new::KeplerianState{Nothing}) where TP<:AbstractVector

Transforms an inertial Cartesian state to an inertial Keplerian state. Uses the 'rv2coe' algorithm from Fundamentals of Astro. Vallado (2001).

Inputs:

old: Cartesian state vector container
new_type: Flag to define what type to transform to. This method is to transform to KeplerianState().
mu: gravitational parameter of central body (e.g., 398600.4418) for Earth in km^3/s^2

Returns:

KeplerianState(vec): Keplerian container with transformed vec
source
AstrodynamicsUtilities.transformMethod
function transform(old::KeplerianState{TP}, new_type::CartesianState{Nothing}, mu) where TP<:AbstractVector

Transforms an inertial keplerian state to an inertial ceplerian state. Uses the 'coe2rv' algorithm from Fundamentals of Astro. Vallado (2001).

Inputs:

old: keplerian state vector container
new_type: Flag to define what type to transform to. This method is to transform to CartesianState().
mu: gravitational parameter of central body (e.g., 398600.4418) for Earth in km^3/s^2

Returns:

KeplerianState(vec): Keplerian container with transformed vec
source

Private Functions

AstrodynamicsUtilities.rv2coeFunction
rv2coe(r, v, mu)

Calculate the 6 classical keplerian orbital elements from r, v, mu (under the two body problem)

Inputs:

r: inertial position vector (km)
v: inertial velocity vector (km/s)
mu: gravitational parameter of central body (km^3/s^2)

returns:

coe: vector of 6 Keplerian elements, which are:

    a: semi major axis (km)
    e: eccentricity
    inc: inclination (radians)
    RAAN: right-ascension (radians)
    argPer: argument of perigee (radians)
    trueAnom: true anomaly (radians)
source
AstrodynamicsUtilities.coe2rvFunction

coe2rv: Calculate the inertial position and velocity vectors from Keplerian classical orbital elements.

Inputs:

`vec`: 6-element vector containing:
    a: semi major axis (km)
    e: eccentricity
    inc: inclination (radians)
    RAAN: right-ascension (radians)
    w: argument of perigee (radians)
    trueAnom: true anomaly (radians)
`mu`: gravitational parameter of central body (km^3/s^2)

Returns:

`rv`: 6-element vector of position and velocity
source