Propagate ECEF state vector in ECI

Hello,
If I have a state vector whose PVCoordinates are in ECEF, do I need to first, convert state vector position and velocity to ECI, before propagation, like this…

    public Orbit calculateOrbit(Vector3D position, Vector3D velocity, AbsoluteDate date) {       
    // Create an instance of the ITRF 2008 frame (ECEF)
    Frame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    // Create an instance of the GCRF frame (ECI)
    Frame eci = FramesFactory.getICRF();
    // All ephemeris files are in the ECI frame, no conversion is necessary.
    PVCoordinates pvCoordinatesECEF = new PVCoordinates(position, velocity);
    // Get the transform from ECEF to ECI at the target date
    Transform ecefToEci = ecef.getTransformTo(eci, date);
    // Apply the transform to the ECEF coordinates
    PVCoordinates eciPV = ecefToEci.transformPVCoordinates(pvCoordinatesECEF);
    printLLA(eciPV, eci, date); // debugging
    // Calculate and return the CartesianOrbit orbit
    return new CartesianOrbit(eciPV, FramesFactory.getICRF(), date, earth.getGM());
    }

I have tried the above code with this state vector, reminder it’s ECEF.

xPosition: 1792.0807829221583
yPosition: 6019.477079545493
zPosition: 3305.0254599404093
xVelocity: -7.3006150896850075
yVelocity: 5.557541277233861
zVelocity: 2.145598048086551
epoch: 1695837980939


The resulting values are orders of magnitude larger (E11) than I expect (E06)
PVCoordinates eciPV =

P(1.483204405825103E11, 9.411270094445953E9, 4.1158536308425627E9), V(1862.010879058158, 35482.044551869854, 13897.240596761085),
A(-1.192069211079107, 0.6612604534161253, 0.002521408236042936)

There are three different problems here:

  1. as you point out, you need to convert coordinates to an inertial frame
  2. your coordinates seem to be in kilometers and kilometers per seconds, whereas Orekit API is in SI units (i.e meters and meters per second)
  3. you define your orbit as being defined in ICRF frame, which is an inertial frame at the solar system barycenters, hence about 150 million kilometers from Earth
1 Like

Hi there,

Luc has answered you, but I would just add that if you actually try to define a CartesianOrbit in a rotating frame, you’ll get an exception.
The (Field)Orbit class assume the motion is in (un)perturbed two body problem. To relax this constraint, you can look at SpacecraftState using AbsolutePVCoordinates.

Cheers,
Romain.

1 Like

I can’t thank you enough for your help.

If my goal is to propagate in ECI would I instead use FramesFactory.getEME2000(). I have updated my transformation code like so.

    public Orbit calculateOrbit(Vector3D position, Vector3D velocity, AbsoluteDate date) {
        // Create an instance of the ITRF 2008 frame (ECEF)
        Frame ecef = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
        // Create an instance of the ECI frame.
        Frame eci = FramesFactory.getEME2000();
        // All ephemeris files are in the ECI frame, no conversion is necessary.
        PVCoordinates pvCoordinatesECEF = new PVCoordinates(position, velocity);
        // Get the transform from ECEF to ECI at the target date
        Transform ecefToEci = ecef.getTransformTo(eci, date);
        // Apply the transform to the ECEF coordinates
        PVCoordinates eciPV = ecefToEci.transformPVCoordinates(pvCoordinatesECEF);
        printLLA(eciPV, eci, date); // debugging
        // Calculate and return the CartesianOrbit orbit
        return new CartesianOrbit(eciPV, eci, date, earth.getGM());
    }

sg

I implemented all the suggestions and as I am sure you gentleman know, it fixed my problems.

Thank you,
Thank you,
Thank you.