From ea732c5eea692f3f6cfd1a16cdb992a656ad567a Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:16:10 +0100 Subject: [PATCH] fixed files form Math #39 --- .../math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/projects/Math/39/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java b/projects/Math/39/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java index 13ced27..d2bbf67 100644 --- a/projects/Math/39/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java +++ b/projects/Math/39/org/apache/commons/math/ode/nonstiff/EmbeddedRungeKuttaIntegrator.java @@ -247,6 +247,15 @@ public void integrate(final ExpandableStatefulODE equations, final double t) } stepSize = hNew; + if (forward) { + if (stepStart + stepSize >= t) { + stepSize = t - stepStart; + } + } else { + if (stepStart + stepSize <= t) { + stepSize = t - stepStart; + } + } // next stages for (int k = 1; k < stages; ++k) {