From 89395974e5d9445712db347fc957faea5af392b4 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:18:15 +0100 Subject: [PATCH] fixed files form Math #71 --- .../math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java | 4 ++++ .../commons/math/ode/nonstiff/RungeKuttaIntegrator.java | 3 +++ 2 files changed, 7 insertions(+) diff --git a/projects/Math/71/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java b/projects/Math/71/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java index 0840ac1..e03be9e 100644 --- a/projects/Math/71/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java +++ b/projects/Math/71/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java @@ -297,6 +297,10 @@ public double integrate(final FirstOrderDifferentialEquations equations, // it is so small (much probably exactly 0 due to limited accuracy) // that the code above would fail handling it. // So we set up an artificial 0 size step by copying states + interpolator.storeTime(stepStart); + System.arraycopy(y, 0, yTmp, 0, y0.length); + hNew = 0; + stepSize = 0; loop = false; } else { // reject the step to match exactly the next switch time diff --git a/projects/Math/71/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java b/projects/Math/71/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java index 255b1f4..b61b0b1 100644 --- a/projects/Math/71/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java +++ b/projects/Math/71/org/apache/commons/math/ode/nonstiff/RungeKuttaIntegrator.java @@ -177,6 +177,9 @@ public double integrate(final FirstOrderDifferentialEquations equations, // it is so small (much probably exactly 0 due to limited accuracy) // that the code above would fail handling it. // So we set up an artificial 0 size step by copying states + interpolator.storeTime(stepStart); + System.arraycopy(y, 0, yTmp, 0, y0.length); + stepSize = 0; loop = false; } else { // reject the step to match exactly the next switch time