# Orbit Propagator with J2 perturbation has larger error compared with simple 2 body Propagator

I have developed an orbit propagator, taking J2 perturbation into account according to the formulation as shown: with Runge-Kutta 4th order, timestep of 1 second as the integrator. Formulation as shown:

With J2 = 0.0010826, Re = 6.378137E+6 and mu = 3.986004418000000e+14.

Subsequently, I tried to compared its orbit propagation accuracy with SGP4 propagator as well as the 2 Body propagator and I found out that the position error between "SGP4" and "Orbit Propagator with J2" is much larger compared to the position error between "SGP4" and "2 Body propagator".

Some of the details of the orbit propagation simulation are:

1. TLE used for SGP4 propagator:

2. Propagation duration of 16 hours

3. As the output of SGP4 is in TEME frame, there have been converted into J2000 frame when comparing the propagation error.

4. The initial position and velocity for the "orbit propagator with J2" and the "2 Body propagator" is obtain from the initial position and velocity output of SGP4 converted to J2000 frame.

5. SGP4 is a function from Matlab Aerospace toolbox

The position error in cartesian coordinates, with respect to J2000 is as shown:

I have an impression that orbit propagation by taking J2 perturbation into account should be more accurate compared to 2 Body propagator and thus I am wondering if I have made a mistake somewhere? Or is there a possibility that introducing J2 perturbation will induce more error? Any help/advice/sharing based on your experience is much appreciated!

• Cool! Just a thought; what happens if you change the sign of your $J_2$? What is the sign of Earth's J2? You can also compare your acceleration equations to mine. The problem with gravitational potential expressions is that there can be multiplicative factor variations from one source to another that can throw monkey wrenches into calculation if one doesn't read very carefully and check intermediate steps.
– uhoh
Oct 21, 2021 at 2:54
• You haven't shown your code, so there's no way to truly tell. One thing that you might be doing wrong is your use of the J2000 frame. The ECEF frame is becoming tilted with result to J2000 due to precession and nutation. While you do not need to model the Earth's rotation when modeling Earth gravity with J2, you do need to model the Earth's precession and nutation. Oct 21, 2021 at 4:15
• @uhoh Look at the OP's equations. $J_2$ obviously has to be unitless. $J_2$ is positive, unitless, and has a value of about 10$^{-3}$, 0.0010826359 to be precise. Oct 21, 2021 at 6:24
• Thanks for your suggestion. I have added my formulation and some extra information. As I am not an expert in this field, I will take a little more time to study the modelling of Earth's precession and nutation and see if I can reduce the error. Oct 21, 2021 at 7:12
• There seems to be an error in your correction term for gravity with J2 (first Equation). The (a/r) is squared twice. Oct 21, 2021 at 9:14

Thanks everyone for your help and advice!

After some troubleshooting, I found out that the large position error of the "orbit propagator with J2 perturbation" is due to the bad initial position and velocity.

Apparently the initial position and velocity at TLE epoch time generated from the MATLAB Aerospace toolbox SGP4 is off by a few kilometres, hence the large propagation error when it is used in the "orbit propagator with J2 perturbation".

I have downloaded David Vallado's SGP4 code from here SGP4 reference code and use the initial PV generated from it for the "orbit propagator with J2 perturbation" as well as the "2Body Propagator". The position error comparison in all 3-axis is as shown:

Special thanks to Dr S.T.Goh from NUS STAR.

• Congrats, nice work!
– uhoh
Oct 22, 2021 at 10:45
• @uhoh, do we have any clue that the displayed numerical results are correct? Oct 23, 2021 at 20:17
• @NgPh As an aside, no orbit propagation is "correct", but if 2 body + J2 agrees with SGP4 for 48 hours within a few km, that's pretty darn good! TLE+SGP4 is already known to only be good to circa 2 kilometers per day (space.stackexchange.com/a/29817/12102 and space.stackexchange.com/a/29783/12102) It contains coefficients up to (I think) 6th or 8th order in gravity, but does not numerically propagate at all. Instead it just evolves the mean orbital elements. So we don't know how much of the tiny disagreement shown is due to either one.
– uhoh
Oct 23, 2021 at 22:04
• @uho, I just wanted to warn that the results are not verifiable, don't make hasty conclusions (such as J2-only matches SPG4 up to x days). Oct 23, 2021 at 22:11
• @NgPh This post was meant to find out why does the "Orbit Propagator with J2 perturbation" has larger error compared with simple "2 body Propagator" using SGP4 as a baseline. From my understanding, taking J2 perturbation into account should yield better accuracy compared to 2 body. And the answer for it was that I used an initial position and velocity that is off by a few kilometres, hence the large propagation error. The numerical accuracy of the "orbit propagator with J2 perturbation" was not discussed at all and no conclusion about the performance is even mentioned. Oct 24, 2021 at 1:01