|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70117 - in sandbox/odeint/branches/karsten/libs/numeric/odeint: doc doc/html doc/html/boost_sandbox_numeric_odeint examples
From: karsten.ahnert_at_[hidden]
Date: 2011-03-18 06:24:03
Author: karsten
Date: 2011-03-18 06:23:49 EDT (Fri, 18 Mar 2011)
New Revision: 70117
URL: http://svn.boost.org/trac/boost/changeset/70117
Log:
documentation
Text files modified:
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/getting_started.qbk | 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 | 88 +++++++++++-
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 | 42 ++++-
sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/html/index.html | 8
sandbox/odeint/branches/karsten/libs/numeric/odeint/examples/harmonic_oscillator.cpp | 35 ++++
8 files changed, 277 insertions(+), 185 deletions(-)
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/getting_started.qbk
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/getting_started.qbk (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/doc/getting_started.qbk 2011-03-18 06:23:49 EDT (Fri, 18 Mar 2011)
@@ -48,6 +48,10 @@
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 as well as the initial time step. 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.
+[integrate_observer]
+
+[integrate_observ]
+
It is, of course, also possible to implement the ode system as a class. The rhs must then be implemented as a functor having defined the ()-operator:
[rhs_class]
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-18 06:23:49 EDT (Fri, 18 Mar 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-03-18 06:23:49 EDT (Fri, 18 Mar 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-03-18 06:23:49 EDT (Fri, 18 Mar 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">
@@ -48,7 +48,7 @@
as illustrative example. In odeint, the following algorithms are implemented:
</p>
<div class="table">
-<a name="id518202"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
+<a name="id326495"></a><p class="title"><b>Table 1.1. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -331,7 +331,9 @@
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>
@@ -346,6 +348,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>
@@ -361,13 +365,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>
@@ -376,16 +384,17 @@
stepper (5th order) and uses adaptive stepsize.
</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>
+<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
@@ -396,11 +405,60 @@
were applied.
</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>
+ <span class="identifier">vector</span><span class="special"><</span> <span class="identifier">state_type</span> <span class="special">>&</span> <span class="identifier">m_states</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">m_time</span><span class="special">;</span>
+
+ <span class="identifier">push_back_state_and_time</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="special">&</span><span class="identifier">states</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="special">&</span><span class="identifier">times</span> <span class="special">)</span>
+ <span class="special">:</span> <span class="identifier">m_states</span><span class="special">(</span> <span class="identifier">states</span> <span class="special">)</span> <span class="special">,</span> <span class="identifier">m_times</span><span class="special">(</span> <span class="identifier">times</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="keyword">const</span> <span class="identifier">state_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">,</span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="identifier">m_states</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> <span class="identifier">x</span> <span class="special">);</span>
+ <span class="identifier">m_times</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span> <span class="identifier">t</span> <span class="special">);</span>
+ <span class="special">}</span>
+<span class="special">};</span>
+</pre>
+<p>
+ </p>
+<p>
+ </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>
+
+<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>
+ <span class="identifier">push_back_state_and_time</span><span class="special">(</span> <span class="identifier">x_vec</span> <span class="special">,</span> <span class="identifier">times</span> <span class="special">)</span>
+ <span class="special">);</span>
+
+<span class="comment">// output
+</span><span class="keyword">for</span><span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span><span class="special">=</span><span class="number">0</span><span class="special">;</span> <span class="identifier">i</span><span class="special"><=</span><span class="identifier">steps</span><span class="special">;</span> <span class="identifier">i</span><span class="special">++</span> <span class="special">)</span>
+<span class="special">{</span>
+ <span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">times</span><span class="special">[</span><span class="identifier">i</span><span class="special">]</span> <span class="special"><<</span> <span class="char">'\t'</span> <span class="special"><<</span> <span class="identifier">x_t_vec</span><span class="special">[</span><span class="identifier">i</span><span class="special">][</span><span class="number">0</span><span class="special">]</span> <span class="special"><<</span> <span class="char">'\t'</span> <span class="special"><<</span> <span class="identifier">x_t_vec</span><span class="special">[</span><span class="identifier">i</span><span class="special">][</span><span class="number">1</span><span class="special">]</span> <span class="special"><<</span> <span class="char">'\n'</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+<p>
+ </p>
+<p>
It is, of course, also possible to implement the ode system as a class. The
rhs must then be implemented as a functor having defined 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>
@@ -417,12 +475,16 @@
<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>
@@ -430,6 +492,8 @@
<span class="special">);</span>
</pre>
<p>
+ </p>
+<p>
</p>
</div>
</div>
@@ -443,7 +507,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-03-18 06:23:49 EDT (Fri, 18 Mar 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="id565007"></a><p class="title"><b>Table 1.3. Stepper Algorithms</b></p>
+<a name="id374081"></a><p class="title"><b>Table 1.3. 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-03-18 06:23:49 EDT (Fri, 18 Mar 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">
@@ -75,7 +75,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>
@@ -90,6 +92,8 @@
<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>
@@ -103,7 +107,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>
@@ -120,6 +126,8 @@
<span class="special">};</span>
</pre>
<p>
+ </p>
+<p>
</p>
<p>
odeint can deal with instances of such classes instead of pure functions
@@ -143,7 +151,7 @@
choose:
</p>
<div class="table">
-<a name="id560646"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
+<a name="id369858"></a><p class="title"><b>Table 1.2. Stepper Algorithms</b></p>
<div class="table-contents"><table class="table" summary="Stepper Algorithms">
<colgroup>
<col>
@@ -406,12 +414,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>
@@ -422,13 +434,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">
@@ -446,12 +462,16 @@
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
@@ -475,13 +495,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>
@@ -844,7 +868,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-03-18 06:23:49 EDT (Fri, 18 Mar 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>
@@ -93,10 +93,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: March 17, 2011 at 19:18:46 GMT</small></p></td>
+<td align="left"><p><small>Last revised: March 18, 2011 at 09:58:43 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/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-18 06:23:49 EDT (Fri, 18 Mar 2011)
@@ -32,6 +32,25 @@
};
//]
+
+//[ integrate_observer
+struct push_back_state_and_time
+{
+ vector< state_type >& m_states;
+ vector< double >& m_time;
+
+ push_back_state_and_time( vector< state_type > &states , vector< double > × )
+ : m_states( states ) , m_times( times ) { }
+
+ void operator()( const state_type &x , double t )
+ {
+ m_states.push_back( x );
+ m_times.push_back( t );
+ }
+};
+//]
+
+
int main(int argc, char **argv)
{
using namespace std;
@@ -45,17 +64,23 @@
//[ integration
- vector<double> times;
- vector<state_type> x_t_vec;
-
size_t steps = integrate( harmonic_oscillator ,
x , 0.0 , 10.0 , 0.1
);
//]
+ //[ integrate_observ
+ vector<state_type> x_vec;
+ vector<double> times;
+
+ size_t steps = integrate( harmonic_oscillator ,
+ x , 0.0 , 10.0 , 0.1 ,
+ push_back_state_and_time( x_vec , times )
+ );
- //[ output
- for( size_t i=0; i<=steps; i++ ) { //initial state is 0th entry
+ // output
+ for( size_t i=0; i<=steps; i++ )
+ {
cout << times[i] << '\t' << x_t_vec[i][0] << '\t' << x_t_vec[i][1] << '\n';
}
//]
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