From d92b4ccd931502d1fc4117d8bc7738e0bb497297 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 21 Oct 2010 13:44:52 -0400 Subject: Fix comment in EquationSystem test, and use cosh() for the solution. --- tests/EquationSystem.cpp | 10 +++++++--- 1 file 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 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 -- cgit v1.2.3