Hello everyone, I have recently been trying to implement an orbit prediction algorithm using the SequentialBatchLeastSquares example from Orekit. Currently, I have GPS data for the satellite

gps-02280302 (114.5 KB)

, but during the process, the following exception was thrown.There are some outlier points in the data, for example, having the same PV value at different times. I am sure that these points have been filtered out, but the problem still persists. Please help me to confirm the issue. Also, if you have any suggestions on using GPS data for orbit extrapolation, please let me know. Thank you very much.

```
Exception in thread "main" org.orekit.errors.OrekitException: NaN appears during integration near time NaN
at org.orekit.errors.OrekitException.unwrap(OrekitException.java:154)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:511)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:408)
at org.orekit.propagation.PropagatorsParallelizer.propagate(PropagatorsParallelizer.java:140)
at org.orekit.estimation.leastsquares.AbstractBatchLSModel.value(AbstractBatchLSModel.java:319)
at org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory$LocalLeastSquaresProblem.evaluate(LeastSquaresFactory.java:440)
at org.orekit.estimation.leastsquares.BatchLSEstimator$TappedLSProblem.evaluate(BatchLSEstimator.java:615)
at org.hipparchus.optim.nonlinear.vector.leastsquares.GaussNewtonOptimizer.optimize(GaussNewtonOptimizer.java:163)
at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(BatchLSEstimator.java:435)
at org.orekit.tutorials.test.SequentialBatchLeastSquaresTest.run(SequentialBatchLeastSquaresTest.java:209)
at org.orekit.tutorials.test.SequentialBatchLeastSquaresTest.main(SequentialBatchLeastSquaresTest.java:157)
Caused by: org.hipparchus.exception.MathIllegalStateException: NaN appears during integration near time NaN
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:269)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:477)
```

Hi @toonaiveckuu

Welcome to the Orekit forum!

What is the frame of your measurements?

It is important that the frame used to use the same frame between the measurement and the orbit propagator used for estimation.

Also, what is the time scale used for the epochs in the file?

If you can’t solve the issue based on the two previous questions, could you provide a sample of code to check what could be wrong?

Best regards,

Bryan

1 Like

Thank you for your reply. I found the reason for the exception ‘NaN appears during integration near time NaN.’ It was because I set the weight of the measurement values incorrectly.

However, after running the code, the deviation between the result and the measured values is very large. I used the SequentialBatchLeastSquares example in orekit-tutorials-11.3, and changed the type of Measurements to PV.

frame of measurements is EME2000

The following is the code.

pvData satellite and weights are configured in a YAML file.

```
# Measurements definition
measurements:
measurementFiles: [ "gps-02280302.txt","gps-0228.txt" ]
position:
sigmaPos: 10.0
weight: 1.0
pv:
sigmaPos: 10.0
sigmaVel: 1.0
weight: 1.0
```

This is the result and code

this is the config file

```
durationInDays: 7.0
outputStep: 300.0
orbitDetermination:
# Orbit definition (position in meters, velocity in meter per seconds, angles in degrees, date in ISO 8601)
orbit:
date: "2023-02-28T12:19:12.000"
frameName: "EME2000"
orbitType:
name: "CARTESIAN"
cartesian:
x: -4519721.5
y: 3015117.9
z: 4136884.9
vx: 4712.32
vy: -1191.83
vz: 5998.61
# Spacecraft definition (mass in kilogrammes)
spacecraft:
name: "QL1"
id: "1992-070A"
mass: 192
# Propagator definition
propagator:
# Numerical integrator (fixed step (s) and position error (m))
integrator:
minStep: 0.001
maxStep: 300.0
positionError: 100.0
# Force models used by the propagator (only the ones used !!!)
forceModels:
# Central body gravity
gravity:
degree: 20
order: 20
# 3rd body attraction
thirdBody:
- name: "Sun"
withSolidTides: false
- name: "Moon"
withSolidTides: false
# Post-Newtonian correction force due to general relativity ("isUsed: true" to not have an empty value)
relativity:
isUsed: true
# Body definition (default is a WGS-84 ellipsoid with IERS-2010 conventions and simple EOP frame)
body:
iersConventionYear: 2010
frameName: "CIO/2010-based ITRF simple EOP"
equatorialRadius: 6378137.0
inverseFlattening: 298.257223563
# Measurements definition
measurements:
# BE CAREFUL: With the current implementation of the tutorial, measurement files must be chronologically ordered
measurementFiles: [ "gps-0228.txt","gps-0228.txt" ]
position:
sigmaPos: 10.0
weight: 1.0
pv:
sigmaPos: 10.0
sigmaVel: 1.0
weight: 1.0
# Estimator definition
estimator:
orbitalParametersPositionScale: 100.0
# Levenberg-Marquardt or a Gauss-Newton
optimizationEngine:
# levenbergMarquardt or gaussNewton
levenbergMarquardt:
initialStep: 1.0e6
maxIterations: 100
maxEvaluations: 100
convergenceThreshold: 1.0e-3
```

Could you try using NumericalOrbitDetermination tutorial?

Before running it, could you:

- Remove one of the two file in the following line:
`measurementFiles: [ "gps-0228.txt","gps-0228.txt" ]`

- Reduce the velocity sigma from 1.0 m/s to 0.01 m/s

If you still have issues, next steps are, I think, to investigate the frame and the time scale used in the measurement file.

Bryan

Thank you for your reply. I will try it out and get back to you.