Dear Orekit Users,
I am using DSSTPropagator to propagate object for a distant time in a future.
The DSSTTesseral force model is crashing with null pointer exception. It is setup as in Orekit’s DSSTTesseralTest class.
The problem seems to be that hansenObjects[rows][columns] is not intialized. When HansenObjects.computeHansenObjectsInitValues(*) method is called, the array return null value.
Why the array is not initialized?
The resonant orders are defining the size and initialization for an hansenObjects array. These orders are computed in DSSTTesseralContext. In its constructor, the ratio of object’s Keplerian period and central body rotation period is used to find resonance in tesseral harmonic field.
When they are not found, the list of orders is empty, then the array is not initialized, and null pointer exception occurs. Also even when some are found (I have tried to increase order of harmonics provider) still some elements of hansenObjects are not initialized and NullException occurs, but later during propagation.
To reproduce, please use following files that I am attaching.
DSSTForcesFactory.java (10.9 KB) DSSTPropTest.java (4.4 KB)
The error:
java.lang.NullPointerException
at org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral$HansenObjects.computeHansenObjectsInitValues(DSSTTesseral.java:2769)
at org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral$UAnddU.(DSSTTesseral.java:2349)
at org.orekit.propagation.semianalytical.dsst.forces.DSSTTesseral.getMeanElementRate(DSSTTesseral.java:409)
at org.orekit.propagation.semianalytical.dsst.DSSTPropagator$Main.elementRates(DSSTPropagator.java:933)
at org.orekit.propagation.semianalytical.dsst.DSSTPropagator$Main.computeDerivatives(DSSTPropagator.java:912)
at org.orekit.propagation.integration.AbstractIntegratedPropagator$ConvertedMainStateEquations.computeDerivatives(AbstractIntegratedPropagator.java:675)
at org.hipparchus.ode.ExpandableODE.computeDerivatives(ExpandableODE.java:134)
at org.hipparchus.ode.AbstractIntegrator.computeDerivatives(AbstractIntegrator.java:265)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:257)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:466)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:414)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.propagate(AbstractIntegratedPropagator.java:397)
at utils.DSSTPropTest.test(DSSTPropTest.java:113)
Thanks for any tips in advance.
Regards,