Failure of TLEOrbitDeterminationTest

Hi all,

I tried to run TLEOrbitDeterminationTest, but it’s failed.

Here is the wrong message, I’ve no idea what it is.

Any idea? Thanks.

java.lang.VerifyError: Inconsistent stackmap frames at branch target 156
Exception Details:
  Location:
    org/orekit/propagation/analytical/tle/TLEPartialDerivativesEquations.setInitialJacobians(Lorg/orekit/propagation/SpacecraftState;[[D[[D)Lorg/orekit/propagation/SpacecraftState; @156: aload_3
  Reason:
    Type uninitialized 135 (current frame, stack[2]) is not assignable to uninitialized 131 (stack map, stack[2])
  Current Frame:
    bci: @149
    flags: { }
    locals: { 'org/orekit/propagation/analytical/tle/TLEPartialDerivativesEquations', 'org/orekit/propagation/SpacecraftState', '[[D', '[[D', integer }
    stack: { uninitialized 131, uninitialized 131, uninitialized 135, uninitialized 135, 'org/orekit/errors/OrekitMessages', '[Ljava/lang/Object;', '[Ljava/lang/Object;', integer, '[[D' }
  Stackmap Frame:
    bci: @156
    flags: { }
    locals: { 'org/orekit/propagation/analytical/tle/TLEPartialDerivativesEquations', 'org/orekit/propagation/SpacecraftState', '[[D', '[[D', integer }
    stack: { uninitialized 131, uninitialized 131, uninitialized 131, uninitialized 131, 'org/orekit/errors/OrekitMessages', '[Ljava/lang/Object;', '[Ljava/lang/Object;', integer }
  Bytecode:
    0x0000000: 2ab7 004f 2cbe 3604 1504 1006 a000 0c15
    0x0000010: 042c 0332 be9f 0024 bb00 6359 b200 6505
    0x0000020: bd00 0359 0315 04b8 006b 5359 042c 0332
    0x0000030: beb8 006b 53b7 0071 bf2d c600 2915 042d
    0x0000040: be9f 0022 bb00 6359 b200 7405 bd00 0359
    0x0000050: 0315 04b8 006b 5359 042d beb8 006b 53b7
    0x0000060: 0071 bf2d c700 0d2a b400 15b6 0053 9a00
    0x0000070: 152d c600 462a b400 15b6 0053 2d03 32be
    0x0000080: 9f00 38bb 0063 59bb 0063 59b2 0077 05bd
    0x0000090: 0003 5903 2dc7 0007 03a7 0007 2d03 32be
    0x00000a0: b800 6b53 5904 2ab4 0015 b600 53b8 006b
    0x00000b0: 53b7 0071 b700 7abf 2a04 b500 192a b600
    0x00000c0: 7d3a 0519 05b6 0081 bc07 3a06 1905 2b2c
    0x00000d0: 2d19 06b6 0086 2b2a b400 1319 06b6 0089
    0x00000e0: b0                                     
  Stackmap Table:
    append_frame(@24,Integer)
    same_frame(@57)
    same_frame(@99)
    same_frame(@113)
    same_frame(@131)
    full_frame(@156,{Object[#1],Object[#97],Object[#81],Object[#81],Integer},{Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Object[#102],Object[#149],Object[#149],Integer})
    full_frame(@160,{Object[#1],Object[#97],Object[#81],Object[#81],Integer},{Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Uninitialized[#131],Object[#102],Object[#149],Object[#149],Integer,Integer})
    same_frame(@184)

	at org.orekit.estimation.leastsquares.TLEBatchLSModel.configureDerivatives(TLEBatchLSModel.java:68)
	at org.orekit.estimation.leastsquares.TLEBatchLSModel.configureDerivatives(TLEBatchLSModel.java:1)
	at org.orekit.estimation.leastsquares.AbstractBatchLSModel.value(AbstractBatchLSModel.java:252)
	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.LevenbergMarquardtOptimizer.optimize(LevenbergMarquardtOptimizer.java:333)
	at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(BatchLSEstimator.java:435)
	at org.orekit.estimation.common.AbstractOrbitDetermination.runBLS(AbstractOrbitDetermination.java:429)
	at org.orekit.estimation.leastsquares.TLEOrbitDeterminationTest.testGNSS(TLEOrbitDeterminationTest.java:197)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:542)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:770)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

Hi @lirw1984,

I remember having this kind of issue with a former version of Eclipse (on another test though, but also linked to the PartialDerivativesEquation class).
I think upgrading Eclipse (I use version 2020-06 for now) could remove the problem (but, unfortunately, I didn’t find the cause of the problem at that time…)
What are your OS and IDE ?

Thanks @MaximeJ for your reply.

OS: ubuntu 18.04 LTS
IDE: eclipse Version: 2019-12 (4.14.0)

I’ll try to update eclipse.

I updated IDE, it works. Thanks @MaximeJ again.

Here is the current IDE info.
Eclipse IDE for Java Developers (includes Incubating components)
Version: 2021-09 (4.21.0)
Build id: 20210910-1417
OS: Linux, v.5.4.0-90-generic, x86_64 / gtk 3.22.30, WebKit 2.32.4
Java vendor: Ubuntu
Java runtime version: 11.0.11+9-Ubuntu-0ubuntu2.18.04
Java version: 11.0.11

Another thing comes.

The STATE_DIMENSION of TLEJacobiansMapper is 6, so BStar can not be estimated. What should I do if I want to estimate BStar?

Hi @lirw1984 and @MaximeJ,

The STATE_DIMENSION parameter corresponds to the number of estimated orbital parameters (i.e., cartesian elements of the orbit, or the orbital set). By default, all the orbital parameters are estimated. That’s why the STATE_DIMENSION is equal to 6.
In addition, all the propagation (or dynamical) parameters are not estimated. The user must specify the ones he/she wants to estimate. If you are using the TLEOrbitDeterminationTest, you can just replace the following lines

    // initiate TLE (from Celestrak)
    final String line1 = "1 32711U 08012A   16044.40566026 -.00000039  00000-0  00000+0 0  9991";
    final String line2 = "2 32711  55.4362 301.3402 0091577 207.7302 151.8353  2.00563580 58013";
    templateTLE = new TLE(line1, line2);
    templateTLE.getParametersDrivers().get(0).setSelected(false);

by

    // initiate TLE (from Celestrak)
    final String line1 = "1 32711U 08012A   16044.40566026 -.00000039  00000-0  00000+0 0  9991";
    final String line2 = "2 32711  55.4362 301.3402 0091577 207.7302 151.8353  2.00563580 58013";
    templateTLE = new TLE(line1, line2);
    templateTLE.getParametersDrivers().get(0).setSelected(true);

Best regards,
Bryan

Hi @bcazabonne,

I tried that, setting the 0-th ParametersDriver of TLE, that is BStar.
There is something wrong. So I thought the dimension is not right.

Here is the trace info.

java.lang.ArrayIndexOutOfBoundsException: 6
	at org.orekit.propagation.analytical.tle.TLEJacobiansMapper.analyticalDerivatives(TLEJacobiansMapper.java:178)
	at org.orekit.estimation.leastsquares.AbstractBatchLSModel.fetchEvaluatedMeasurement(AbstractBatchLSModel.java:390)
	at org.orekit.estimation.leastsquares.MeasurementHandler.handleStep(MeasurementHandler.java:94)
	at org.orekit.propagation.PropagatorsParallelizer$SinglePropagatorHandler.handleStep(PropagatorsParallelizer.java:259)
	at org.orekit.propagation.sampling.StepHandlerMultiplexer.handleStep(StepHandlerMultiplexer.java:184)
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(AbstractAnalyticalPropagator.java:320)
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(AbstractAnalyticalPropagator.java:147)
	at org.orekit.propagation.PropagatorsParallelizer.propagate(PropagatorsParallelizer.java:141)
	at org.orekit.estimation.leastsquares.AbstractBatchLSModel.value(AbstractBatchLSModel.java:273)
	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.estimation.common.AbstractOrbitDetermination.runBLS(AbstractOrbitDetermination.java:429)
	at org.orekit.estimation.leastsquares.TLEOrbitDeterminationTest.testLageos2(TLEOrbitDeterminationTest.java:238)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:529)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:756)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)

Congratulations, you found a bug :slight_smile:

Could you open an issue in our Gitlab repository?

The bug occurs in the in the configureDerivatives method of TLEBatchLSModel.

    final String equationName = TLEBatchLSModel.class.getName() + "-derivatives";

    final TLEPartialDerivativesEquations partials = new TLEPartialDerivativesEquations(equationName, (TLEPropagator) propagator);

    // add the derivatives to the initial state
    final SpacecraftState rawState = propagator.getInitialState();
    final SpacecraftState stateWithDerivatives = partials.setInitialJacobians(rawState);
    propagator.resetInitialState(stateWithDerivatives);

    return partials.getMapper();

The number of estimated parameters switch from 7 to 6 when calling the propagator.resetInitialState(stateWithDerivatives) method. Please find below the implementation of the resetInitialState() method of the TLEPropagator.

    super.resetInitialState(state);
    super.setStartDate(state.getDate());
    final TLE newTLE = TLE.stateToTLE(state, tle, utc, teme);
    this.tle = newTLE;
    initializeCommons();
    sxpInitialize();

If the the bStart parameter is estimated, when calculating the new TLE corresponding to the input state (i.e., newTLE parameter), the bStar parameter is not estimated for the newTLE. And this is a bug. There is a missing step between “final TLE newTLE = TLE.stateToTLE(state, tle, utc, teme);” and “this.tle = newTLE;” that must verify if bStar is estimated and set it to estimated for the new TLE.

Best regards,
Bryan

Hi Bryan,

WoW! Thank you so much. It works now.

Please help me to create an issue. I am still learning how to work with gitlab.

PS.
While I fill the result is a little wired, the estimated BStar is 1.2106, too large. I will do a little more test.

1 22195U 92070B   16045.51027931 -.00000009  00000-0  12106+1 0  9991
2 22195  52.6501 132.9152 0137743 336.2640   1.6414  6.47294996551195

To open an issue, you can follow exactly what you did for the Orekit tutorials. That was perfect. However, in the current case, you have to create the issue in the Orekit repository instead of the Tutorials repository. In addition, in the description of the issue, you can do a reference to the current forum discussion. It will help to fix the issue.

Yes, we did some test last year about bStar estimation. Unfortunately, results were not very good. To my mind the dynamical incertitudes of the TLE orbit propagator (which is not a precise orbit propagation method) are “absorbed” by the bStar parameter when it is estimated. That’s why the value is to large.