Obtaining velocity vectors from position vectors

Hello everyone,

I am new user in the Orekit. I am trying to compare different propagators with CPF files. But i have problem to obtain velocity vectors from position vectors using CPF files. Is there any easy way to obtain these data by using Orekit?

Thanks in advance

Hi @saltinisik

Welcome to the Orekit forum!

After reading the file, you obtain a CPF object. Then you can obtain the satellite ephemeris using .getSatellites().get("satelliteId") method.
Now, I recommend you to access the BoundedPropagator related to the ephemeris using ephemeris.getPropagator() method. Thanks to that, you will have an orbit propagator (interpolator in this case) built from the ephemeris that will give you position and velocity data for the epochs you want (i.e. using getPVCoordinates(epoch) method).

Best regards,

Thanks for the quick reply @bcazabonne

Prior to your reply, I wasn’t aware of this CPF reader method; instead I was manually reading position data from a txt file (recieved from CPF file). Just to be on the same page, you are proposing to use this aforementioned method together with ephemeris.getPropagator() and with getPVCoordinates(epoch) to obtain velocity vectors, right? Isn’t this interpolator basically something like finite difference method?

Aside from the CPF reader method, can i find velocity vectors from position vectors only?

Thanks again

Yes, the actions can be done on the following order:

  1. Read the file using the CPFParser class. You will obtain a CPF object
  2. Using the CPF object, obtain the satellite ephemeris using .getSatellites().get("satelliteId")
  3. Using the ephemeris, obtain the related BoundedPropagator using ephemeris.getPropagator()

This BoundedPropagator will give you position and velocity based on the data contained in the file. Please find below a Java example:

final CPFParser parser = new CPFParser();
final CPF file = (CPF) parser.parse(new DataSource(fileName));
final CPFEphemeris ephemeris = file.getSatellites().get(satelliteId);
final BoundedPropagator propagator = ephemeris.getPropagator();
final TimeStampedPVCoordinates pv = propagator.getPVCoordinates(date, frame);
final Vector3D pos = pv.getPosition();
final Vector3D vel = pv.getVelocity();

It’s an Hermite interpolator. You can find more details in the JavaDoc of the method interpolate of the TimeStampedPVCoordinates class:

Knowing the time between two position entries you can compute the time derivatives by yourself.
However, I strongly recommend to use the methodology describe above because it will give you a more accurate computation of the velocity.

Best regards,