|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71005 - in sandbox/odeint/branches/karsten: boost/numeric/odeint/integrate libs/numeric/odeint/doc libs/numeric/odeint/doc/html libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint libs/numeric/odeint/examples
From: karsten.ahnert_at_[hidden]
Date: 2011-04-05 13:33:22
Author: karsten
Date: 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
New Revision: 71005
URL: http://svn.boost.org/trac/boost/changeset/71005
Log:
chaotic system example
Added:
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk (contents, props changed)
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/chaotic_system.cpp (contents, props changed)
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/gram_schmitt.hpp (contents, props changed)
Text files modified:
sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate_n_steps.hpp | 4
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/concepts.html | 275 ++++++++++++++++++---------------------
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/extend_odeint.html | 4
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/getting_started.html | 48 +++++-
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/reference.html | 6
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/tutorial.html | 115 +++++++++++++---
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html | 8
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial.qbk | 6
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/Jamfile | 3
9 files changed, 271 insertions(+), 198 deletions(-)
Modified: sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate_n_steps.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate_n_steps.hpp (original)
+++ sandbox/odeint/branches/karsten/boost/numeric/odeint/integrate/integrate_n_steps.hpp 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -31,7 +31,7 @@
Time start_time , Time dt , size_t num_of_steps ,
Observer observer )
{
- Time end_time = dt * num_of_steps;
+ Time end_time = start_time + dt * num_of_steps;
// we want to get as fast as possible to the end
if( boost::is_same< do_nothing_observer , Observer >::type::value )
@@ -57,7 +57,7 @@
Time start_time , Time dt , size_t num_of_steps ,
Observer observer )
{
- Time end_time = dt * num_of_steps;
+ Time end_time = start_time + dt * num_of_steps;
// we want to get as fast as possible to the end
if( boost::is_same< do_nothing_observer , Observer >::type::value )
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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -13,7 +13,7 @@
<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" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -59,8 +59,12 @@
</colgroup>
<thead><tr>
<th>
+ <p>
+ </p>
</th>
<th>
+ <p>
+ </p>
</th>
<th>
<p>
@@ -145,25 +149,23 @@
</p>
<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>
+<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,16 +268,14 @@
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 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>
+<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>
@@ -283,33 +283,26 @@
</p>
<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>
+<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 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>
+<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" lang="en">
@@ -339,26 +332,24 @@
</p>
<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>
+<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,17 +471,15 @@
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 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>
+<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>
@@ -498,33 +487,26 @@
</p>
<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>
+<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 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>
+<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" lang="en">
@@ -547,13 +529,11 @@
<p>
<span class="bold"><strong>Methods</strong></span>
</p>
-<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>
+<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
@@ -574,18 +554,20 @@
</p>
<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>
+<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
@@ -700,37 +682,30 @@
</p>
<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>
+<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>
+<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 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>
+<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" lang="en"><div class="titlepage"><div><div><h3 class="title">
@@ -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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -13,7 +13,7 @@
<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" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -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/getting_started.html
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/getting_started.html (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/boost_sandbox_numeric_odeint/getting_started.html 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -13,7 +13,7 @@
<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="tutorial.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="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">
@@ -52,7 +52,7 @@
algorithms are implemented:
</p>
<div class="table">
-<a name="id518246"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
+<a name="id326539"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -369,7 +369,9 @@
= (x,p)</em></span>:
</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>
@@ -384,6 +386,8 @@
<span class="special">}</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
Here we chose <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code>
@@ -399,13 +403,17 @@
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>
@@ -414,12 +422,16 @@
stepper (5th order) and uses adaptive stepsize.
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><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="number">0.1</span> <span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The integrate function expects as parameters the rhs of the ode as defined
@@ -435,7 +447,9 @@
rhs must then be implemented as a functor having defined the ()-operator:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="comment">/* The rhs of x' = f(x) defined as a class */</span>
<span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
@@ -453,18 +467,24 @@
<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="number">0.1</span> <span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
You surely have already noticed that during the integration a lot of steps
@@ -473,7 +493,9 @@
to provide a reasonable observer. An example is
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">push_back_state_and_time</span>
<span class="special">{</span>
@@ -491,13 +513,17 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
which stores the intermediate steps in a container. Now, you only have to
pass this container to the integration function:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="identifier">vector</span><span class="special"><</span><span class="identifier">state_type</span><span class="special">></span> <span class="identifier">x_vec</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">times</span><span class="special">;</span>
@@ -513,6 +539,8 @@
<span class="special">}</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
That is all. Of course, you can use functional libraries like Boost.Lambda
@@ -534,7 +562,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="tutorial.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="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/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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -12,7 +12,7 @@
<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" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -33,7 +33,7 @@
classes</a>
</h3></div></div></div>
<div class="table">
-<a name="id570933"></a><p class="title"><b>Table 1.4. Stepper Algorithms</b></p>
+<a name="id379450"></a><p class="title"><b>Table 1.4. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -241,7 +241,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>
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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -13,7 +13,7 @@
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="getting_started.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="getting_started.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" lang="en">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
@@ -73,7 +73,9 @@
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>
@@ -88,6 +90,8 @@
<span class="special">}</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The parameters of the function must follow the example above where <code class="computeroutput"><span class="identifier">x</span></code> is the current state, <code class="computeroutput"><span class="identifier">dxdt</span></code> is the derivative <span class="emphasis"><em>x'</em></span>
@@ -100,7 +104,9 @@
parameter structure as above:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="comment">/* The rhs of x' = f(x) defined as a class */</span>
<span class="keyword">class</span> <span class="identifier">harm_osc</span> <span class="special">{</span>
@@ -118,6 +124,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
odeint can deal with instances of such classes instead of pure functions
@@ -141,7 +149,7 @@
choose:
</p>
<div class="table">
-<a name="id561513"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
+<a name="id370055"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -436,12 +444,16 @@
<span class="special">)</span></code> function from odeint:
</p>
<p>
-
+ </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>
@@ -453,13 +465,17 @@
method which can used directly. So, you write down the above example as
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">0.01</span><span class="special">;</span>
<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" lang="en">
@@ -477,12 +493,16 @@
with 4th order error estimation and coefficients introduced by Cash-Karp.
</p>
<p>
-
+ </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
@@ -506,13 +526,17 @@
stepper create by <code class="computeroutput"><span class="identifier">make_controlled_stepper_standard</span></code>.
</p>
<p>
-
+ </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="special">;</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">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>
As above, this integrates the system defined by <code class="computeroutput"><span class="identifier">harmonic_oscillator</span></code>
@@ -618,7 +642,9 @@
space as well as the velocity. Therefore, we use the operators from Boost.Operators:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="comment">/*the point type */</span>
<span class="keyword">template</span><span class="special"><</span> <span class="keyword">class</span> <span class="identifier">T</span> <span class="special">,</span> <span class="identifier">size_t</span> <span class="identifier">Dim</span> <span class="special">></span>
@@ -649,6 +675,8 @@
</span><span class="comment">// more operators
</span></pre>
<p>
+ </p>
+<p>
</p>
<p>
The next step is to define a container type storing the values of <span class="emphasis"><em>q</em></span>
@@ -656,7 +684,9 @@
type we use <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tr1</span><span class="special">::</span><span class="identifier">array</span></code>
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="comment">// we simulate 5 planets and the sun
</span><span class="keyword">const</span> <span class="identifier">size_t</span> <span class="identifier">n</span> <span class="special">=</span> <span class="number">6</span><span class="special">;</span>
@@ -666,6 +696,8 @@
<span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><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> <span class="identifier">mass_type</span><span class="special">;</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The <code class="computeroutput"><span class="identifier">container_type</span></code> is different
@@ -679,7 +711,9 @@
As system function we have to provide <span class="emphasis"><em>f(p)</em></span> and <span class="emphasis"><em>f(q)</em></span>:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">gravitational_constant</span> <span class="special">=</span> <span class="number">2.95912208286e-4</span><span class="special">;</span>
@@ -697,9 +731,13 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">solar_system_momentum</span>
<span class="special">{</span>
@@ -727,6 +765,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
In general a three body-system is chaotic, hence we can not expect that
@@ -741,7 +781,9 @@
apply here:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">symplectic_rkn_sb3a_mclachlan</span><span class="special"><</span> <span class="identifier">container_type</span> <span class="special">></span> <span class="identifier">stepper_type</span><span class="special">;</span>
<span class="keyword">const</span> <span class="keyword">double</span> <span class="identifier">dt</span> <span class="special">=</span> <span class="number">100.0</span><span class="special">;</span>
@@ -753,6 +795,8 @@
<span class="number">0.0</span> <span class="special">,</span> <span class="number">200000.0</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">,</span> <span class="identifier">streaming_observer</span><span class="special">(</span> <span class="identifier">cout</span> <span class="special">)</span> <span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
These integration routine was used to produce the above sketch of the solar
@@ -765,7 +809,9 @@
is also passed, but this is not a problem at all:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">streaming_observer</span>
<span class="special">{</span>
@@ -784,6 +830,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The full example can be found here: ../../examples/solar_system.cpp
@@ -796,7 +844,16 @@
systems and Lyapunov exponents</a>
</h3></div></div></div>
<p>
- blah blah
+ show NR solution with pointers
+ </p>
+<p>
+ ranges
+ </p>
+<p>
+ templatized operator()
+ </p>
+<p>
+ gram schmitt
</p>
</div>
<div class="section" lang="en">
@@ -827,7 +884,9 @@
is needed. Here is the definition of the above example
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</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">vector_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">matrix</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span> <span class="identifier">matrix_type</span><span class="special">;</span>
@@ -855,6 +914,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
The state type has to be a <code class="computeroutput"><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">vector</span></code>
@@ -864,7 +925,9 @@
just templatize the <code class="computeroutput"><span class="keyword">operator</span><span class="special">()</span></code>:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</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">vector_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">numeric</span><span class="special">::</span><span class="identifier">ublas</span><span class="special">::</span><span class="identifier">matrix</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span> <span class="identifier">matrix_type</span><span class="special">;</span>
@@ -886,6 +949,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
Now you can use <code class="computeroutput"><span class="identifier">stiff_system</span></code>
@@ -900,7 +965,9 @@
all the other stepper:
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">rosenbrock4</span><span class="special"><</span> <span class="keyword">double</span> <span class="special">></span> <span class="identifier">stepper_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">rosenbrock4_controller</span><span class="special"><</span> <span class="identifier">stepper_type</span> <span class="special">></span> <span class="identifier">controlled_stepper_type</span><span class="special">;</span>
@@ -914,6 +981,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg2</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg1</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special"><<</span> <span class="string">"\n"</span> <span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
During the integration 71 steps have been done. Comparing to a classical
@@ -921,7 +990,9 @@
5 method with step size control and dense output yields 1531 steps.
</p>
<p>
-
+ </p>
+<p>
+
</p>
<pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">explicit_error_dopri5</span><span class="special"><</span> <span class="identifier">vector_type</span> <span class="special">></span> <span class="identifier">dopri5_type</span><span class="special">;</span>
<span class="keyword">typedef</span> <span class="identifier">controlled_error_stepper</span><span class="special"><</span> <span class="identifier">dopri5_type</span> <span class="special">></span> <span class="identifier">controlled_dopri5_type</span><span class="special">;</span>
@@ -934,6 +1005,8 @@
<span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg2</span> <span class="special"><<</span> <span class="string">" "</span> <span class="special"><<</span> <span class="identifier">phoenix</span><span class="special">::</span><span class="identifier">arg_names</span><span class="special">::</span><span class="identifier">arg1</span><span class="special">[</span><span class="number">0</span><span class="special">]</span> <span class="special"><<</span> <span class="string">"\n"</span> <span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
Note, that we have used Boost.Phoenix
@@ -1110,7 +1183,7 @@
The following table gives an overview over all examples.
</p>
<div class="table">
-<a name="id567901"></a><p class="title"><b>Table 1.3. Examples Overview</b></p>
+<a name="id376498"></a><p class="title"><b>Table 1.3. Examples Overview</b></p>
<div class="table-contents"><table class="table" summary="Examples Overview">
<colgroup>
<col>
@@ -1241,7 +1314,7 @@
</tr></table>
<hr>
<div class="spirit-nav">
-<a accesskey="p" href="getting_started.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="getting_started.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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -10,7 +10,7 @@
<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="boost_sandbox_numeric_odeint/getting_started.html"><img src="images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="boost_sandbox_numeric_odeint/getting_started.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">
@@ -23,7 +23,7 @@
</h3></div></div>
<div><p class="copyright">Copyright © 2009 -2011 Karsten Ahnert and Mario Mulansky</p></div>
<div><div class="legalnotice">
-<a name="id549573"></a><p>
+<a name="id358081"></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>
@@ -95,10 +95,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: April 04, 2011 at 08:33:19 GMT</small></p></td>
+<td align="left"><p><small>Last revised: April 05, 2011 at 07:39:00 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
-<div class="spirit-nav"><a accesskey="n" href="boost_sandbox_numeric_odeint/getting_started.html"><img src="images/next.png" alt="Next"></a></div>
+<div class="spirit-nav"><a accesskey="n" href="boost_sandbox_numeric_odeint/getting_started.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a></div>
</body>
</html>
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial.qbk
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial.qbk (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial.qbk 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -4,11 +4,7 @@
[include tutorial_solar_system.qbk]
-[section Chaotic systems and Lyapunov exponents]
-
-blah blah
-
-[endsect]
+[include tutorial_chaotic_system.qbk]
[include tutorial_stiff_systems.qbk]
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/tutorial_chaotic_system.qbk 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -0,0 +1,11 @@
+[section Chaotic systems and Lyapunov exponents]
+
+show NR solution with pointers
+
+ranges
+
+templatized operator()
+
+gram schmitt
+
+[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-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -14,4 +14,5 @@
exe harmonic_oscillator : harmonic_oscillator.cpp ;
exe solar_system : solar_system.cpp ;
-exe stiff_system : stiff_system.cpp ;
\ No newline at end of file
+exe chaotic_system : chaotic_system.cpp ;
+exe stiff_system : stiff_system.cpp ;
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/chaotic_system.cpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/chaotic_system.cpp 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -0,0 +1,115 @@
+/*
+ * chaotic_system.cpp
+ *
+ * This example demonstrates how one can use odeint to determine the Lyapunov
+ * exponents of a chaotic system namely the well known Lorenz system.
+ *
+ * Created on: Apr 5, 2011
+ * Author: karsten
+ */
+
+#include <iostream>
+
+#include <tr1/array>
+
+#include <boost/numeric/odeint.hpp>
+
+#include "gram_schmitt.hpp"
+
+using namespace std;
+using namespace boost::numeric::odeint;
+
+const size_t n = 3;
+const size_t num_of_lyap = 3;
+const size_t N = n + n*num_of_lyap;
+
+typedef std::tr1::array< double , N > state_type;
+typedef std::tr1::array< double , num_of_lyap > lyap_type;
+const double dt = 0.01;
+
+
+struct lorenz
+{
+ template< class State , class Deriv >
+ void operator()( const State &x_ , Deriv &dxdt_ , double t ) const
+ {
+ typename boost::range_iterator< const State >::type x = boost::begin( x_ );
+ typename boost::range_iterator< Deriv >::type dxdt = boost::begin( dxdt_ );
+
+ dxdt[0]=10.0*(x[1]-x[0]);
+ dxdt[1]=28.0*x[0]-x[1]-x[0]*x[2];
+ dxdt[2]=-2.666666666666*x[2]+x[0]*x[1];
+ }
+};
+
+void lorenz_with_lyap( const state_type &x , state_type &dxdt , double t )
+{
+ lorenz()( x , dxdt , t );
+
+ for( size_t l=0 ; l<num_of_lyap ; ++l )
+ {
+ const double *pert = x.begin() + 3 + l * 3;
+ double *dpert = dxdt.begin() + 3 + l * 3;
+ dpert[0] = -10.0 * pert[0] + 10.0 * pert[1];
+ dpert[1] = ( 28.0 - x[2] ) * pert[0] - pert[1] - x[0] * pert[2];
+ dpert[2] = x[1] * pert[0] + x[0] * pert[1] - 2.666666666666 * pert[2];
+ }
+}
+
+struct streaming
+{
+ template< class State , class Time >
+ void operator()( const State& x , const Time &t ) const
+ {
+ cout << t << "\t" << x[0] << "\t" << x[1] << "\t" << x[2] << "\n";
+ }
+};
+
+int main( int argc , char **argv )
+{
+ state_type x;
+ lyap_type lyap;
+ explicit_rk4< state_type > rk4;
+
+ fill( x.begin() , x.end() , 0.0 );
+ x[0] = 10.0 ; x[1] = 10.0 ; x[2] = 5.0;
+
+ const double dt = 0.1;
+
+ // 10000 transients steps
+ integrate_n_steps( rk4 , lorenz() , std::make_pair( x.begin() , x.begin() + n ) , 0.0 , dt , 10000 );
+
+ fill( x.begin()+n , x.end() , 0.0 );
+ for( size_t i=0 ; i<num_of_lyap ; ++i ) x[n+n*i+i] = 1.0;
+ fill( lyap.begin() , lyap.end() , 0.0 );
+
+ double t = 0.0;
+ size_t count = 0;
+ for( size_t i=0 ; i<x.size() ; ++i ) cout << "\t" << x[i];
+ cout << endl;
+ while( true )
+ {
+ t = integrate_n_steps( rk4 , lorenz_with_lyap , x , t , dt , 100 );
+ gram_schmitt( x , lyap , n , num_of_lyap );
+ ++count;
+ if( count == 1 )
+ {
+ for( size_t i=0 ; i<x.size() ; ++i ) cout << "\t" << x[i];
+ cout << endl;
+ }
+
+
+ if( !(count % 1) )
+ {
+ cout << t;
+ for( size_t i=0 ; i<num_of_lyap ; ++i )
+ cout << "\t" << lyap[i] / t ;
+ for( size_t i=0 ; i<x.size() ; ++i ) cout << "\t" << x[i];
+ cout << endl;
+ }
+
+ if( count == 2 ) break;
+ }
+
+ return 0;
+}
Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/gram_schmitt.hpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/gram_schmitt.hpp 2011-04-05 13:33:21 EDT (Tue, 05 Apr 2011)
@@ -0,0 +1,84 @@
+/*
+ boost header: numeric/odeint/gram_schmitt.hpp
+
+ Copyright 2009 Karsten Ahnert
+ Copyright 2009 Mario Mulansky
+ Copyright 2009 Andre Bergner
+
+ 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)
+*/
+
+#ifndef BOOST_NUMERIC_ODEINT_GRAM_SCHMITT_HPP_INCLUDED
+#define BOOST_NUMERIC_ODEINT_GRAM_SCHMITT_HPP_INCLUDED
+
+#include <iterator>
+#include <algorithm>
+#include <numeric>
+
+namespace boost {
+namespace numeric {
+namespace odeint {
+
+ template< class Iterator , class T >
+ void normalize( Iterator first , Iterator last , T norm )
+ {
+ while( first != last ) *first++ /= norm;
+ }
+
+ template< class Iterator , class T >
+ void substract_vector( Iterator first1 , Iterator last1 ,
+ Iterator first2 , T val )
+ {
+ while( first1 != last1 )
+ *first1++ -= val * *first2++;
+ }
+
+ template< class StateType , class LyapType >
+ void gram_schmitt( StateType &x , LyapType &lyap ,
+ size_t n , size_t num_of_lyap )
+ {
+ if( !num_of_lyap ) return;
+ if( ptrdiff_t( ( num_of_lyap + 1 ) * n ) != std::distance( x.begin() , x.end() ) )
+ throw std::domain_error( "renormalization() : size of state does not match the number of lyapunov exponents." );
+
+ typedef typename StateType::value_type value_type;
+ typedef typename StateType::iterator iterator;
+
+ value_type norm[num_of_lyap] , tmp[num_of_lyap];
+ iterator first = x.begin() + n;
+ iterator beg1 = first , end1 = first + n ;
+
+ std::fill( norm , norm+num_of_lyap , 0.0 );
+
+ // normalize first vector
+ norm[0] = sqrt( std::inner_product( beg1 , end1 , beg1 , 0.0 ) );
+ normalize( beg1 , end1 , norm[0] );
+
+ beg1 += n ;
+ end1 += n;
+
+ for( size_t j=1 ; j<num_of_lyap ; ++j , beg1+=n , end1+=n )
+ {
+ for( size_t k=0 ; k<j ; ++k )
+ tmp[k] = std::inner_product( beg1 , end1 , first + k*n , 0.0 );
+
+ for( size_t k=0 ; k<j ; ++k )
+ substract_vector( beg1 , end1 , first + k*n , tmp[k] );
+
+ // nromalize j-th vector
+ norm[j] = sqrt( std::inner_product( beg1 , end1 , beg1 , 0.0 ) );
+ normalize( beg1 , end1 , norm[j] );
+ }
+
+ for( size_t j=0 ; j<num_of_lyap ; j++ )
+ lyap[j] += log( norm[j] );
+ }
+
+
+} // namespace odeint
+} // namespace numeric
+} // namespace boost
+
+#endif //BOOST_NUMERIC_ODEINT_GRAM_SCHMITT_HPP_INCLUDED
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