Sprocket shaped propagation

Orbital neophyte here,

I am propagating from a PV pair time. Something about my propagation configuration produces a really strange path that looks like this, where the vector must emanate from the Earth’s center:

It’s a very simplistic program producing the ephemeris. The code puts the PV values in a file (output.txt) along with the index. The position vector just got up/down over and over, just like the picture shows.

How can that even happen?

Thank you for your time.

package com.leidos.smac.data.orbit;

import org.hipparchus.geometry.euclidean.threed.Vector3D;
import org.orekit.bodies.*;
import org.orekit.data.*;
import org.orekit.frames.*;
import org.orekit.orbits.*;
import org.orekit.propagation.*;
import org.orekit.propagation.analytical.KeplerianPropagator;
import org.orekit.propagation.analytical.tle.*;
import org.orekit.time.*;
import org.orekit.utils.*;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;

public class Scratch 
    public static void main(String[] args)  {
        // Orekit setup data
        File orekitData = new File("src/main/resources/orekit_data");
        DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
        manager.addProvider(new DirectoryCrawler(orekitData));
        try {

            AbsoluteDate epoch = new AbsoluteDate(2023, 9, 27, 18, 0, 0.000000, TimeScalesFactory.getUTC());

            double mu =  3.986004415e+14;
            Frame inertialFrame = FramesFactory.getICRF();

            PVCoordinates pvCoordinates = new PVCoordinates(
                    new Vector3D(5.3562909436536320e+06, 1.7374822680742762e+06, 2.9890671950189904e+06),
                    new Vector3D(-1.1435433282106951e+02, 3.9408793506464212e+02, 7.2068475671536287e+00)

            CartesianOrbit initialOrbit = new CartesianOrbit(pvCoordinates, inertialFrame, epoch, mu);

            KeplerianPropagator propagator = new KeplerianPropagator(initialOrbit);

            try (BufferedWriter writer = new BufferedWriter(new FileWriter("output.txt"))) {
                for (int i = 0; i <= 31141; i++) {
                    AbsoluteDate targetDate = epoch.shiftedBy(i);
                    SpacecraftState state = propagator.propagate(targetDate);
                    PVCoordinates pv = state.getPVCoordinates();
                    writer.write(String.format("%.16e  %.16e  %.16e  %.16e  %.16e  %.16e  %.16e%n",
                            (double) i,
            } catch (IOException e) {
                System.out.println("Error writing to file: " + e.getMessage());

            System.out.println("Done." );
        } catch (Exception e) {

Hi there,

Your orbital speed is way below the km/s mark. Did you forget converting to SI units? That’s the system used by Orekit.


Thank you Serrof,
I think I do have my units correct. I tried multiplying my PV x/y/z values by 1000 which was interesting because the most noticeable change was:

  • my position.x value starts at 5.3562909436536320e+09, then constantly decrements until 1.7951806286525593e+09. So it gets rid of the up/down nature it had?
  • the velocity vector has negative values for x/y/z almost constantly.

Things go negative just after the 3rd position is propagated? How did you determine the orbital speed, was it just looking at the velocity vector values?


Running your program, I get a proper trajectory (see attached file truncated to the first few thousand lines).
output.txt (431.2 KB).

Thank you Mr. Maisonobem,
I appreciate you taking the time Sir. My problem must be my inability to interpret my own results. I have an STK (Analytical Graphics’ Satellite Tool Kit ) Ephemeris file that I can draw in my application. It goes out to the geosynchronous belt and back to Earth.

I copied the epoch and initial PV vectors from the STK ephemeris file to propagate it, thinking I would get something very similar to the original STK track. However, it doesn’t look very similar.

Is that bone-headed of me to think I should get similar results from just a PV pair and a time?

Thanks to all for your time.

I don’t really know what happens. From the sample output file attached in the previous message, I just used gnuplot to display the positions: using this command line:

gnuplot -e "set terminal pngcairo size 1000,1000 ; set output 'output.png' ; set view 40,20 ; splot 'output.txt' using 2:3:4 with lines"

It gave the following plot:

Just a wild guess: may be you are drawing alternatively position vector and velocity vector instead of the position only?