diff options
author | Tavian Barnes <tavianator@gmail.com> | 2010-10-21 13:44:52 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2010-10-21 13:51:49 -0400 |
commit | d92b4ccd931502d1fc4117d8bc7738e0bb497297 (patch) | |
tree | bea0fdfbe4c27fd12a658e7c3a0b29503f38ff38 /tests | |
parent | c01880ba9cfdeb2677eee9b92ee10507070eb86e (diff) | |
download | vz-d92b4ccd931502d1fc4117d8bc7738e0bb497297.tar.xz |
Fix comment in EquationSystem test, and use cosh() for the solution.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/EquationSystem.cpp | 10 |
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 |