summaryrefslogtreecommitdiffstats
path: root/tests/EquationSystem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/EquationSystem.cpp')
-rw-r--r--tests/EquationSystem.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/EquationSystem.cpp b/tests/EquationSystem.cpp
index 973dd30..497a065 100644
--- a/tests/EquationSystem.cpp
+++ b/tests/EquationSystem.cpp
@@ -22,8 +22,8 @@ main()
Y y;
y[0] = 1.0;
y[1] = 1.0;
- vZ::GenericEulerIntegrator<Y> integrator(f);
- integrator.y(y).x(0.0).h(0.01);
+ vZ::GenericDP45Integrator<Y> integrator(f);
+ integrator.tol(1e-6).y(y).x(0.0).h(0.06);
integrator.integrate(2.0);
@@ -33,10 +33,12 @@ main()
std::cout << std::setprecision(10)
<< "Numerical: " << actual << std::endl
<< "Expected: " << expected << std::endl
- << "Iterations: " << integrator.iterations() << std::endl;
+ << "h: " << integrator.h() << std::endl
+ << "Iterations: " << integrator.iterations() << std::endl
+ << "Rejections: " << integrator.rejections() << std::endl;
double error = std::fabs(expected - actual)/expected;
- if (error > 0.01) {
+ if (error > 6.0e-7) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {