J2 Perturbation¶
Earth is slightly wider at the equator than at the poles. Its gravity therefore differs from the gravity of a perfect sphere. The largest correction is called \(J_2\); it slowly turns the orbital plane of an inclined spacecraft.
This example starts at about 500 km altitude and propagates the same orbit for
two days with three gravity models. zonal_J=0 uses two-body gravity,
zonal_J=2 includes J2, and zonal_J=6 includes J2 through J6.
Increasing the degree adds terms to Earth’s gravity model; it does not
multiply the J2 coefficient.
"""Compare two-body, J2, and higher-zonal orbit propagation."""
import matplotlib.pyplot as plt
import numpy as np
import ADCS
from ADCS.orbits.orbit import Orbit
from ADCS.orbits.universal_constants import TimeConstants
orbit_start = ADCS.Orbital_State(
ephem=ADCS.Ephemeris(), J2000=0.22,
R=np.array([6878.0, 0.0, 0.0]),
V=np.array([0.0, 4.9, 5.8]),
)
for degree in (0, 2, 6):
orbit = Orbit(
os0=orbit_start,
end_time=orbit_start.J2000 + 2 * 86400 * TimeConstants.sec2cent,
dt=60.0, zonal_J=degree, verbose=False,
)
run = ADCS.RunResults(satellite=None, os_hist=list(orbit.states.values()))
ADCS.plot(run, ADCS.plots.OrbitPlot(), layout=(1, 1),
title=f"Orbit with zonal_J={degree}")
plt.show()
Set the gravity model
Set zonal_J when creating the orbit propagator. A value of 2 includes
J2; 0 disables zonal terms, and 6 includes J2 through J6.
orbit = Orbit(os0=orbit_start, end_time=end_time, dt=60.0, zonal_J=2)
The orbit plot shows the path in an Earth-centred inertial frame. Over two days, J2 produces the main change in the orbital plane; the additional terms make much smaller changes.
Effect on Keplerian elements
For an inclined orbit, J2 causes the ascending node \(\Omega\) and argument of perigee \(\omega\) to drift over time. In the averaged J2 model, the semi-major axis \(a\), eccentricity \(e\), and inclination \(i\) stay approximately constant; in a propagated orbit they show small periodic variations. The mean anomaly also advances at a slightly changed rate.