diff --git a/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java b/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java index 28942c9f5..6bc6825f1 100644 --- a/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java +++ b/src/main/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerIntegrator.java @@ -746,7 +746,7 @@ public class GraggBulirschStoerIntegrator extends AdaptiveStepsizeIntegrator { // estimate if there is a chance convergence will // be reached on next iteration, using the // asymptotic evolution of error - final double ratio = ((double) sequence [k] * sequence[k+1]) / + final double ratio = ((double) sequence [targetIter] * sequence[targetIter + 1]) / (sequence[0] * sequence[0]); if (error > ratio * ratio) { // we don't expect to converge on next iteration diff --git a/src/site/xdoc/changes.xml b/src/site/xdoc/changes.xml index a72e7c193..ff44a55fb 100644 --- a/src/site/xdoc/changes.xml +++ b/src/site/xdoc/changes.xml @@ -39,6 +39,10 @@ The type attribute can be add,update,fix,remove. + + Fixed a convergence discrepancy with respect to theory in Gragg-Bulirsch-Stoer + integrator. + Fixed a wrong dimension check in SVD solver. diff --git a/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java b/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java index 51b265408..7073af0dc 100644 --- a/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math/ode/nonstiff/GraggBulirschStoerStepInterpolatorTest.java @@ -78,8 +78,8 @@ public class GraggBulirschStoerStepInterpolatorTest { oos.writeObject(handler); } - assertTrue(bos.size () > 34000); - assertTrue(bos.size () < 35000); + assertTrue(bos.size () > 33000); + assertTrue(bos.size () < 34000); ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); ObjectInputStream ois = new ObjectInputStream(bis); @@ -101,7 +101,7 @@ public class GraggBulirschStoerStepInterpolatorTest { } } - assertTrue(maxError < 5.0e-11); + assertTrue(maxError < 5.0e-10); }