public void handleStep(StepInterpolator interpolator, boolean isLast) throws MaxCountExceededException { ++nbSteps; for (int a = 1; a < 10; ++a) { double prev = interpolator.getPreviousTime(); double curr = interpolator.getCurrentTime(); double interp = ((10 - a) * prev + a * curr) / 10; interpolator.setInterpolatedTime(interp); double[] interpolatedY = interpolator.getInterpolatedState(); double[] theoreticalY = pb.computeTheoreticalState(interpolator.getInterpolatedTime()); double dx = interpolatedY[0] - theoreticalY[0]; double dy = interpolatedY[1] - theoreticalY[1]; double error = dx * dx + dy * dy; if (error > maxError) { maxError = error; } } if (isLast) { Assert.assertTrue(maxError < 2.4e-10); Assert.assertTrue(nbSteps < 150); } }
/** {@inheritDoc} */ @Override public void handleStep(final StepInterpolator interpolator, final boolean isLast) { // Reset the short periodics coefficients in order to ensure that interpolation // will be based on current step only mapper.resetShortPeriodicsCoefficients(); // Get the grid points to compute final double[] interpolationPoints = grid.getGridPoints(interpolator.getPreviousTime(), interpolator.getCurrentTime()); for (final double time : interpolationPoints) { // Move the interpolator to the grid point interpolator.setInterpolatedTime(time); // Build the corresponding state final SpacecraftState state; try { state = mapper.mapArrayToState(time, interpolator.getInterpolatedState(), true); // Launch the computation of short periodic coefficients for this date mapper.computeShortPeriodicsCoefficients(state); } catch (MaxCountExceededException e) { e.printStackTrace(); } catch (OrekitException e) { e.printStackTrace(); } } }
public void handleStep(StepInterpolator interpolator, boolean isLast) { double step = FastMath.abs(interpolator.getCurrentTime() - interpolator.getPreviousTime()); if (firstTime) { minStep = FastMath.abs(step); maxStep = minStep; firstTime = false; } else { if (step < minStep) { minStep = step; } if (step > maxStep) { maxStep = step; } } if (isLast) { Assert.assertTrue(minStep < (1.0 / 100.0)); Assert.assertTrue(maxStep > (1.0 / 2.0)); } }
public void handleStep(StepInterpolator interpolator, boolean isLast) { tMin = interpolator.getCurrentTime(); }