reenabled tests
removed a development test that was committed by error git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@781159 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1cdc029378
commit
4db6140e9a
|
@ -31,13 +31,11 @@ import org.apache.commons.math.ode.DerivativeException;
|
|||
import org.apache.commons.math.ode.FirstOrderIntegrator;
|
||||
import org.apache.commons.math.ode.IntegratorException;
|
||||
import org.apache.commons.math.ode.events.EventHandler;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
public class AdamsIntegratorTest {
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
@Ignore
|
||||
public void dimensionCheckBashforth() throws DerivativeException, IntegratorException {
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
new AdamsIntegrator(3, false, 0.01).integrate(pb,
|
||||
|
@ -49,7 +47,7 @@ public class AdamsIntegratorTest {
|
|||
public void decreasingStepsBashforth() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblemAbstract[] problems = TestProblemFactory.getProblems();
|
||||
for (int k = 3; k < problems.length; ++k) {
|
||||
for (int k = 0; k < problems.length; ++k) {
|
||||
|
||||
double previousError = Double.NaN;
|
||||
for (int i = 6; i < 10; ++i) {
|
||||
|
@ -84,7 +82,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void smallStepBashforth() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
|
@ -105,7 +102,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void bigStepBashforth() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
|
@ -125,7 +121,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void backwardBashforth() throws DerivativeException, IntegratorException {
|
||||
|
||||
TestProblem5 pb = new TestProblem5();
|
||||
|
@ -144,7 +139,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void polynomialBashforth() throws DerivativeException, IntegratorException {
|
||||
TestProblem6 pb = new TestProblem6();
|
||||
double step = Math.abs(pb.getFinalTime() - pb.getInitialTime()) * 0.02;
|
||||
|
@ -167,7 +161,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void serializationBashforth()
|
||||
throws IntegratorException, DerivativeException,
|
||||
IOException, ClassNotFoundException {
|
||||
|
@ -194,7 +187,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test(expected=IntegratorException.class)
|
||||
@Ignore
|
||||
public void dimensionCheckMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem1 pb = new TestProblem1();
|
||||
|
@ -204,7 +196,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void decreasingStepsMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
|
@ -244,7 +235,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void smallStepMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
|
@ -266,7 +256,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void bigStepMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
|
@ -285,7 +274,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void backwardMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
|
||||
|
@ -305,7 +293,6 @@ public class AdamsIntegratorTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void polynomialMoulton()
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem6 pb = new TestProblem6();
|
||||
|
@ -324,40 +311,4 @@ public class AdamsIntegratorTest {
|
|||
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void comparison()
|
||||
throws DerivativeException, IntegratorException {
|
||||
TestProblem3 pb = new TestProblem3(0.9);
|
||||
double range = Math.abs(pb.getFinalTime() - pb.getInitialTime());
|
||||
FirstOrderIntegrator dp853 =
|
||||
new DormandPrince853Integrator(0, range, 1.0e-8, 1.0e-8);
|
||||
ContinuousOutputModel model1 = new ContinuousOutputModel();
|
||||
dp853.addStepHandler(model1);
|
||||
dp853.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
AdamsIntegrator ab8 = new AdamsIntegrator(8, false, range / 100.0);
|
||||
ab8.setStarterIntegrator(dp853);
|
||||
ContinuousOutputModel model2 = new ContinuousOutputModel();
|
||||
ab8.addStepHandler(model2);
|
||||
ab8.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
AdamsIntegrator am8 = new AdamsIntegrator(8, true, range / 100.0);
|
||||
am8.setStarterIntegrator(dp853);
|
||||
ContinuousOutputModel model3 = new ContinuousOutputModel();
|
||||
am8.addStepHandler(model3);
|
||||
am8.integrate(pb, pb.getInitialTime(), pb.getInitialState(),
|
||||
pb.getFinalTime(), new double[pb.getDimension()]);
|
||||
for (double t = pb.getInitialTime(); t < pb.getFinalTime(); t += 1.0e-3 * range) {
|
||||
model1.setInterpolatedTime(t);
|
||||
model2.setInterpolatedTime(t);
|
||||
model3.setInterpolatedTime(t);
|
||||
System.out.println(t + " " +
|
||||
pb.computeTheoreticalState(t)[0] + " " +
|
||||
(model1.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]) + " " +
|
||||
(model2.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]) + " " +
|
||||
(model3.getInterpolatedState()[0]-pb.computeTheoreticalState(t)[0]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue