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
This commit is contained in:
parent
5db7c253e1
commit
18b2ddb24b
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue