summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-21 13:44:52 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-21 13:51:49 -0400
commitd92b4ccd931502d1fc4117d8bc7738e0bb497297 (patch)
treebea0fdfbe4c27fd12a658e7c3a0b29503f38ff38 /tests
parentc01880ba9cfdeb2677eee9b92ee10507070eb86e (diff)
downloadvz-d92b4ccd931502d1fc4117d8bc7738e0bb497297.tar.xz
Fix comment in EquationSystem test, and use cosh() for the solution.
Diffstat (limited to 'tests')
-rw-r--r--tests/EquationSystem.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/EquationSystem.cpp b/tests/EquationSystem.cpp
index 0a929aa..6919506 100644
--- a/tests/EquationSystem.cpp
+++ b/tests/EquationSystem.cpp
@@ -25,7 +25,11 @@
typedef vZ::EquationSystem<2> Y;
-// y'' = y (y == C*exp(t))
+// y'' = y (y == C*exp(t) + D*exp(-t))
+//
+// Split as:
+// y' = v
+// v' = y
Y
f(double t, Y y)
{
@@ -40,7 +44,7 @@ main()
{
Y y;
y[0] = 1.0;
- y[1] = 1.0;
+ y[1] = 0.0;
vZ::GenericDP45Integrator<Y> integrator(f);
integrator.tol(1e-6)
.y(y)
@@ -50,7 +54,7 @@ main()
integrator.integrate(2.0);
double actual = integrator.y()[0];
- double expected = std::exp(2.0);
+ double expected = std::cosh(2.0);
std::cout << std::setprecision(10)
<< "Numerical: " << actual << std::endl