- odeint-v2.zip
- odeint-v2
- boost
- numeric
- doc
- index.html
- Jamroot
- libs
- numeric
- odeint
- code_analyzer
- doc
- concepts.qbk
- concepts
- controlled_stepper.qbk
- dense_output_stepper.qbk
- error_stepper.qbk
- implicit_system.qbk
- observer.qbk
- state_algebra_operations.qbk
- state_wrapper.qbk
- stepper.qbk
- symplectic_system.qbk
- system.qbk
- concepts_old.qbk
- details.qbk
- examples_table.qbk
- extend.qbk
- getting_started.qbk
- html
- boostbook.css
- phase_lattice_2d_0000.jpg
- phase_lattice_2d_0100.jpg
- phase_lattice_2d_1000.jpg
- solar_system.jpg
- Jamfile
- make_controlled_table.qbk
- make_dense_output_table.qbk
- odeint.qbk
- reference.xml
- reference_integrate_functions.qbk
- reference_old.qbk
- reference_steppers.qbk
- stepper_table.qbk
- tutorial.qbk
- tutorial_chaotic_system.qbk
- tutorial_harmonic_oscillator.qbk
- tutorial_solar_system.qbk
- tutorial_special_topics.qbk
- tutorial_stiff_systems.qbk
- tutorial_thrust_cuda.qbk
- examples
- ideas
- performance
- regression_test
- test
- test_external
- README
- tex
- TODO
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Basic stepper</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<link rel="start" href="../../index.html" title="Chapter 1. boost.sandbox.numeric.odeint">
<link rel="up" href="../old_concepts.html" title="Old Concepts">
<link rel="prev" href="../old_concepts.html" title="Old Concepts">
<link rel="next" href="error_stepper.html" title="Error stepper">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../old_concepts.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../old_concepts.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="error_stepper.html"><img src="../../images/next.png" alt="Next"></a>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_sandbox_numeric_odeint.old_concepts.basic_stepper"></a><a class="link" href="basic_stepper.html" title="Basic stepper">Basic
stepper</a>
</h3></div></div></div>
<p>
Basic steppers execute one timestep of a specific order with a given stepsize.
They usually allocate internal memory to store intermediate function call
results. If state types with variable size are used (e.g. <code class="computeroutput"><span class="identifier">vector</span></code>),
it has to be assured that the stepper gets informed about any change of the
state size by calling its <code class="computeroutput"><span class="identifier">adjust_size</span></code>
method.
</p>
<p>
<span class="bold"><strong>Associated Types</strong></span>
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
</th>
<th>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
Time
</p>
</td>
<td>
<p>
Stepper::time_type
</p>
</td>
<td>
<p>
Type of the time variable, e.g. <code class="computeroutput"><span class="keyword">double</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
Container
</p>
</td>
<td>
<p>
Stepper::container_type
</p>
</td>
<td>
<p>
Type of the system state, e.g. <code class="computeroutput"><span class="identifier">vector</span><span class="special"><</span><span class="keyword">double</span><span class="special">></span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
Value
</p>
</td>
<td>
<p>
Stepper::value_type
</p>
</td>
<td>
<p>
Value type of the state, e.g. <code class="computeroutput"><span class="keyword">double</span></code>
</p>
</td>
</tr>
<tr>
<td>
<p>
Order Type
</p>
</td>
<td>
<p>
Stepper::order_type
</p>
</td>
<td>
<p>
Type of the order parameter, usually <code class="computeroutput"><span class="keyword">unsigned</span>
<span class="keyword">short</span></code>
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
<span class="bold"><strong>Methods</strong></span>
</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>
</ul></div>
<p>
Executes one timestep with the given parameters:
</p>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Parameter
</p>
</th>
<th>
<p>
Type
</p>
</th>
<th>
<p>
Description
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
system
</p>
</td>
<td>
<p>
DynamicalSystem
</p>
</td>
<td>
<p>
Function (callable object) that computes the rhs of the ode
</p>
</td>
</tr>
<tr>
<td>
<p>
x
</p>
</td>
<td>
<p>
container_type
</p>
</td>
<td>
<p>
The current state of the system <span class="bold"><strong>x(t)</strong></span>
</p>
</td>
</tr>
<tr>
<td>
<p>
t
</p>
</td>
<td>
<p>
time_type
</p>
</td>
<td>
<p>
The current time <span class="bold"><strong>t</strong></span>
</p>
</td>
</tr>
<tr>
<td>
<p>
dt
</p>
</td>
<td>
<p>
time_type
</p>
</td>
<td>
<p>
Length of the timestep to be executed
</p>
</td>
</tr>
</tbody>
</table></div>
<p>
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>
<p>
The same as above but with the additional parameter <code class="computeroutput"><span class="identifier">dxdt</span></code>
that represents the derivative <span class="bold"><strong>x'(t) = f(x,t)</strong></span>
at the time <span class="bold"><strong>t</strong></span>.
</p>
<div class="itemizedlist"><ul type="disc">
<li>
<code class="computeroutput"><span class="keyword">void</span> <span class="identifier">adjust_size</span><span class="special">(</span> <span class="keyword">const</span> <span class="identifier">container_type</span> <span class="special">&</span><span class="identifier">x</span> <span class="special">)</span></code>
Adjusts the internal memory to store intermediate results of the same
size as <code class="computeroutput"><span class="identifier">x</span></code>. This function
<span class="emphasis"><em>must</em></span> be called whenever the system size changes
during the integration.
</li>
<li>
<code class="computeroutput"><span class="identifier">order_type</span> <span class="identifier">order_step</span><span class="special">()</span></code> Returns the order of the algorithm.
If <span class="bold"><strong>n</strong></span> is the order of a method, then
the result of one iteration with the timestep <span class="bold"><strong>dt</strong></span>
is accurate up to <span class="bold"><strong>dt^n</strong></span>. That means the
error made by the time discretization is of order <span class="bold"><strong>dt^(n+1)</strong></span>.
</li>
</ul></div>
<p>
<span class="bold"><strong>Stepper that model this concept</strong></span>
</p>
<div class="itemizedlist"><ul type="disc">
<li>
<code class="computeroutput"><span class="identifier">stepper_euler</span></code>
</li>
<li>
<code class="computeroutput"><span class="identifier">stepper_rk4</span></code>
</li>
<li>
<code class="computeroutput"><span class="identifier">stepper_rk78_fehlberg</span></code>
</li>
</ul></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2009 -2011 Karsten Ahnert and Mario Mulansky<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../old_concepts.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../old_concepts.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="error_stepper.html"><img src="../../images/next.png" alt="Next"></a>
</div>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.