Beware that all arrays must be references to integrator arrays, in order to ensure proper update without copy.
220221222223224225226227228229230
// set up two interpolators sharing the integrator arrays final NordsieckStepInterpolator interpolator = new NordsieckStepInterpolator(); interpolator.reinitialize(y, forward); final NordsieckStepInterpolator interpolatorTmp = new NordsieckStepInterpolator(); interpolatorTmp.reinitialize(yTmp, forward); // set up integration control objects for (StepHandler handler : stepHandlers) { handler.reset(); }
280281282283284285286287288289290
correctedScaled[j] = stepSize * yDot[j]; } updateHighOrderDerivativesPhase2(predictedScaled, correctedScaled, nordsieckTmp); // discrete events handling interpolatorTmp.reinitialize(stepEnd, stepSize, correctedScaled, nordsieckTmp); interpolatorTmp.storeTime(stepStart); interpolatorTmp.shift(); interpolatorTmp.storeTime(stepEnd); if (manager.evaluateStep(interpolatorTmp)) { final double dt = manager.getEventTime() - stepStart;
200201202203204205206207208209210
final double[] yDot = new double[n]; final double[] yTmp = new double[y0.length]; // set up an interpolator sharing the integrator arrays final NordsieckStepInterpolator interpolator = new NordsieckStepInterpolator(); interpolator.reinitialize(y, forward); final NordsieckStepInterpolator interpolatorTmp = new NordsieckStepInterpolator(); interpolatorTmp.reinitialize(yTmp, forward); // set up integration control objects for (StepHandler handler : stepHandlers) {
202203204205206207208209210211212
// set up an interpolator sharing the integrator arrays final NordsieckStepInterpolator interpolator = new NordsieckStepInterpolator(); interpolator.reinitialize(y, forward); final NordsieckStepInterpolator interpolatorTmp = new NordsieckStepInterpolator(); interpolatorTmp.reinitialize(yTmp, forward); // set up integration control objects for (StepHandler handler : stepHandlers) { handler.reset(); }
262263264265266267268269270271272
} final Array2DRowRealMatrix nordsieckTmp = updateHighOrderDerivativesPhase1(nordsieck); updateHighOrderDerivativesPhase2(scaled, predictedScaled, nordsieckTmp); // discrete events handling interpolatorTmp.reinitialize(stepEnd, stepSize, predictedScaled, nordsieckTmp); interpolatorTmp.storeTime(stepStart); interpolatorTmp.shift(); interpolatorTmp.storeTime(stepEnd); if (manager.evaluateStep(interpolatorTmp)) { final double dt = manager.getEventTime() - stepStart;
218219220221222223224225226227228
final double[] yDot = new double[y0.length]; final double[] yTmp = new double[y0.length]; // set up two interpolators sharing the integrator arrays final NordsieckStepInterpolator interpolator = new NordsieckStepInterpolator(); interpolator.reinitialize(y, forward); final NordsieckStepInterpolator interpolatorTmp = new NordsieckStepInterpolator(); interpolatorTmp.reinitialize(yTmp, forward); // set up integration control objects for (StepHandler handler : stepHandlers) {