Astrodynamics
Calculating the orbital elements from a state vector and an instant of time.
Posts  1 - 1  of  1
Jenab6
Every possible combination of position and velocity corresponds to some sort of orbit. The orbit might terminate in a collision with another object, in an atmospheric entry, or with a change of velocity that puts it into a different orbit, but while a celestial body is moving under the influence of gravity, it's in an orbit. The position and velocity of an object, for the same moment in time, is called a "state vector."

[ x, y, z, Vx, Vy, Vz ] @ time = t

Let's assume that [x,y,z] is the heliocentric position vector whose components are given in meters, while [Vx,Vy,Vz] is the sun-relative velocity whose components are expressed in meters per second, and t is the moment of interest in Julian Date (days).

The solar gravitational parameter.
GM = 1.32712440018e20 m³ sec⁻²

The heliocentric distance, r (in meters), of the object at time = t.
r = sqrt( x² + y² + z² )

The sun-relative speed, V (in m/sec), of the object at time = t.
V = sqrt[ (Vx)² + (Vy)² + (Vz)² ]

The semimajor axis, a, of the orbit, meters.
a = 1 / { 2/r − V²/(GM) }

The angular momentum, h, per unit mass (m²/sec), in the orbit.
hx = y Vz − z Vy
hy = z Vx − x Vz
hz = x Vy − y Vx
h = sqrt[ (hx)² + (hy)² + (hz)² ]

The eccentricity, e, of the orbit.
e = sqrt[ 1 − h² / (GMa) ]

The inclination, i, of the orbit.
i = ArcCos( hz / h )

The longitude of the ascending node, Ω, of the orbit.
Ω = Arctan ( hx , −hy )

Definition of the two-argument Arctan function (result in radians).
atn(z) = single argument Arctan function of the argument z.
Function Arctan( y , x )
. if x = 0 and y > 0 then angle = +π/2
. if x = 0 and y = 0 then angle = 0
. if x = 0 and y 0 and y > 0 then angle = atn(y/x)
. if x > 0 and y 0 then sin ω'' = z / (r sin i)
ω'' = Arctan( sin ω'' , cos ω'' )
ω' = ω'' − θ
If ω' > 0 then ω = ω'
If ω' < 0 then ω = ω' + 2π

The eccentric anomaly, u, of the object in the orbit at time = t.
sin u = (r/a) sin θ / sqrt(1−e²)
cos u = (r/a) cos θ + e
u = Arctan( sin u , cos u )

The mean anomaly, m, of the object in the orbit at time = t.
m = u − e sin u
Note: u must be entered in radians, and m will return in radians.

The period of the orbit, P, days.
P = (π / 43200) sqrt[ a³/(GM) ]

The mean motion, μ, in the orbit, radians per day.
μ = 2π / P

The time of perihelion passage, T, of the object in the orbit, Julian Date.
T = t − m/μ

The Keplerian orbital elements.
[ a, e, i, Ω, ω, T ]

Jerry Abbott
Save
Cancel
Reply
 
x
OK