Propagation with small perturbation far away from reality

Hello Orekit community,

I’ve been trying to do the following. Retrieve manually the state vector from a CDM at TCA and propagate it back for two days assuming a low-thrust maneuver. Then retrieve the state vector at TCA-2days and propagate it forwards with the same maneuver but this time introducing a perturbation in the thrust.

The code is the following:

position = Vector3D([initialX,initialY,initialZ])
velocity = Vector3D([initialXdot,initialYdot,initialZdot])

initialCoordinates = PVCoordinates(position, velocity)

initialOrbit = CartesianOrbit(initialCoordinates, inertialFrame, initialDate,
                              Constants.EGM96_EARTH_MU)

minStep = 0.001
maxStep = 1.0
initStep = 0.001

positionTolerance = 1.0

tolerances = NumericalPropagator.tolerances(positionTolerance,
                                            initialOrbit,
                                            initialOrbit.getType())


integrator = DormandPrince853Integrator(minStep, maxStep,
                                        JArray_double.cast_(tolerances[0]),
                                        JArray_double.cast_(tolerances[1]))

integrator.setInitialStepSize(initStep)

satelliteMass =5000.0

initialState = SpacecraftState(initialOrbit, satelliteMass)

num_propagator_maneuver = NumericalPropagator(integrator)

num_propagator_maneuver.setOrbitType(initialOrbit.getType())

isp = 2000.0
thrust = 0.0028

direction = Vector3D(0.0, 1.0, 0.0)
thruster_axis = Vector3D(0.0, 1.0, 0.0)

thrust_direction_provider = ConstantThrustDirectionProvider(direction)
thrust_direction_and_attitude_provider = ThrustDirectionAndAttitudeProvider.buildFromDirectionInLOF(
    LOFType.QSW,
    thrust_direction_provider,
    thruster_axis)


num_propagator_maneuver.setAttitudeProvider(thrust_direction_and_attitude_provider)
num_propagator_maneuver.setInitialState(initialState)

MCsamples = 100
mean, sigma = 0, 0.005
perturbation = np.random.normal(mean,sigma,MCsamples)

for i in range(MCsamples):
    perturbed_thrust = float(thrust + perturbation[i]*thrust)
    duration_low_thrust_maneuver = finalDate.durationFrom(initialDate)
    
    low_thrust_maneuver = ConstantThrustManeuver(initialDate, duration_low_thrust_maneuver, perturbed_thrust, isp, direction)
    
    num_propagator_maneuver.addForceModel(low_thrust_maneuver)
    end_state = num_propagator_maneuver.propagate(initialDate, finalDate)

The issue that I encounter is that when propagating with thrust perturbation, the X coordinate of the end state is off by a lot. It should be somewhere around -2035 km but I get values from 1600 to 2400 km. Also the Y and Z coordinates are changing but not that much. I need to correct these coordinates because I’m interested in computing the probability of collision afterwards to get some statistical data. But unfortunately only one out of 100 generates a collision with a very small PoC. Do you know what could I improve in the code or what could I do to get more or less the same position at TCA in more samples (assuming of course that the time of closest approach doesn’t change)? Thank you very much for your help.

All the best,
Razvan

Hello Razvan,

You’re adding a maneuver on each iteration without removing the previous ones.
Also you should take a look at the field version of your propagator, since it is very useful for Monte Carlo simulations.

Best regards,
Emiliano

1 Like

Thank you very much, Emiliano! Indeed, this was the problem. One question though, what do you mean when you say to take a look at the field version of my propagator?

All the best,
Razvan

Orekit’s propagators have a corresponding field version: have a look here, under the sections Field Propagation and Taylor Algebra.

Best regards,
Emiliano

Hello everyone once again,

I noticed a very strange thing, and I would like to know if I mistake on something or if it is normal. So, I propagated it forwards using as initial state the coordinates of TCA - 2 days. But, when propagating it forwards the results are not the ones in the CDM, they are off by some thousands of kilometers. Did you encounter the same strange behavior? Could you suggest me a possible solution? Thank you very much for your patience :slightly_smiling_face:

All the best,
Razvan

Hi @razvicosti,

Thousand of kilometers shouldn’t happen there must be something weird in the code. Maybe the frames are inconsistent?
Can you share some code with us?

Hello @MaximeJ ,

Sorry for the late response. I was able to debug it myself right after I asked you. My mistake was that I was backwards propagating using a for loop in which I was shifting the initial date by a certain dt to obtain a “real trajectory” at certain timestamps, but I was not aware of the behaviour of the propagator and I was forgetting to reset the initial state of the propagator to the initial state so basically the final state that I was reaching was the wrong one. After implementing this change my results are good. Thank you very much for your support :slight_smile:

All the best,
Razvan