|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70070 - in sandbox/odeint/branches/karsten: . boost/numeric boost/numeric/odeint/integrate boost/numeric/odeint/integrate/detail boost/numeric/odeint/stepper libs/numeric/odeint/doc libs/numeric/odeint/doc/html libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint libs/numeric/odeint/doc/html/odeint libs/numeric/odeint/examples libs/numeric/odeint/regression_test libs/numeric/odeint/test
From: karsten.ahnert_at_[hidden]
Date: 2011-03-17 13:08:44
Author: karsten
Date: 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
New Revision: 70070
URL: http://svn.boost.org/trac/boost/changeset/70070
Log:
integrate and docs
Added:
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/short_example.html (contents, props changed)
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/short_example.qbk (contents, props changed)
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/stepper_table.qbk (contents, props changed)
Removed:
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_harm_osc.cpp
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_integrate.cpp
Text files modified:
sandbox/odeint/branches/karsten/TODO | 34 ++-
sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp | 2
sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp | 61 ++++--
sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp | 45 ++--
sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp | 1
sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp | 6
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/concepts.html | 325 ++++++++++++++++++---------------------
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/extend_odeint.html | 16
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/reference.html | 26 +-
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/tutorial.html | 225 ++++++++++++++-------------
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html | 16
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/odeint/overview.html | 14
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/standalone_HTML.manifest | 2
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/odeint.qbk | 52 ------
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk | 46 ++---
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/Jamfile | 3
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/harmonic_oscillator.cpp | 48 ++++-
sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp | 94 ++++++-----
sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp | 6
19 files changed, 504 insertions(+), 518 deletions(-)
Modified: sandbox/odeint/branches/karsten/TODO
==============================================================================
--- sandbox/odeint/branches/karsten/TODO (original)
+++ sandbox/odeint/branches/karsten/TODO 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -1,4 +1,4 @@
-* Unit test
+* UNIT TEST
NEARLY DONE * test operations
* test vector_space_algebra, maybe with some proto lib
NEARLY DONE * test copying
@@ -9,30 +9,28 @@
* test explicit stepper with ranges
* split check_concepts into check_stepper_concept, check_error_stepper_concept, check_controlled_stepper_concept
* include test/thrust in jam system, use system from
+ * ranges and the integrate functions
+ * symplectic intergrators and ranges
+* GENERAL:
+ * check if everywhere static_cast< value_type > is used
+ * check header guards
+ * check copyright note
+ * documente every file in the preamble
+ * check once more, if all contructor, destructors and assign-operators are present
* integrate functions
* check forwarding problem
* check where exactly the observer will be called (before, after each step?)
+ * ranges
+ OK * check function signatures
+ OK * what to throw?
+ OK * check lambdas, lambda is broken
* Factory functions for steppers, controlled_steppers, error_checker und dense_output_stepper
-* rename error_checker_standard to default_error_checker
* implicit euler, include dfdt
* same interface for implicit_euler and rosenbrock4
DIFFICULT * finishing change of controlled_stepper to units
* check if rosenbrock controller and controlled_stepper can both be used with the explicit steppers
OK * move error_checker into controlled_stepper
* rename controlled_stepper to a more specific name
-* ranges:
- * integrate functions
-* general:
- * check if everywhere static_cast< value_type > is used
- * check header guards
- * check copyright note
- * documente every file in the preamble
- * check once more, if all contructor, destructors and assign-operators are present
-* symplecit_stepper
- OK * find an appropriate name, (symplectic stroemer nystroem)
- OK * check is the coefficients are named good
- * check ranges and call
- OK * include do_step( system , q , p , t , dt )
* dense output for rosenbrock
* Integrate functions
* skript for setting the include defines according to the position in file system an writing a general copyright comment at the beginning
@@ -43,6 +41,12 @@
DONE:
+OK * symplecit_stepper
+ OK * find an appropriate name, (symplectic stroemer nystroem)
+ OK * check is the coefficients are named good
+ OK * include do_step( system , q , p , t , dt )
+OK * rename error_checker_standard to default_error_checker
+OK * check the order of arguments in the observer in integrate functions and initialize in dense_output_stepper
OK * decrease complexity:
LATER * remove construct, destruct, copy ?
OK * remove the overloads solving the forwarding problem. boost::range can not be used then anymore
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint.hpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -33,4 +33,6 @@
*/
// #include <boost/numeric/odeint/algebra/fusion_algebra.hpp>
+#include <boost/numeric/odeint/integrate/integrate.hpp>
+
#endif // BOOST_NUMERIC_ODEINT_HPP
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -8,6 +8,10 @@
#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_
#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_
+#include <stdexcept>
+
+#include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
+
namespace boost {
namespace numeric {
namespace odeint {
@@ -15,38 +19,37 @@
+/*
+ * integrate_adaptive for simple stepper is a integrate_const
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_adaptive(
Stepper stepper , System system , State &start_state ,
- Time &start_time , const Time &end_time , Time &dt ,
- Observer &observer , stepper_tag
+ Time start_time , Time end_time , Time dt ,
+ Observer observer , stepper_tag
)
{
- size_t count = 0;
- while( start_time < end_time )
- {
- stepper.do_step( system , start_state , start_time , dt );
- observer( start_time , start_state );
- start_time += dt;
- ++count;
- }
- return count;
+ return integrate_const( stepper , system , start_state ,
+ start_time , end_time , dt , observer , stepper_tag() );
}
-
+/*
+ * classical integrate adpative
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_adaptive(
Stepper stepper , System system , State &start_state ,
- Time &start_time , const Time &end_time , Time &dt ,
+ Time &start_time , Time end_time , Time &dt ,
Observer observer , controlled_stepper_tag
)
{
- size_t num_of_steps = 0;
+ const size_t max_attempts = 1000;
+ const char *error_string = "Integrate adaptive : Maximal number of iterations reached. A step size could not be found.";
+ size_t count = 0;
while( start_time < end_time )
{
- observer( start_time , start_state );
if( ( start_time + dt ) > end_time )
{
dt = end_time - start_time;
@@ -59,22 +62,36 @@
res = stepper.try_step( system , start_state , start_time , dt );
++trials;
}
- while( ( res == step_size_decreased ) && ( trials < 1000 ) );
- ++num_of_steps;
+ while( ( res == step_size_decreased ) && ( trials < max_attempts ) );
+ if( trials == max_attempts ) throw std::overflow_error( error_string );
+
+ observer( start_state , start_time );
+ ++count;
}
- observer( start_time , start_state );
- return num_of_steps;
+ return count;
}
-
+/*
+ * integrate adaptive for dense output steppers
+ *
+ * step size control is used if the stepper supports it
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_adaptive(
Stepper stepper , System system , State &start_state ,
- const Time &start_time , const Time &end_time , const Time &dt ,
+ Time start_time , Time end_time , Time dt ,
Observer observer , dense_output_stepper_tag )
{
- return 0;
+ size_t count = 0;
+ stepper.initialize( start_state , start_time , dt );
+ while( stepper.current_time() < end_time )
+ {
+ stepper.do_step( system );
+ observer( stepper.current_state() , stepper.current_time() );
+ ++count;
+ }
+ return count;
}
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/detail/integrate_const.hpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -11,40 +11,45 @@
#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
-#include <iostream>
-using namespace std;
-
-
namespace boost {
namespace numeric {
namespace odeint {
namespace detail {
+/*
+ * integrates with constant time step using simple steppers
+ * No step size control
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_const(
Stepper stepper , System system , State &start_state ,
Time start_time , Time end_time , Time dt ,
- Observer &observer , stepper_tag
+ Observer observer , stepper_tag
)
{
+ size_t count = 0;
while( start_time < end_time )
{
- observer( start_time , start_state );
+ observer( start_state , start_time );
stepper.do_step( system , start_state , start_time , dt );
start_time += dt;
+ ++count;
}
- observer( start_time , start_state );
- return 0;
+ return count;
}
-
+/*
+ * integrates with constant time step using a controlled stepper
+ *
+ * step size control is used
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_const(
Stepper stepper , System system , State &start_state ,
- Time &start_time , const Time &end_time , Time &dt ,
+ Time &start_time , Time end_time , Time &dt ,
Observer observer , controlled_stepper_tag
)
{
@@ -52,37 +57,41 @@
Time time_step = dt;
while( start_time < end_time )
{
- observer( start_time , start_state );
Time next_time = start_time + time_step;
if( next_time > end_time ) next_time = end_time;
detail::integrate_adaptive(
stepper , system , start_state , start_time , next_time , dt ,
do_nothing_observer() , controlled_stepper_tag() );
++count;
+ observer( start_state , start_time );
}
- observer( start_time , start_state );
return count;
}
+/*
+ * integrates with constant time step using a controlled stepper
+ *
+ * step size control is used if the stepper is a controlled stepper, otherwise not
+ *
+ * TODO : check the loops for the observers
+ */
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_const(
Stepper stepper , System system , State &start_state ,
Time start_time , Time end_time , Time dt ,
Observer observer , dense_output_stepper_tag )
{
- clog << "dense output" << endl;
stepper.initialize( start_state , start_time , dt );
size_t count = 0;
- size_t count2 = 0;
while( start_time < end_time )
{
while( ( start_time < stepper.current_time() ) && ( start_time < end_time ) )
{
stepper.calc_state( start_time , start_state );
- observer( start_time , start_state );
+ observer( start_state , start_time );
start_time += dt;
++count;
}
@@ -91,15 +100,9 @@
if( start_time < end_time )
{
stepper.do_step( system );
- ++count2;
}
}
- clog << count2 << endl;
return count;
-
-
- observer( start_time , start_state );
- return 0;
}
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate.hpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -97,7 +97,6 @@
-
template< class Stepper , class System , class State , class Time , class Observer >
size_t integrate_adaptive(
Stepper stepper , System system , State &start_state ,
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/stepper/controlled_error_stepper.hpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -46,7 +46,7 @@
class Algebra = range_algebra ,
class Operations = default_operations
>
-class error_checker_standard
+class default_error_checker
{
public:
@@ -55,7 +55,7 @@
typedef Operations operations_type;
- error_checker_standard(
+ default_error_checker(
value_type eps_abs = static_cast< value_type >( 1.0e-6 ) ,
value_type eps_rel = static_cast< value_type >( 1.0e-6 ) ,
value_type a_x = static_cast< value_type >( 1.0 ) ,
@@ -95,7 +95,7 @@
*/
template<
class ErrorStepper ,
- class ErrorChecker = error_checker_standard< typename ErrorStepper::value_type ,
+ class ErrorChecker = default_error_checker< typename ErrorStepper::value_type ,
typename ErrorStepper::algebra_type ,
typename ErrorStepper::operations_type > ,
class AdjustSizePolicy = typename ErrorStepper::adjust_size_policy ,
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/concepts.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/concepts.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/concepts.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Concepts</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="prev" href="extend_odeint.html" title="Extend odeint">
<link rel="next" href="reference.html" title="Reference">
@@ -13,9 +13,9 @@
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="extend_odeint.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="extend_odeint.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_sandbox_numeric_odeint.concepts"></a><a class="link" href="concepts.html" title="Concepts">Concepts</a>
</h2></div></div></div>
@@ -35,7 +35,7 @@
<p>
The odeint library defines three concepts for stepping objects.
</p>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.basic_stepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.basic_stepper" title="Basic stepper">Basic
stepper</a>
@@ -59,8 +59,12 @@
</colgroup>
<thead><tr>
<th>
+ <p>
+ </p>
</th>
<th>
+ <p>
+ </p>
</th>
<th>
<p>
@@ -143,27 +147,25 @@
<p>
<span class="bold"><strong>Methods</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">Stepper</span><span class="special">()</span></code>
- Constructor.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">Stepper</span><span class="special">(</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
- Constructor that allocates internal memory to store intermediate results
- of the same size as <code class="computeroutput"><span class="identifier">x</span></code>.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
- <span class="special">&</span><span class="identifier">system</span>
- <span class="special">,</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">x</span>
- <span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">t</span> <span class="special">,</span>
- <span class="identifier">time_type</span> <span class="identifier">dt</span>
- <span class="special">)</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">Stepper</span><span class="special">()</span></code>
+ Constructor.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">Stepper</span><span class="special">(</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code> Constructor
+ that allocates internal memory to store intermediate results of the same
+ size as <code class="computeroutput"><span class="identifier">x</span></code>.
+ </li>
+<li><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
+ <span class="special">&</span><span class="identifier">system</span>
+ <span class="special">,</span> <span class="identifier">container_type</span>
+ <span class="special">&</span><span class="identifier">x</span>
+ <span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">t</span> <span class="special">,</span>
+ <span class="identifier">time_type</span> <span class="identifier">dt</span>
+ <span class="special">)</span></code></li>
</ul></div>
<p>
Executes one timestep with the given parameters:
@@ -266,53 +268,44 @@
The result of this method is the (approximate) state of the system <span class="bold"><strong>x(t+dt)</strong></span> and is stored in the variable <code class="computeroutput"><span class="identifier">x</span></code> (in-place). Note, that the time <code class="computeroutput"><span class="identifier">t</span></code> is not automatically increased by this
method.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
- <span class="special">&</span><span class="identifier">system</span>
- <span class="special">,</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">x</span>
- <span class="special">,</span> <span class="keyword">const</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="identifier">time_type</span> <span class="identifier">t</span>
- <span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">dt</span> <span class="special">)</span></code>
- </li></ul></div>
+<div class="itemizedlist"><ul type="disc"><li><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
+ <span class="special">&</span><span class="identifier">system</span>
+ <span class="special">,</span> <span class="identifier">container_type</span>
+ <span class="special">&</span><span class="identifier">x</span>
+ <span class="special">,</span> <span class="keyword">const</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="identifier">time_type</span> <span class="identifier">t</span>
+ <span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">dt</span> <span class="special">)</span></code></li></ul></div>
<p>
The same as above but with the additional parameter <code class="computeroutput"><span class="identifier">dxdt</span></code>
that represents the derivative <span class="bold"><strong>x'(t) = f(x,t)</strong></span>
at the time <span class="bold"><strong>t</strong></span>.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
- Adjusts the internal memory to store intermediate results of the same
- size as <code class="computeroutput"><span class="identifier">x</span></code>. This function
- <span class="emphasis"><em>must</em></span> be called whenever the system size changes
- during the integration.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_step</span><span class="special">()</span></code> Returns the order of the algorithm.
- If <span class="bold"><strong>n</strong></span> is the order of a method, then
- the result of one iteration with the timestep <span class="bold"><strong>dt</strong></span>
- is accurate up to <span class="bold"><strong>dt^n</strong></span>. That means the
- error made by the time discretization is of order <span class="bold"><strong>dt^(n+1)</strong></span>.
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code> Adjusts
+ the internal memory to store intermediate results of the same size as
+ <code class="computeroutput"><span class="identifier">x</span></code>. This function <span class="emphasis"><em>must</em></span>
+ be called whenever the system size changes during the integration.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_step</span><span class="special">()</span></code> Returns the order of the algorithm. If
+ <span class="bold"><strong>n</strong></span> is the order of a method, then the result
+ of one iteration with the timestep <span class="bold"><strong>dt</strong></span>
+ is accurate up to <span class="bold"><strong>dt^n</strong></span>. That means the
+ error made by the time discretization is of order <span class="bold"><strong>dt^(n+1)</strong></span>.
+ </li>
</ul></div>
<p>
<span class="bold"><strong>Stepper that model this concept</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_euler</span></code>
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_rk4</span></code>
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_rk78_fehlberg</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="computeroutput"><span class="identifier">stepper_euler</span></code></li>
+<li><code class="computeroutput"><span class="identifier">stepper_rk4</span></code></li>
+<li><code class="computeroutput"><span class="identifier">stepper_rk78_fehlberg</span></code></li>
</ul></div>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.error_stepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.error_stepper" title="Error stepper">Error
stepper</a>
@@ -337,28 +330,26 @@
<p>
<span class="bold"><strong>Methods</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">Error_Stepper</span><span class="special">()</span></code>
- Constructor.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">Error_Stepper</span><span class="special">(</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
- Constructor that allocates internal memory to store intermediate results
- of the same size as <code class="computeroutput"><span class="identifier">x</span></code>.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
- <span class="special">&</span><span class="identifier">system</span>
- <span class="special">,</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">x</span>
- <span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">t</span> <span class="special">,</span>
- <span class="identifier">time_type</span> <span class="identifier">dt</span>
- <span class="special">,</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">xerr</span><span class="special">)</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">Error_Stepper</span><span class="special">()</span></code>
+ Constructor.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">Error_Stepper</span><span class="special">(</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code> Constructor
+ that allocates internal memory to store intermediate results of the same
+ size as <code class="computeroutput"><span class="identifier">x</span></code>.
+ </li>
+<li><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
+ <span class="special">&</span><span class="identifier">system</span>
+ <span class="special">,</span> <span class="identifier">container_type</span>
+ <span class="special">&</span><span class="identifier">x</span>
+ <span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">t</span> <span class="special">,</span>
+ <span class="identifier">time_type</span> <span class="identifier">dt</span>
+ <span class="special">,</span> <span class="identifier">container_type</span>
+ <span class="special">&</span><span class="identifier">xerr</span><span class="special">)</span></code></li>
</ul></div>
<p>
Executes one timestep with the given parameters:
@@ -480,54 +471,45 @@
Note, that the time <code class="computeroutput"><span class="identifier">t</span></code> is
not automatically increased by this method.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
- <span class="special">&</span><span class="identifier">system</span>
- <span class="special">,</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">x</span>
- <span class="special">,</span> <span class="keyword">const</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="identifier">time_type</span> <span class="identifier">t</span>
- <span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">dt</span> <span class="special">,</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">xerr</span><span class="special">)</span></code>
- </li></ul></div>
+<div class="itemizedlist"><ul type="disc"><li><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span>
+ <span class="special">&</span><span class="identifier">system</span>
+ <span class="special">,</span> <span class="identifier">container_type</span>
+ <span class="special">&</span><span class="identifier">x</span>
+ <span class="special">,</span> <span class="keyword">const</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="identifier">time_type</span> <span class="identifier">t</span>
+ <span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">dt</span> <span class="special">,</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">xerr</span><span class="special">)</span></code></li></ul></div>
<p>
The same as above but with the additional parameter <code class="computeroutput"><span class="identifier">dxdt</span></code>
that represents the derivative <span class="bold"><strong>x'(t) = f(x,t)</strong></span>
at the time <span class="bold"><strong>t</strong></span>.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
- Adjusts the internal memory to store intermediate results of the same
- size as <code class="computeroutput"><span class="identifier">x</span></code>. This function
- <span class="emphasis"><em>must</em></span> be called whenever the system size changes
- during the integration.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error_step</span><span class="special">()</span></code> Returns the order of the result <span class="bold"><strong>x(t+dt)</strong></span> of the algorithm.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error</span><span class="special">()</span></code> Returns the order of the error estimation
- of the algorithm.
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code> Adjusts
+ the internal memory to store intermediate results of the same size as
+ <code class="computeroutput"><span class="identifier">x</span></code>. This function <span class="emphasis"><em>must</em></span>
+ be called whenever the system size changes during the integration.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error_step</span><span class="special">()</span></code> Returns the order of the result <span class="bold"><strong>x(t+dt)</strong></span> of the algorithm.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error</span><span class="special">()</span></code> Returns the order of the error estimation
+ of the algorithm.
+ </li>
</ul></div>
<p>
<span class="bold"><strong>Stepper that model this concept</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_rk5_ck</span></code>
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_rk78_fehlberg</span></code>
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">stepper_half_step</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="computeroutput"><span class="identifier">stepper_rk5_ck</span></code></li>
+<li><code class="computeroutput"><span class="identifier">stepper_rk78_fehlberg</span></code></li>
+<li><code class="computeroutput"><span class="identifier">stepper_half_step</span></code></li>
</ul></div>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.controlled_stepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.controlled_stepper" title="Controlled stepper">Controlled
stepper</a>
@@ -547,13 +529,11 @@
<p>
<span class="bold"><strong>Methods</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
- <code class="computeroutput"><span class="identifier">Controlled_Stepper</span><span class="special">(</span>
- <span class="identifier">time_type</span> <span class="identifier">abs_err</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">rel_err</span><span class="special">,</span>
- <span class="identifier">time_type</span> <span class="identifier">factor_x</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">factor_dxdt</span> <span class="special">)</span></code>
- </li></ul></div>
+<div class="itemizedlist"><ul type="disc"><li><code class="computeroutput"><span class="identifier">Controlled_Stepper</span><span class="special">(</span>
+ <span class="identifier">time_type</span> <span class="identifier">abs_err</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">rel_err</span><span class="special">,</span>
+ <span class="identifier">time_type</span> <span class="identifier">factor_x</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">factor_dxdt</span> <span class="special">)</span></code></li></ul></div>
<p>
Constructor that initializes the controlled stepper with several parameters
of the error control. The controlled stepper assures that the error done
@@ -572,20 +552,22 @@
If the estimated error is less than half of the desired error, an increased
stepsize will be suggested.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">Controlled_Stepper</span><span class="special">(</span>
- <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">time_type</span> <span class="identifier">abs_err</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">rel_err</span><span class="special">,</span>
- <span class="identifier">time_type</span> <span class="identifier">factor_x</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="identifier">factor_dxdt</span> <span class="special">)</span></code>
- Same as above, but with additional allocation of the internal memory
- to store intermediate results of the same size as <code class="computeroutput"><span class="identifier">x</span></code>.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">controlled_step_result</span> <span class="identifier">try_step</span><span class="special">(</span>
- <span class="identifier">DynamicalSystem</span> <span class="special">&</span><span class="identifier">system</span><span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">time_type</span> <span class="special">&</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">time_type</span> <span class="special">&</span><span class="identifier">dt</span> <span class="special">)</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">Controlled_Stepper</span><span class="special">(</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">abs_err</span><span class="special">,</span>
+ <span class="identifier">time_type</span> <span class="identifier">rel_err</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="identifier">factor_x</span><span class="special">,</span>
+ <span class="identifier">time_type</span> <span class="identifier">factor_dxdt</span>
+ <span class="special">)</span></code> Same as above, but with additional
+ allocation of the internal memory to store intermediate results of the
+ same size as <code class="computeroutput"><span class="identifier">x</span></code>.
+ </li>
+<li><code class="computeroutput"><span class="identifier">controlled_step_result</span> <span class="identifier">try_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span> <span class="special">&</span><span class="identifier">system</span><span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="special">&</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="special">&</span><span class="identifier">dt</span>
+ <span class="special">)</span></code></li>
</ul></div>
<p>
Tries one timestep with the given parameters
@@ -698,50 +680,43 @@
<code class="computeroutput"><span class="identifier">dt</span></code> now containes the suggested
reduced stepsize that should give an error below the desired level.
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">controlled_step_result</span> <span class="identifier">try_step</span><span class="special">(</span>
- <span class="identifier">DynamicalSystem</span> <span class="special">&</span><span class="identifier">system</span><span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">container_type</span>
- <span class="special">&</span><span class="identifier">dxdt</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="special">&</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">time_type</span>
- <span class="special">&</span><span class="identifier">dt</span>
- <span class="special">)</span></code> Same as above but with the additional
- parameter <code class="computeroutput"><span class="identifier">dxdt</span></code> that that
- represents the derivative <span class="bold"><strong>x'(t) = f(x,t)</strong></span>
- at the time <span class="bold"><strong>t</strong></span>.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
- Adjusts the internal memory to store intermediate results of the same
- size as <code class="computeroutput"><span class="identifier">x</span></code>. This function
- <span class="emphasis"><em>must</em></span> be called whenever the system size changes
- during the integration.
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error_step</span><span class="special">()</span></code> Returns the order of the result <span class="bold"><strong>x(t+dt)</strong></span> of the algorithm.
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li>
+<code class="computeroutput"><span class="identifier">controlled_step_result</span> <span class="identifier">try_step</span><span class="special">(</span> <span class="identifier">DynamicalSystem</span> <span class="special">&</span><span class="identifier">system</span><span class="special">,</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span>
+ <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">dxdt</span><span class="special">,</span> <span class="identifier">time_type</span> <span class="special">&</span><span class="identifier">t</span><span class="special">,</span> <span class="identifier">time_type</span>
+ <span class="special">&</span><span class="identifier">dt</span>
+ <span class="special">)</span></code> Same as above but with the additional
+ parameter <code class="computeroutput"><span class="identifier">dxdt</span></code> that that
+ represents the derivative <span class="bold"><strong>x'(t) = f(x,t)</strong></span>
+ at the time <span class="bold"><strong>t</strong></span>.
+ </li>
+<li>
+<code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code> Adjusts
+ the internal memory to store intermediate results of the same size as
+ <code class="computeroutput"><span class="identifier">x</span></code>. This function <span class="emphasis"><em>must</em></span>
+ be called whenever the system size changes during the integration.
+ </li>
+<li>
+<code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_error_step</span><span class="special">()</span></code> Returns the order of the result <span class="bold"><strong>x(t+dt)</strong></span> of the algorithm.
+ </li>
</ul></div>
<p>
<span class="bold"><strong>Stepper that model this concept</strong></span>
</p>
-<div class="itemizedlist"><ul class="itemizedlist" type="disc">
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">controlled_stepper_standard</span></code>
- </li>
-<li class="listitem">
- <code class="computeroutput"><span class="identifier">controlled_stepper_bs</span></code>
- </li>
+<div class="itemizedlist"><ul type="disc">
+<li><code class="computeroutput"><span class="identifier">controlled_stepper_standard</span></code></li>
+<li><code class="computeroutput"><span class="identifier">controlled_stepper_bs</span></code></li>
</ul></div>
</div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.dense_ouput_stepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.dense_ouput_stepper" title="Dense ouput stepper">Dense
ouput stepper</a>
</h3></div></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.size_adjusting_stepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.size_adjusting_stepper" title="Size adjusting stepper">Size
adjusting stepper</a>
</h3></div></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.concepts.compositestepper"></a><a class="link" href="concepts.html#boost_sandbox_numeric_odeint.concepts.compositestepper" title="CompositeStepper">CompositeStepper</a>
</h3></div></div></div></div>
<p>
@@ -758,7 +733,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="extend_odeint.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="extend_odeint.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="reference.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/extend_odeint.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/extend_odeint.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/extend_odeint.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Extend odeint</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="prev" href="tutorial.html" title="Tutorial">
<link rel="next" href="concepts.html" title="Concepts">
@@ -13,9 +13,9 @@
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_sandbox_numeric_odeint.extend_odeint"></a><a class="link" href="extend_odeint.html" title="Extend odeint">Extend odeint</a>
</h2></div></div></div>
@@ -27,11 +27,11 @@
<dt><span class="section"><a href="extend_odeint.html#boost_sandbox_numeric_odeint.extend_odeint.adapt_your_own_operations">Adapt
your own operations</a></span></dt>
</dl></div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.extend_odeint.write_own_steppers"></a><a class="link" href="extend_odeint.html#boost_sandbox_numeric_odeint.extend_odeint.write_own_steppers" title="Write own steppers">Write
own steppers</a>
</h3></div></div></div></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.extend_odeint.adapt_your_own_containers"></a><a class="link" href="extend_odeint.html#boost_sandbox_numeric_odeint.extend_odeint.adapt_your_own_containers" title="Adapt your own containers">Adapt
your own containers</a>
@@ -40,7 +40,7 @@
gsl_vector, gsl_matrix, ublas::matrix, blitz::matrix, thrust
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.extend_odeint.adapt_your_own_operations"></a><a class="link" href="extend_odeint.html#boost_sandbox_numeric_odeint.extend_odeint.adapt_your_own_operations" title="Adapt your own operations">Adapt
your own operations</a>
@@ -60,7 +60,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="tutorial.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="tutorial.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/reference.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/reference.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/reference.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,8 +3,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Reference</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="prev" href="concepts.html" title="Concepts">
</head>
@@ -12,9 +12,9 @@
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="concepts.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+<a accesskey="p" href="concepts.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_sandbox_numeric_odeint.reference"></a><a class="link" href="reference.html" title="Reference">Reference</a>
</h2></div></div></div>
@@ -27,13 +27,13 @@
<dt><span class="section">Operations</span></dt>
<dt><span class="section">Resizing</span></dt>
</dl></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.reference.stepper_classes"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.stepper_classes" title="Stepper classes">Stepper
classes</a>
</h3></div></div></div>
<div class="table">
-<a name="id578418"></a><p class="title"><b>Table 1.3. Stepper Algorithms</b></p>
+<a name="id372998"></a><p class="title"><b>Table 1.3. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -201,27 +201,27 @@
</div>
<br class="table-break">
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.reference.integration_functions"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.integration_functions" title="Integration functions">Integration
functions</a>
</h3></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h4 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.reference.integration_functions.constant_step_size_functions"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.integration_functions.constant_step_size_functions" title="Constant step-size functions">Constant
step-size functions</a>
</h4></div></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h4 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.reference.integration_functions.adaptive_step_size_functions"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.integration_functions.adaptive_step_size_functions" title="Adaptive step-size functions">Adaptive
step-size functions</a>
</h4></div></div></div></div>
</div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.reference.algebras"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.algebras" title="Algebras">Algebras</a>
</h3></div></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.reference.operations"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.operations" title="Operations">Operations</a>
</h3></div></div></div></div>
-<div class="section"><div class="titlepage"><div><div><h3 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.reference.resizing"></a><a class="link" href="reference.html#boost_sandbox_numeric_odeint.reference.resizing" title="Resizing">Resizing</a>
</h3></div></div></div></div>
</div>
@@ -235,7 +235,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="concepts.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a>
+<a accesskey="p" href="concepts.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a>
</div>
</body>
</html>
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/short_example.html
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/short_example.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -0,0 +1,171 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
+<title>Short Example</title>
+<link rel="stylesheet" href="../boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<link rel="prev" href="../odeint/overview.html" title="Overview">
+<link rel="next" href="tutorial.html" title="Tutorial">
+</head>
+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../odeint/overview.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+<div class="section" lang="en">
+<div class="titlepage"><div><div><h2 class="title" style="clear: both">
+<a name="boost_sandbox_numeric_odeint.short_example"></a><a class="link" href="short_example.html" title="Short Example">Short Example</a>
+</h2></div></div></div>
+<p>
+ This section gives a quick introduction to the most important features of the
+ library using a number of instructive examples. Image, for example, you want
+ to numerically integrate a harmonic oscillator with friction. The equations
+ of motion are given by x'' = -x + gamma x'. This can be transformed to a system
+ of two first-order differential equations with new variables x and p=x'. To
+ apply numerical integration one first has to design the right hand side of
+ the equation w' = f(w) where in this case w = (x,p):
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="comment">/* The type of container used to hold the state vector */</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
+
+<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">gam</span> <span class="special">=</span> <span class="number">0.15</span><span class="special">;</span>
+
+<span class="comment">/* The rhs of x' = f(x) */</span>
+<span class="keyword">void</span> <span class="identifier">harmonic_oscillator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">dxdt</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
+ <span class="identifier">dxdt</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="special">-</span><span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="identifier">gam</span><span class="special">*</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ Here we chose <span class="bold"><strong>vector<double></strong></span> as the
+ state type, but others are also possible, for example <span class="bold"><strong>tr1/array<double,2></strong></span>.
+ Odeint is designed in such a way that it works with basically any container
+ that can be accessed via iterators. The parameter structure of the function
+ is crucial: the integration methods will always call them in the form <span class="bold"><strong>f(x, dxdt, t)</strong></span>. So even if there is no explicit time
+ dependence, one has to define <span class="bold"><strong>t</strong></span> as a function
+ parameter.
+ </p>
+<p>
+ Now, we have to define the initial state from which the integration should
+ start:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">state_type</span> <span class="identifier">x</span><span class="special">(</span><span class="number">2</span><span class="special">);</span>
+<span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="number">1.0</span><span class="special">;</span> <span class="comment">// start at x=1.0, p=0.0
+</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="number">0.0</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ For the integration itself we'll use the <code class="computeroutput">integrate</code>
+ function, which is a convenient way to get quick results. It is based on the
+ error-controlled <code class="computeroutput">runge_kutta_rk5_ck</code>
+ stepper (5th order) and uses adaptive stepsize. The results are stored into
+ two InsertIterators (time and state) that must be provided.
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">times</span><span class="special">;</span>
+<span class="identifier">vector</span><span class="special"><</span><span class="identifier">state_type</span><span class="special">></span> <span class="identifier">x_t_vec</span><span class="special">;</span>
+
+<span class="identifier">size_t</span> <span class="identifier">steps</span> <span class="special">=</span> <span class="identifier">integrate</span><span class="special">(</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span>
+ <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span>
+ <span class="identifier">back_inserter</span><span class="special">(</span> <span class="identifier">times</span> <span class="special">)</span> <span class="special">,</span>
+ <span class="identifier">back_inserter</span><span class="special">(</span> <span class="identifier">x_t_vec</span> <span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ The integrate function expects as parameters the rhs of the ode as defined
+ above, the initial state x, the start- and end-time of the integration and
+ two InsertIterators for the times and states where the current time and the
+ current state after each timestep is stored. Note, that <code class="computeroutput">integrate</code>
+ uses an adaptive stepsize during the integration steps so the time points will
+ not be equally spaced. The integration returns the number of steps that were
+ applied. Note, that in total steps+1 elements will be inserted into times and
+ x_t_vec as the initial time and state are inserted before the first step.
+ </p>
+<p>
+ It is, of course, also possible to implement the ode system as a class. The
+ rhs must then be defined as the ()-operator:
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
+
+ <span class="keyword">double</span> <span class="identifier">m_gam</span><span class="special">;</span>
+
+<span class="keyword">public</span><span class="special">:</span>
+ <span class="identifier">harm_osc</span><span class="special">(</span> <span class="keyword">double</span> <span class="identifier">gam</span> <span class="special">)</span> <span class="special">:</span> <span class="identifier">m_gam</span><span class="special">(</span><span class="identifier">gam</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
+
+ <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">dxdt</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
+ <span class="identifier">dxdt</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="special">-</span><span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="identifier">m_gam</span><span class="special">*</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
+ which can be used via
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">harm_osc</span> <span class="identifier">ho</span><span class="special">(</span><span class="number">0.15</span><span class="special">);</span>
+<span class="identifier">steps</span> <span class="special">=</span> <span class="identifier">integrate</span><span class="special">(</span> <span class="identifier">ho</span> <span class="special">,</span>
+ <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span>
+ <span class="identifier">back_inserter</span><span class="special">(</span> <span class="identifier">times</span> <span class="special">)</span> <span class="special">,</span>
+ <span class="identifier">back_inserter</span><span class="special">(</span> <span class="identifier">x_t_vec</span> <span class="special">)</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+</div>
+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
+<td align="left"></td>
+<td align="right"><div class="copyright-footer">Copyright © 2009 Karsten Ahnert and Mario Mulansky<p>
+ Distributed under the Boost Software License, Version 1.0. (See accompanying
+ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ </p>
+</div></td>
+</tr></table>
+<hr>
+<div class="spirit-nav">
+<a accesskey="p" href="../odeint/overview.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="tutorial.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
+</div>
+</body>
+</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/tutorial.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/tutorial.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/tutorial.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,19 +3,19 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Tutorial</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
-<link rel="prev" href="../odeint/short_example.html" title="Short Example">
+<link rel="prev" href="short_example.html" title="Short Example">
<link rel="next" href="extend_odeint.html" title="Extend odeint">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../odeint/short_example.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="extend_odeint.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="short_example.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extend_odeint.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="boost_sandbox_numeric_odeint.tutorial"></a><a class="link" href="tutorial.html" title="Tutorial">Tutorial</a>
</h2></div></div></div>
@@ -34,12 +34,12 @@
topics</a></span></dt>
<dt><span class="section">References</span></dt>
</dl></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator" title="Harmonic oscillator">Harmonic
oscillator</a>
</h3></div></div></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.define_the_ode"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.define_the_ode" title="Define the ODE">Define
the ODE</a>
@@ -54,16 +54,8 @@
<span class="identifier">complex</span><span class="special"><</span>
<span class="keyword">double</span> <span class="special">></span>
<span class="special">></span></code> to represent the system state.
- However, odeint can deal with other container types as well, e.g. <code class="computeroutput"><span class="identifier">tr1</span><span class="special">/</span><span class="identifier">array</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">N</span> <span class="special">></span></code>
- as long as it is able to obtain a ForwardIterator going through all of
- the container's elements. The scalar type must have several operations
- ( + , - , += , -= ) and the <code class="computeroutput"><span class="identifier">abs</span><span class="special">()</span></code>-function defined. Furthermore, one can
- choose the datatype of the time (that is, the parameter to which respect
- the differentiation is done). The standard type for this is <code class="computeroutput"><span class="keyword">double</span></code>, but it should be possible to use,
- for example, <code class="computeroutput"><span class="identifier">complex</span><span class="special"><</span>
- <span class="keyword">double</span> <span class="special">></span></code>
- as well (untested). It must be possible to multiply the time type and the
- scalar type of the vector. For the most cases <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span></code> as state type and the standard <code class="computeroutput"><span class="keyword">double</span></code> for the time type should be sufficient.
+ However, odeint can deal with other container types as well, e.g. <code class="computeroutput"><span class="identifier">tr1</span><span class="special">::</span><span class="identifier">array</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">,</span> <span class="identifier">N</span> <span class="special">></span></code>
+ as long as it is fullfils some requirements defined below.
</p>
<p>
To integrate a differential equation numerically, one has to define the
@@ -73,21 +65,25 @@
to just define a function, e.g:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="comment">/* The type of container used to hold the state vector */</span>
-<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
+<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span> <span class="identifier">state_type</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">gam</span> <span class="special">=</span> <span class="number">0.15</span><span class="special">;</span>
<span class="comment">/* The rhs of x' = f(x) */</span>
-<span class="keyword">void</span> <span class="identifier">harmonic_oscillator</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span><span class="special">)</span>
+<span class="keyword">void</span> <span class="identifier">harmonic_oscillator</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">dxdt</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
<span class="identifier">dxdt</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="special">-</span><span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="identifier">gam</span><span class="special">*</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
<span class="special">}</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The parameters of the function must follow the example above where <span class="bold"><strong>x</strong></span> is the current state, <span class="bold"><strong>dxdt</strong></span>
@@ -101,7 +97,9 @@
parameter structure as above:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
@@ -110,7 +108,7 @@
<span class="keyword">public</span><span class="special">:</span>
<span class="identifier">harm_osc</span><span class="special">(</span> <span class="keyword">double</span> <span class="identifier">gam</span> <span class="special">)</span> <span class="special">:</span> <span class="identifier">m_gam</span><span class="special">(</span><span class="identifier">gam</span><span class="special">)</span> <span class="special">{</span> <span class="special">}</span>
- <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span><span class="special">)</span>
+ <span class="keyword">void</span> <span class="keyword">operator</span><span class="special">()</span> <span class="special">(</span> <span class="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">,</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">dxdt</span> <span class="special">,</span> <span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">)</span>
<span class="special">{</span>
<span class="identifier">dxdt</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">=</span> <span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
<span class="identifier">dxdt</span><span class="special">[</span><span class="number">1</span><span class="special">]</span> <span class="special">=</span> <span class="special">-</span><span class="identifier">x</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special">-</span> <span class="identifier">m_gam</span><span class="special">*</span><span class="identifier">x</span><span class="special">[</span><span class="number">1</span><span class="special">];</span>
@@ -118,31 +116,32 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
odeint can deal with instances of such classes instead of pure functions
which allows for cleaner code.
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.stepper_types"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.stepper_types" title="Stepper Types">Stepper
Types</a>
</h4></div></div></div>
<p>
Numerical integration works iteratively, that means you start at a state
- <span class="emphasis"><em>x(t)</em></span> and performs a timestep of length <span class="emphasis"><em>dt</em></span>
+ <span class="emphasis"><em>x(t)</em></span> and perform a timestep of length <span class="emphasis"><em>dt</em></span>
to obtain the approximate state <span class="emphasis"><em>x(t+dt)</em></span>. There exist
many different methods to perform such a timestep each of which has a certain
order <span class="emphasis"><em>q</em></span>. If the order of a method is <span class="emphasis"><em>q</em></span>
than it is accurate up to term <span class="emphasis"><em>~dt^q</em></span> that means the
error in <span class="emphasis"><em>x</em></span> made by such a step is <span class="emphasis"><em>~dt^(q+1)</em></span>.
odeint provides several steppers of different orders from which you can
- choose. There are three types of steppers: <span class="bold"><strong>Stepper</strong></span>,
- <span class="bold"><strong>ErrorStepper</strong></span> and <span class="bold"><strong>ControlledStepper</strong></span>.
+ choose:
</p>
<div class="table">
-<a name="id574628"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
+<a name="id368985"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -176,12 +175,12 @@
<tr>
<td>
<p>
- Euler
+ Explicit Euler
</p>
</td>
<td>
<p>
- stepper_euler
+ explicit_euler
</p>
</td>
<td>
@@ -203,7 +202,7 @@
</td>
<td>
<p>
- stepper_rk4
+ explicit_rkrk4
</p>
</td>
<td>
@@ -225,7 +224,7 @@
</td>
<td>
<p>
- stepper_rk5_ck
+ explicit_error_rk54_ck
</p>
</td>
<td>
@@ -242,75 +241,36 @@
<tr>
<td>
<p>
- Runge-Kutta Fehlberg
- </p>
- </td>
-<td>
- <p>
- stepper_rk78_fehlberg
- </p>
- </td>
-<td>
- <p>
- 7
- </p>
- </td>
-<td>
- <p>
- Yes (Order 8)
+ Dormand-Prince 5
</p>
</td>
-</tr>
-<tr>
<td>
<p>
- Midpoint
+ explicit_error_dopri5
</p>
</td>
<td>
<p>
- stepper_midpoint
- </p>
- </td>
-<td>
- <p>
- variable
- </p>
- </td>
-<td>
- <p>
- No
- </p>
- </td>
-</tr>
-<tr>
-<td>
- <p>
- Bulirsch-Stoer
- </p>
- </td>
-<td>
- <p>
- controlled_stepper_bs
- </p>
- </td>
-<td>
- <p>
- variable
+ 5
</p>
</td>
<td>
<p>
- Controlled
+ Yes (Order 4)
</p>
</td>
</tr>
</tbody>
</table></div>
</div>
-<br class="table-break">
+<br class="table-break"><p>
+ Some of steppers in the table above are special: Some need the Jacobian
+ of the ODE, others are constructed for special ODE-systems like Hamiltonian
+ systems. We will show typical examples and use cases in this tutorial and
+ which kind of steppers should be applied.
+ </p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.integration_with_constant_step_size"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.integration_with_constant_step_size" title="Integration with Constant Step Size">Integration
with Constant Step Size</a>
@@ -323,27 +283,44 @@
sort of validity check of your results (such as observing conserved quantities)
becasue you have no other control of the error. The following example defines
a basic stepper based on the classical Runge-Kutta scheme of 4th order.
- </p>
-<p>
- [define_const_stepper]
- </p>
-<p>
The declaration of the stepper requires the state type as template parameter.
The integration can now be done by using the <code class="computeroutput"><span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">Stepper</span><span class="special">,</span> <span class="identifier">System</span><span class="special">,</span> <span class="identifier">state</span><span class="special">,</span> <span class="identifier">start_time</span><span class="special">,</span> <span class="identifier">end_time</span><span class="special">,</span> <span class="identifier">step_size</span>
<span class="special">)</span></code> function from odeint:
</p>
<p>
- [integrate_const]
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="identifier">explicit_rk4</span><span class="special"><</span> <span class="identifier">state_type</span> <span class="special">></span> <span class="identifier">stepper</span><span class="special">;</span>
+<span class="identifier">integrate_const</span><span class="special">(</span> <span class="identifier">stepper</span> <span class="special">,</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
</p>
<p>
This call integrates the system defined by <code class="computeroutput"><span class="identifier">harmonic_oscillator</span></code>
using the rk4 method from t=0 to 10 with a stepsize dt=0.01 and the initial
condition given in <code class="computeroutput"><span class="identifier">x</span></code>. The
result, <span class="emphasis"><em>x(t=10)</em></span> is stored in <code class="computeroutput"><span class="identifier">x</span></code>
- (in-place).
+ (in-place). Each stepper defines a <code class="computeroutput"><span class="identifier">do_step</span></code>
+ method which can used directly. So, you write down the above example as
+ </p>
+<p>
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">for</span><span class="special">(</span> <span class="keyword">double</span> <span class="identifier">t</span><span class="special">=</span><span class="number">0.0</span> <span class="special">;</span> <span class="identifier">t</span><span class="special"><</span><span class="number">10.0</span> <span class="special">;</span> <span class="identifier">t</span><span class="special">+=</span> <span class="identifier">dt</span> <span class="special">)</span>
+ <span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">harmonic_oscillator</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.integration_with_adaptive_step_size"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator.integration_with_adaptive_step_size" title="Integration with Adaptive Step Size">Integration
with Adaptive Step Size</a>
@@ -358,7 +335,16 @@
4th order error estimation and coefficients introduced by Cash-Karp.
</p>
<p>
- [define_adapt_stepper]
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">explicit_error_rk54_ck</span><span class="special"><</span> <span class="identifier">state_type</span> <span class="special">></span> <span class="identifier">error_stepper_type</span><span class="special">;</span>
+<span class="identifier">error_stepper_type</span> <span class="identifier">rk54</span><span class="special">;</span>
+</pre>
+<p>
+ </p>
+<p>
</p>
<p>
Given the error stepper, one still needs an instance that checks the error
@@ -382,7 +368,17 @@
stepper create by <code class="computeroutput"><span class="identifier">make_controlled_stepper_standard</span></code>.
</p>
<p>
- [integrate_adapt]
+ </p>
+<p>
+
+</p>
+<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">controlled_error_stepper</span><span class="special"><</span> <span class="identifier">error_stepper_type</span> <span class="special">></span> <span class="identifier">controlled_stepper_type</span>
+<span class="identifier">controlled_stepper_type</span> <span class="identifier">controlled_stepper</span><span class="special">;</span>
+<span class="identifier">integrate_adaptive</span><span class="special">(</span> <span class="identifier">controlled_stepper</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="number">0.0</span> <span class="special">,</span> <span class="number">10.0</span> <span class="special">,</span> <span class="number">0.01</span> <span class="special">);</span>
+</pre>
+<p>
+ </p>
+<p>
</p>
<p>
As above, this integrates the system defined by <code class="computeroutput"><span class="identifier">harmonic_oscillator</span></code>
@@ -391,13 +387,22 @@
condition given in x. The result, x(t=10), will also be stored in x (in-place).
</p>
</div>
+<p>
+ [Some details]
+ </p>
+<p>
+ Observers
+ </p>
+<p>
+ Default construction
+ </p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.solar_system"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.solar_system" title="Solar system">Solar
system</a>
</h3></div></div></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.solar_system.gravitation_and_energy_conservation"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.solar_system.gravitation_and_energy_conservation" title="Gravitation and energy conservation">Gravitation
and energy conservation</a>
@@ -452,7 +457,7 @@
or where the equations of motion can be written in the form dqi=mi pi dpi=f(qi).
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.solar_system.define_the_system_function"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.solar_system.define_the_system_function" title="Define the system function">Define
the system function</a>
@@ -500,7 +505,7 @@
</p>
</div>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.chaotic_systems_and_lyapunov_exponents"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.chaotic_systems_and_lyapunov_exponents" title="Chaotic systems and Lyapunov exponents">Chaotic
systems and Lyapunov exponents</a>
@@ -509,7 +514,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.stiff_systems"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.stiff_systems" title="Stiff systems">Stiff
systems</a>
@@ -518,7 +523,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.different_steppers"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.different_steppers" title="Different steppers">Different
steppers</a>
@@ -539,12 +544,12 @@
Overview and table
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics" title="Special topics">Special
topics</a>
</h3></div></div></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.complex_state_types"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.complex_state_types" title="Complex state types">Complex
state types</a>
@@ -559,7 +564,7 @@
DNLS
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.lattice_systems"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.lattice_systems" title="Lattice systems">Lattice
systems</a>
@@ -568,7 +573,7 @@
Fermi-Pasta-Ulam system
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.partial_differential_equations"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.partial_differential_equations" title="Partial differential equations">Partial
differential equations</a>
@@ -583,7 +588,7 @@
Ginzburg-Landau
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.using_boost__units"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.using_boost__units" title="Using boost::units">Using
boost::units</a>
@@ -592,7 +597,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.using_cuda_and_thrust"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.using_cuda_and_thrust" title="Using Cuda and Thrust">Using
Cuda and Thrust</a>
@@ -601,7 +606,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.using_matrices_as_state_types"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.using_matrices_as_state_types" title="Using matrices as state types">Using
matrices as state types</a>
@@ -610,11 +615,11 @@
Expanding resizing
</p>
</div>
-<div class="section"><div class="titlepage"><div><div><h4 class="title">
+<div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.ordinary_differential_equations_on_networks"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.ordinary_differential_equations_on_networks" title="Ordinary differential equations on networks">Ordinary
differential equations on networks</a>
</h4></div></div></div></div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.pass_by_value_or_by_reference"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.pass_by_value_or_by_reference" title="Pass by value or by reference">Pass
by value or by reference</a>
@@ -623,7 +628,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.using_boost__range"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.using_boost__range" title="Using boost::range">Using
boost::range</a>
@@ -632,7 +637,7 @@
blah blah
</p>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.special_topics.using_arbitrary_precision_floating_point_types"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.special_topics.using_arbitrary_precision_floating_point_types" title="Using arbitrary precision floating point types">Using
arbitrary precision floating point types</a>
@@ -642,7 +647,7 @@
</p>
</div>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.tutorial.references"></a><a class="link" href="tutorial.html#boost_sandbox_numeric_odeint.tutorial.references" title="References">References</a>
</h3></div></div></div>
@@ -699,7 +704,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../odeint/short_example.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="extend_odeint.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="short_example.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extend_odeint.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,15 +3,15 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter 1. boost.sandbox.numeric.odeint</title>
<link rel="stylesheet" href="boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="next" href="odeint/overview.html" title="Overview">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="odeint/overview.html"><img src="images/next.png" alt="Next"></a></div>
-<div class="chapter">
+<div class="spirit-nav"><a accesskey="n" href="odeint/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
+<div class="chapter" lang="en">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="odeint"></a>Chapter 1. boost.sandbox.numeric.odeint</h2></div>
@@ -23,7 +23,7 @@
</h3></div></div>
<div><p class="copyright">Copyright © 2009 Karsten Ahnert and Mario Mulansky</p></div>
<div><div class="legalnotice">
-<a name="id563832"></a><p>
+<a name="id358089"></a><p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
</p>
@@ -33,7 +33,7 @@
<p><b>Table of Contents</b></p>
<dl>
<dt><span class="section">Overview</span></dt>
-<dt><span class="section">Short Example</span></dt>
+<dt><span class="section">Short Example</span></dt>
<dt><span class="section">Tutorial</span></dt>
<dd><dl>
<dt><span class="section"><a href="boost_sandbox_numeric_odeint/tutorial.html#boost_sandbox_numeric_odeint.tutorial.harmonic_oscillator">Harmonic
@@ -87,10 +87,10 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: January 30, 2011 at 19:12:57 GMT</small></p></td>
+<td align="left"><p><small>Last revised: March 17, 2011 at 15:42:07 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="odeint/overview.html"><img src="images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="odeint/overview.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/odeint/overview.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/odeint/overview.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/odeint/overview.html 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -3,19 +3,19 @@
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Overview</title>
<link rel="stylesheet" href="../boostbook.css" type="text/css">
-<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
-<link rel="home" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
+<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
+<link rel="start" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="prev" href="../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
-<link rel="next" href="short_example.html" title="Short Example">
+<link rel="next" href="../boost_sandbox_numeric_odeint/short_example.html" title="Short Example">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="short_example.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost_sandbox_numeric_odeint/short_example.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
-<div class="section">
+<div class="section" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="odeint.overview"></a><a class="link" href="overview.html" title="Overview">Overview</a>
</h2></div></div></div>
@@ -33,7 +33,7 @@
for real life problems and serves just as illustrative example. In <span class="bold"><strong>odeint</strong></span>, the following algorithms are implemented:
</p>
<div class="table">
-<a name="id533054"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
+<a name="id326511"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -211,7 +211,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="../index.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="short_example.html"><img src="../images/next.png" alt="Next"></a>
+<a accesskey="p" href="../index.html"><img src="../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../boost_sandbox_numeric_odeint/short_example.html"><img src="../../../../../doc/html/images/next.png" alt="Next"></a>
</div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/standalone_HTML.manifest
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/standalone_HTML.manifest (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/standalone_HTML.manifest 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -1,6 +1,6 @@
index.html
odeint/overview.html
-odeint/short_example.html
+boost_sandbox_numeric_odeint/short_example.html
boost_sandbox_numeric_odeint/tutorial.html
boost_sandbox_numeric_odeint/extend_odeint.html
boost_sandbox_numeric_odeint/concepts.html
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/odeint.qbk
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/odeint.qbk (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/odeint.qbk 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -44,57 +44,7 @@
[endsect]
-[section Short Example]
-This section gives a quick introduction to the most important features of the
-library using a number of instructive examples.
-Image, for example, you want to numerically integrate a harmonic oscillator
-with friction. The equations of motion are given by x'' = -x + gamma x'.
-This can be transformed to a system of two first-order differential equations
-with new variables x and p=x'. To apply numerical integration one first has to
-design the right hand side of the equation w' = f(w) where in this case
-w = (x,p):
-
-[import ../examples/doc_harm_osc.cpp]
-[rhs_function]
-
-Here we chose [*vector<double>] as the state type, but others are also possible,
-for example [*tr1/array<double,2>]. Odeint is designed in such a way that it
-works with basically any container that can be accessed via iterators.
-The parameter structure of the function is crucial: the integration methods will
-always call them in the form [*f(x, dxdt, t)]. So even if there is no explicit
-time dependence, one has to define [*t] as a function parameter.
-
-Now, we have to define the initial state from which the integration should start:
-
-[state_initialization]
-
-For the integration itself we'll use the
-[funcref boost::numeric::odeint::integrate integrate] function, which is a
-convenient way to get quick results. It is based on the error-controlled
-[classref boost::numeric::odeint::runge_kutta_rk5_ck runge_kutta_rk5_ck] stepper
-(5th order) and uses adaptive stepsize.
-The results are stored into two InsertIterators (time and state) that must be
-provided.
-
-[integration]
-
-The integrate function expects as parameters the rhs of the ode as defined
-above, the initial state x, the start- and end-time of the integration and two
-InsertIterators for the times and states where the current time and the current
-state after each timestep is stored.
-Note, that [funcref boost::numeric::odeint::integrate integrate] uses an
-adaptive stepsize during the integration steps so the time points will not be
-equally spaced.
-The integration returns the number of steps that were applied.
-Note, that in total steps+1 elements will be inserted into times and x_t_vec as
-the initial time and state are inserted before the first step.
-
-It is, of course, also possible to implement the ode system as a class. The rhs
-must then be defined as the ()-operator:
-
-[rhs_class]
-
-[endsect]
+[include short_example.qbk]
[include tutorial.qbk]
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/short_example.qbk
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/short_example.qbk 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -0,0 +1,55 @@
+[section Short Example]
+This section gives a quick introduction to the most important features of the
+library using a number of instructive examples.
+Image, for example, you want to numerically integrate a harmonic oscillator
+with friction. The equations of motion are given by x'' = -x + gamma x'.
+This can be transformed to a system of two first-order differential equations
+with new variables x and p=x'. To apply numerical integration one first has to
+design the right hand side of the equation w' = f(w) where in this case
+w = (x,p):
+
+[import ../examples/harmonic_oscillator.cpp]
+[rhs_function]
+
+Here we chose [*vector<double>] as the state type, but others are also possible,
+for example [*tr1/array<double,2>]. Odeint is designed in such a way that it
+works with basically any container that can be accessed via iterators.
+The parameter structure of the function is crucial: the integration methods will
+always call them in the form [*f(x, dxdt, t)]. So even if there is no explicit
+time dependence, one has to define [*t] as a function parameter.
+
+Now, we have to define the initial state from which the integration should start:
+
+[state_initialization]
+
+For the integration itself we'll use the
+[funcref boost::numeric::odeint::integrate integrate] function, which is a
+convenient way to get quick results. It is based on the error-controlled
+[classref boost::numeric::odeint::runge_kutta_rk5_ck runge_kutta_rk5_ck] stepper
+(5th order) and uses adaptive stepsize.
+The results are stored into two InsertIterators (time and state) that must be
+provided.
+
+[integration]
+
+The integrate function expects as parameters the rhs of the ode as defined
+above, the initial state x, the start- and end-time of the integration and two
+InsertIterators for the times and states where the current time and the current
+state after each timestep is stored.
+Note, that [funcref boost::numeric::odeint::integrate integrate] uses an
+adaptive stepsize during the integration steps so the time points will not be
+equally spaced.
+The integration returns the number of steps that were applied.
+Note, that in total steps+1 elements will be inserted into times and x_t_vec as
+the initial time and state are inserted before the first step.
+
+It is, of course, also possible to implement the ode system as a class. The rhs
+must then be defined as the ()-operator:
+
+[rhs_class]
+
+which can be used via
+
+[integration_class]
+
+[endsect]
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/stepper_table.qbk
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/stepper_table.qbk 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -0,0 +1,7 @@
+[table Stepper Algorithms
+ [[Method] [Class] [Order] [Error Estimation]]
+ [[Explicit Euler] [explicit_euler] [1] [No]]
+ [[Runge-Kutta 4] [explicit_rkrk4] [4] [No]]
+ [[Runge-Kutta Cash-Karp] [explicit_error_rk54_ck] [5] [Yes (Order 4)]]
+ [[Dormand-Prince 5] [explicit_error_dopri5] [5] [Yes (Order 4)]]
+]
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_harmonic_oscillator.qbk 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -1,19 +1,12 @@
[section Harmonic oscillator]
[section Define the ODE]
+
First of all, you have to specify the datatype that represents a state of your
system [*x]. Mathematically, this usually is an n-dimensional vector with
real numbers or complex numbers as scalar objects. For odeint the most natural
way is to use `vector< double >` or `vector< complex< double > >` to represent
-the system state. However, odeint can deal with other container types as well, e.g. `tr1/array< double , N >` as long as it is able to obtain
-a ForwardIterator going through all of the container's elements. The scalar type
-must have several operations ( + , - , += , -= ) and the `abs()`-function defined.
-Furthermore, one can choose the datatype of the time (that is, the parameter to
-which respect the differentiation is done). The standard type for this is
-`double`, but it should be possible to use, for example, `complex< double >` as
-well (untested). It must be possible to multiply the time type and the scalar
-type of the vector. For the most cases `vector< double >` as state type and the
-standard `double` for the time type should be sufficient.
+the system state. However, odeint can deal with other container types as well, e.g. `tr1::array< double , N >` as long as it is fullfils some requirements defined below.
To integrate a differential equation numerically, one has to define the rhs of
the equation ['x' = f(x)]. In odeint you supply this function in terms of
@@ -40,23 +33,16 @@
[section Stepper Types]
Numerical integration works iteratively, that means you start at a state ['x(t)]
-and performs a timestep of length ['dt] to obtain the approximate state
+and perform a timestep of length ['dt] to obtain the approximate state
['x(t+dt)]. There exist many different methods to perform such a timestep each
of which has a certain order ['q]. If the order of a method is ['q] than it is
accurate up to term ['~dt^q] that means the error in ['x] made by such a step
is ['~dt^(q+1)]. odeint provides several steppers of different orders from which
-you can choose. There are three types of steppers: [*Stepper], [*ErrorStepper]
-and [*ControlledStepper].
+you can choose:
+
+[include stepper_table.qbk]
-[table Stepper Algorithms
- [[Method] [Class] [Order] [Error Estimation]]
- [[Euler] [stepper_euler] [1] [No]]
- [[Runge-Kutta 4] [stepper_rk4] [4] [No]]
- [[Runge-Kutta Cash-Karp] [stepper_rk5_ck] [5] [Yes (Order 4)]]
- [[Runge-Kutta Fehlberg] [stepper_rk78_fehlberg] [7] [Yes (Order 8)]]
- [[Midpoint] [stepper_midpoint] [variable] [No]]
- [[Bulirsch-Stoer] [controlled_stepper_bs] [variable] [Controlled]]
-]
+Some of steppers in the table above are special: Some need the Jacobian of the ODE, others are constructed for special ODE-systems like Hamiltonian systems. We will show typical examples and use cases in this tutorial and which kind of steppers should be applied.
[endsect]
@@ -68,19 +54,17 @@
enough to have reasonable small errors. However, you should apply some sort of
validity check of your results (such as observing conserved quantities) becasue
you have no other control of the error. The following example defines a basic
-stepper based on the classical Runge-Kutta scheme of 4th order.
-
-[define_const_stepper]
-
-The declaration of the stepper requires the state type as template parameter.
+stepper based on the classical Runge-Kutta scheme of 4th order. The declaration of the stepper requires the state type as template parameter.
The integration can now be done by using the `integrate_const( Stepper, System,
state, start_time, end_time, step_size )` function from odeint:
-[integrate_const]
+[define_const_stepper]
This call integrates the system defined by `harmonic_oscillator` using the rk4
method from t=0 to 10 with a stepsize dt=0.01 and the initial condition given
-in `x`. The result, ['x(t=10)] is stored in `x` (in-place).
+in `x`. The result, ['x(t=10)] is stored in `x` (in-place). Each stepper defines a `do_step` method which can used directly. So, you write down the above example as
+
+[integrate_const_loop]
[endsect]
@@ -123,4 +107,10 @@
[endsect]
+[Some details]
+
+Observers
+
+Default construction
+
[endsect]
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/Jamfile 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -11,7 +11,8 @@
: build-dir .
;
-# exe harmonic_oscillator : harmonic_oscillator.cpp ;
+
+exe harmonic_oscillator : harmonic_oscillator.cpp ;
# exe solar_system : solar_system.cpp point_type.hpp ;
exe stiff_system : stiff_system.cpp ;
\ No newline at end of file
Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_harm_osc.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_harm_osc.cpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
+++ (empty file)
@@ -1,70 +0,0 @@
-#include <iostream>
-
-#include <boost/numeric/odeint.hpp>
-
-//[ rhs_function
-/* The type of container used to hold the state vector */
-typedef std::vector<double> state_type;
-
-const double gam = 0.15;
-
-/* The rhs of x' = f(x) */
-void harmonic_oscillator(const state_type &x, state_type &dxdt, const double t)
-{
- dxdt[0] = x[1];
- dxdt[1] = -x[0] - gam*x[1];
-}
-//]
-
-//[ rhs_class
-class harm_osc {
-
- double m_gam;
-
-public:
- harm_osc( double gam ) : m_gam(gam) { }
-
- void operator() (const state_type &x, state_type &dxdt, const double t)
- {
- dxdt[0] = x[1];
- dxdt[1] = -x[0] - m_gam*x[1];
- }
-};
-//]
-
-int main(int argc, char **argv)
-{
- using namespace std;
- using namespace boost::numeric::odeint;
-
- //[ state_initialization
- state_type x(2);
- x[0] = 1.0; // start at x=1.0, p=0.0
- x[1] = 0.0;
- //]
-
- //[ integration
- vector<double> times;
- vector<state_type> x_t_vec;
-
- size_t steps = integrate( harmonic_oscillator ,
- x , 0.0 , 10.0 ,
- back_inserter( times ) ,
- back_inserter( x_t_vec ) );
- //]
-
- /* the same as above using the class */
- /*
- harm_osc ho(0.15);
- steps = integrate( ho ,
- x , 0.0 , 10.0 ,
- back_inserter( times ) ,
- back_inserter( x_t_vec ) );
- */
-
- //[ output
- for( size_t i=0; i<=steps; i++ ) { //initial state is 0th entry
- cout << times[i] << '\t' << x_t_vec[i][0] << '\t' << x_t_vec[i][1] << '\n';
- }
- //]
-}
Deleted: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_integrate.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/doc_integrate.cpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
+++ (empty file)
@@ -1,61 +0,0 @@
-#include <iostream>
-
-#include <boost/numeric/odeint.hpp>
-
-using namespace std;
-
-/* The type of container used to hold the state vector */
-typedef std::vector<double> state_type;
-
-class harm_osc {
-
- double m_gam;
-
-public:
- harm_osc( double gam ) : m_gam(gam) { }
-
- void operator() (const state_type &x, state_type &dxdt, const double t)
- {
- dxdt[0] = x[1];
- dxdt[1] = -x[0] - m_gam*x[1];
- }
-};
-
-int main(int argc, char **argv)
-{
- using namespace std;
- using namespace boost::numeric::odeint;
-
- state_type x(2);
- x[0] = 1.0; // start at x=1.0, p=0.0
- x[1] = 0.0;
-
- harm_osc harmonic_oscillator(0.15);
-
- //[ define_const_stepper
- stepper_euler< state_type > euler;
- //]
-
- //[ integrate_const
- integrate_const( euler, harmonic_oscillator, x , 0.0, 10.0 , 0.01);
- //]
-
-
- //[ define_adapt_stepper
- stepper_half_step< stepper_euler< state_type > > half_stepper;
- //]
-
- //[ define_conntrolled_stepper
- controlled_stepper_standard<
- stepper_half_step< stepper_euler< state_type > > >
- controlled_rk5( 1E-6 , 1E-7 , 1.0 , 1.0 );
- //]
-
- //[ integrate_adapt
- integrate_adaptive( controlled_rk5 ,
- harmonic_oscillator, x, 0.0, 10.0, 0.01 );
- //]
-
- cout << x[0] << '\t' << x[1] << endl;
-
-}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/harmonic_oscillator.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/harmonic_oscillator.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/harmonic_oscillator.cpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -4,12 +4,12 @@
//[ rhs_function
/* The type of container used to hold the state vector */
-typedef std::vector<double> state_type;
+typedef std::vector< double > state_type;
const double gam = 0.15;
/* The rhs of x' = f(x) */
-void harmonic_oscillator(const state_type &x, state_type &dxdt, const double t)
+void harmonic_oscillator( const state_type &x , state_type &dxdt , const double t )
{
dxdt[0] = x[1];
dxdt[1] = -x[0] - gam*x[1];
@@ -24,7 +24,7 @@
public:
harm_osc( double gam ) : m_gam(gam) { }
- void operator() (const state_type &x, state_type &dxdt, const double t)
+ void operator() ( const state_type &x , state_type &dxdt , const double t )
{
dxdt[0] = x[1];
dxdt[1] = -x[0] - m_gam*x[1];
@@ -43,6 +43,8 @@
x[1] = 0.0;
//]
+
+/*
//[ integration
vector<double> times;
vector<state_type> x_t_vec;
@@ -53,18 +55,44 @@
back_inserter( x_t_vec ) );
//]
- /* the same as above using the class */
- /*
+
+ //[ output
+ for( size_t i=0; i<=steps; i++ ) { //initial state is 0th entry
+ cout << times[i] << '\t' << x_t_vec[i][0] << '\t' << x_t_vec[i][1] << '\n';
+ }
+ //]
+
+
+ //[ integration_class
harm_osc ho(0.15);
steps = integrate( ho ,
x , 0.0 , 10.0 ,
back_inserter( times ) ,
back_inserter( x_t_vec ) );
- */
+ //]
+*/
- //[ output
- for( size_t i=0; i<=steps; i++ ) { //initial state is 0th entry
- cout << times[i] << '\t' << x_t_vec[i][0] << '\t' << x_t_vec[i][1] << '\n';
- }
+
+ //[ define_const_stepper
+ explicit_rk4< state_type > stepper;
+ integrate( stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 , do_nothing_observer() );
+ //]
+
+ //[ integrate_const_loop
+ const double dt = 0.01;
+ for( double t=0.0 ; t<10.0 ; t+= dt )
+ stepper.do_step( harmonic_oscillator , x , t , dt );
+ //]
+
+
+ //[ define_adapt_stepper
+ typedef explicit_error_rk54_ck< state_type > error_stepper_type;
+ error_stepper_type rk54;
+ //]
+
+ //[ integrate_adapt
+ typedef controlled_error_stepper< error_stepper_type > controlled_stepper_type;
+ controlled_stepper_type controlled_stepper;
+ integrate_adaptive( controlled_stepper , harmonic_oscillator , x , 0.0 , 10.0 , 0.01 );
//]
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/regression_test/integrate_functions.cpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -5,7 +5,10 @@
* Author: karsten
*/
+#include <fstream>
+#include <iostream>
#include <tr1/array>
+#include <vector>
#include <boost/numeric/odeint/stepper/implicit_euler.hpp>
#include <boost/numeric/odeint/stepper/rosenbrock4.hpp>
@@ -20,17 +23,6 @@
#include <boost/numeric/odeint/integrate/integrate.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/if.hpp>
-#include <boost/lambda/loops.hpp>
-#include <boost/lambda/switch.hpp>
-#include <boost/lambda/construct.hpp>
-#include <boost/lambda/casts.hpp>
-#include <boost/lambda/exceptions.hpp>
-#include <boost/lambda/numeric.hpp>
-#include <boost/lambda/algorithm.hpp>
-
const double sigma = 10.0;
const double R = 28.0;
@@ -90,24 +82,26 @@
-using namespace std;
using namespace boost::numeric::odeint;
-using namespace boost::lambda;
-
struct tmp_func
{
+ std::ostream &m_out;
+ tmp_func( std::ostream &out ) : m_out( out ) { }
+
template< class T1 , class T2 >
void operator()( const T1 &t1 , const T2 &t2 ) const
{
- cout << t1 << " " << t2 << "\n";
+// m_out << t2 << " " << t1 << "\n";
}
};
int main( int argc , char **argv )
{
+ using namespace std;
+
state_type x1 = { { 10.0 , 10.0 , 10.0 } };
- vector_type x2( 3 );
+ vector_type x2( 3 , 10.0 );
// integrate( implicit_euler< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 , do_nothing_observer() );
// integrate_n_steps( implicit_euler< double >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 1000 , 0.1 );
@@ -121,37 +115,55 @@
// integrate_n_steps( rosenbrock4_controller< rosenbrock4< double > >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 1000 , 0.1 );
// integrate_adaptive( rosenbrock4_controller< rosenbrock4< double > >() , make_pair( lorenz() , lorenz_jacobi() ) , x2 , 0.0 , 10.0 , 0.1 );
-// integrate( explicit_euler< state_type >() , lorenz() , x1 , 0.0 , 10.0 , 0.01 , tmp_func() );
-// integrate( explicit_euler< state_type >() , lorenz() , x1 , 0.0 , 1.0 , 0.01 , cout << _1 << "\n" );
+
+ integrate( explicit_euler< state_type >() , lorenz() , x1 , 0.0 , 0.1001 , 0.01 , tmp_func( cout ) );
// integrate_n_steps( explicit_euler< state_type >() , lorenz() , x1 , 0.0 , 0.1 , 100 , cout << _1 << "\n" );
// integrate_adaptive( explicit_euler< state_type >() , lorenz() , x1 , 0.0 , 10.0 , 0.1 , cout << _1 << "\n" );
- // works
-// size_t num_of_steps = integrate(
-// controlled_error_stepper< explicit_error_rk54_ck< state_type > >() ,
-// lorenz() , x1 , 0.0 , 50.0 , 0.1 , tmp_func() );
-// clog << num_of_steps << endl;
-
- // works
-// num_of_steps = integrate_adaptive(
-// controlled_error_stepper< explicit_error_rk54_ck< state_type > >() ,
-// lorenz() , x1 , 0.0 , 50.0 , 0.1 , tmp_func() );
-// clog << num_of_steps << endl;
-
-
- // seems to work, check
- typedef explicit_error_dopri5< state_type > dopri5_type;
- typedef controlled_error_stepper< dopri5_type > controlled_error_stepper_type;
- typedef dense_output_controlled_explicit_fsal< controlled_error_stepper_type > stepper_type;
-
- controlled_error_stepper_type controlled_stepper(
- dopri5_type() , error_checker_standard< double >( 1.0e-1 , 0.1 ) );
- size_t num_of_steps = integrate(
- stepper_type( controlled_stepper ) , lorenz() , x1 , 0.0 , 50.0 , 0.001 , tmp_func() );
- clog << num_of_steps << endl;
+
+ {
+ // works
+ ofstream fout( "integrate_controlled_rk54.dat" );
+ size_t num_of_steps = integrate(
+ controlled_error_stepper< explicit_error_rk54_ck< state_type > >() ,
+ lorenz() , x1 , 0.0 , 50.0 , 0.1 , tmp_func( fout ) );
+ clog << "Integrate controlled error stepper rk54 " << num_of_steps << endl;
+ }
+
+
+
+ {
+ // seem to work, check
+ typedef explicit_error_dopri5< state_type > dopri5_type;
+ typedef controlled_error_stepper< dopri5_type > controlled_error_stepper_type;
+ typedef dense_output_controlled_explicit_fsal< controlled_error_stepper_type > stepper_type;
+
+ controlled_error_stepper_type controlled_stepper(
+ dopri5_type() , default_error_checker< double >( 1.0e-1 , 0.1 ) );
+
+ ofstream fout( "integrate_controlled_dopri5.dat" );
+ size_t num_of_steps = integrate(
+ stepper_type( controlled_stepper ) , lorenz() , x1 , 0.0 , 50.0 , 0.001 , tmp_func( fout ) );
+ clog << "Integrate denseoutput controlled dopri5 " << num_of_steps << endl;
+ }
+
+ {
+ // seem to work, check
+ typedef explicit_error_dopri5< state_type > dopri5_type;
+ typedef controlled_error_stepper< dopri5_type > controlled_error_stepper_type;
+ typedef dense_output_controlled_explicit_fsal< controlled_error_stepper_type > stepper_type;
+
+ controlled_error_stepper_type controlled_stepper(
+ dopri5_type() , default_error_checker< double >( 1.0e-1 , 0.1 ) );
+
+ ofstream fout( "integrate_adpative_controlled_dopri5.dat" );
+ size_t num_of_steps = integrate_adaptive(
+ stepper_type( controlled_stepper ) , lorenz() , x1 , 0.0 , 50.0 , 0.001 , tmp_func( fout ) );
+ clog << "Integrate adaptive denseoutput controlled dopri5 " << num_of_steps << endl;
+ }
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/test/stepper_concepts.cpp 2011-03-17 13:08:41 EDT (Thu, 17 Mar 2011)
@@ -337,7 +337,7 @@
{
vector_type x( 1 , 2.0 );
typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::value_type > error_checker;
+ default_error_checker< typename ControlledStepper::value_type > error_checker;
ControlledStepper controlled_stepper( error_stepper , error_checker );
check_controlled_stepper_concept( controlled_stepper , constant_system_vector , x );
check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_vector_class() ) , x );
@@ -353,7 +353,7 @@
vector_space_type x;
x.m_x = 2.0;
typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::value_type , vector_space_algebra > error_checker;
+ default_error_checker< typename ControlledStepper::value_type , vector_space_algebra > error_checker;
ControlledStepper controlled_stepper( error_stepper , error_checker );
check_controlled_stepper_concept( controlled_stepper , constant_system_vector_space , x );
check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_vector_space_class() ) , x );
@@ -369,7 +369,7 @@
array_type x;
x[0] = 2.0;
typename ControlledStepper::stepper_type error_stepper;
- error_checker_standard< typename ControlledStepper::value_type > error_checker;
+ default_error_checker< typename ControlledStepper::value_type > error_checker;
ControlledStepper controlled_stepper( error_stepper , error_checker );
check_controlled_stepper_concept( controlled_stepper , constant_system_array , x );
check_controlled_stepper_concept( controlled_stepper , boost::cref( constant_system_array_class() ) , x );
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk