From 18b2ddb24bda92077add94bb80d35af272236848 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sun, 21 Jun 2009 17:07:27 +0000 Subject: [PATCH] fixed Adams-Bashforth order for error control (it is k, not k+1) git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@787052 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/math/ode/nonstiff/AdamsBashforthIntegrator.java | 4 ++-- .../math/ode/nonstiff/AdamsBashforthIntegratorTest.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java b/src/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java index 09c73f62c..53239824e 100644 --- a/src/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java +++ b/src/java/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegrator.java @@ -157,7 +157,7 @@ public class AdamsBashforthIntegrator extends MultistepIntegrator { final double scalAbsoluteTolerance, final double scalRelativeTolerance) throws IllegalArgumentException { - super("Adams-Bashforth", nSteps, nSteps + 1, minStep, maxStep, + super("Adams-Bashforth", nSteps, nSteps, minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance); } @@ -177,7 +177,7 @@ public class AdamsBashforthIntegrator extends MultistepIntegrator { final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance) throws IllegalArgumentException { - super("Adams-Bashforth", nSteps, nSteps + 1, minStep, maxStep, + super("Adams-Bashforth", nSteps, nSteps, minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance); } diff --git a/src/test/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegratorTest.java b/src/test/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegratorTest.java index c9876a713..d376055cc 100644 --- a/src/test/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegratorTest.java +++ b/src/test/org/apache/commons/math/ode/nonstiff/AdamsBashforthIntegratorTest.java @@ -78,11 +78,11 @@ public class AdamsBashforthIntegratorTest { pb.getInitialTime(), pb.getInitialState(), pb.getFinalTime(), new double[pb.getDimension()]); - // the 28 and 42 factors are only valid for this test + // the 33 and 45 factors are only valid for this test // and has been obtained from trial and error // there is no general relation between local and global errors - assertTrue(handler.getMaximalValueError() > (28.0 * scalAbsoluteTolerance)); - assertTrue(handler.getMaximalValueError() < (42.0 * scalAbsoluteTolerance)); + assertTrue(handler.getMaximalValueError() > (33.0 * scalAbsoluteTolerance)); + assertTrue(handler.getMaximalValueError() < (45.0 * scalAbsoluteTolerance)); assertEquals(0, handler.getMaximalTimeError(), 1.0e-16); int calls = pb.getCalls();