PropagationParallelizer exception

Hi guys,

I’m currently trying to build a small constellation of 8 satellites and encountering an OrekitException: inconsistent dimensions: 7 != 1.

Exception in thread “main” org.orekit.errors.OrekitException: inconsistent dimensions: 7 != 1
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:424)
at org.orekit.propagation.PropagatorsParallelizer$PropagatorMonitoring.lambda$new$0(PropagatorsParallelizer.java:417)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: org.hipparchus.exception.MathIllegalArgumentException: inconsistent dimensions: 7 != 1
at org.hipparchus.ode.nonstiff.StepsizeHelper.setMainSetDimension(StepsizeHelper.java:114)
at org.hipparchus.ode.nonstiff.AdaptiveStepsizeIntegrator.sanityChecks(AdaptiveStepsizeIntegrator.java:180)
at org.hipparchus.ode.nonstiff.EmbeddedRungeKuttaIntegrator.integrate(EmbeddedRungeKuttaIntegrator.java:194)
at org.orekit.propagation.integration.AbstractIntegratedPropagator.integrateDynamics(AbstractIntegratedPropagator.java:477)
… 6 more

The error seems to come from
At first I believed it was coming from the retrieveNextParameters() method from PropagatorsParallelizer.class, but hard to understand what is badly parametrized within the scenario. I edited the script to avoid having one integrator for 7 propagators but it didn’t seem to solve the issue.

The way the constellation is built relies on an ephemeris file input from which the satellites initial statse and the related propagators are built all within a loop.
The dynamic model is unique and is set within each satellites propagator. Each integrators and propagators are satellite specific. You can find the script below and the input ephemeris file.
Could the problem be coming from the loop-fashion or the integrator settings choice ?

target_constellation.txt (1.0 KB)

// Load Orekit data
		// NOTE: orekit-data is resolved via build dependency
		File orekitData = new File("./orekit-data");
        DataProvidersManager manager = DataContext.getDefault().getDataProvidersManager();
        manager.addProvider(new DirectoryCrawler(orekitData));

        // define ellipsoid model
        TimeScale timeScale = TimeScalesFactory.getUTC();
        AbsoluteDate initialDate = new AbsoluteDate(2025, 6, 1, 00, 0, 0.0, timeScale);
        double ae = Constants.IERS2010_EARTH_EQUATORIAL_RADIUS;
        double f = Constants.IERS2010_EARTH_FLATTENING;
        IERSConventions conventions = IERSConventions.IERS_2010;
        Frame bodyFrame = FramesFactory.getITRF(conventions, false);
        OneAxisEllipsoid earthEllipsoid = new OneAxisEllipsoid(ae, f, bodyFrame);

        /** Define initial ION spacecraft state */
        double daySpan = 24*186;
        AbsoluteDate finalDate = initialDate.shiftedBy(daySpan * 3600);
        Frame inertialFrame = FramesFactory.getEME2000();
        double earthRadius = Constants.IERS2010_EARTH_EQUATORIAL_RADIUS;
        double sma = earthRadius + 600000.0;
        double ecc = 0.00001;
        double incl = 97.792;
        double raan = 0.0;
        double aop = 0.0;
        double ta = 0.0;
        double mu = Constants.IERS2010_EARTH_MU;
        KeplerianOrbit initialOrbit = new KeplerianOrbit(sma, ecc, incl, aop, raan, ta, PositionAngleType.TRUE, inertialFrame, initialDate, mu);
        SpacecraftState ionInitialState = new SpacecraftState(initialOrbit);
        double minStep = 0.01;
        double maxStep = 10;
        double[] vecAbsoluteTolerance = {1e-9};
        double [] vecRelativeTolerance = {1e-9};
        DormandPrince853Integrator integrator = new DormandPrince853Integrator(minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance);
        NumericalPropagator ionPropagator = new NumericalPropagator(integrator);
        ionPropagator.setInitialState(ionInitialState);
        ionPropagator.setMu(mu);
        double ionRadius = 2.5;
        
        // Use Holmes-Featherstone harmonic expansion for the gravitational field
        NormalizedSphericalHarmonicsProvider provider = GravityFieldFactory.getNormalizedProvider(120, 120);
        HolmesFeatherstoneAttractionModel gravityFieldModel = new HolmesFeatherstoneAttractionModel(inertialFrame, provider);
        ionPropagator.addForceModel(gravityFieldModel);

        /* Define target constellations propagators */
        Scanner scanner = new Scanner(new File("./target_constellation.txt"));
        List<Propagator> propagatorList = new ArrayList<>();
        propagatorList.add(ionPropagator);

        // retrieve target satellites initial states
        while (scanner.hasNextLine()) {
            
            // extract target spacecraft state in EME2000 frame.
            String[] rowList = scanner.nextLine().split("  ");
            double pX = Double.valueOf(rowList[0])*1e3;
            double pY = Double.valueOf(rowList[1])*1e3;
            double pZ = Double.valueOf(rowList[2])*1e3;
            double vX = Double.valueOf(rowList[3])*1e3;
            double vY = Double.valueOf(rowList[4])*1e3;
            double vZ = Double.valueOf(rowList[5])*1e3;
            Vector3D refPosition = new Vector3D(pX, pY, pZ);
            Vector3D refVelocity = new Vector3D(vX, vY, vZ);
            PVCoordinates refPvCoordinates = new PVCoordinates(refPosition, refVelocity);
            CartesianOrbit refOrbit = new CartesianOrbit(refPvCoordinates, inertialFrame, initialDate, mu);
            SpacecraftState targetInitialState = new SpacecraftState(refOrbit);

            // define target propagator
            DormandPrince853Integrator targetIntegrator = new DormandPrince853Integrator(minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance);
            NumericalPropagator targetPropagator = new NumericalPropagator(targetIntegrator);
            targetPropagator.setInitialState(targetInitialState);
            targetPropagator.setMu(mu);
            targetPropagator.addForceModel(gravityFieldModel);
            targetPropagator.setAttitudeProvider(attitudeProvider);

            propagatorList.add(targetPropagator);

        }
        scanner.close();       
        
        // propagate
        PropagatorsParallelizer propagatorsParallelizer = new PropagatorsParallelizer(propagatorList, interpolators -> {});
        List<SpacecraftState> outputStates = propagatorsParallelizer.propagate(initialDate, finalDate);

Thanks in advance for your help.

Hi @Gueorguy,

The problem is the size of vectors vecAbsoluteTolerance and vecRelativeTolerance that should be 7 (orbital tolerances (6) + mass tolerance (1)) and not 1.

To compute these vectors, there is a helper function (see this tutorial for an example):

final double[][] tolerances = NumericalPropagator.tolerances(positionTolerance, initialOrbit, propagationType);

Another option is to use an IntegratorBuilder which embeds this helper function:

final ODEIntegratorBuilder integratorBuilder = new DormandPrince853IntegratorBuilder(minStep, maxStep, positionTolerance);

Then, whenever you need a new integrator just call integratorBuilder.build().
I would tend to prefer that last version since you’re using a parallelizer: with the builder, you are guaranteed to have a new object each time you call build() and thus you naturally avoid interferences between threads.

Hope this helps,
Maxime

Hi Maxime,

Thanks for the assistance !

Have a great day.
Gueorguy