1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Controlled Stepper</title> 5<link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../index.html" title="Chapter 1. Boost.Numeric.Odeint"> 8<link rel="up" href="../concepts.html" title="Concepts"> 9<link rel="prev" href="error_stepper.html" title="Error Stepper"> 10<link rel="next" href="dense_output_stepper.html" title="Dense Output Stepper"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../logo.jpg"></td> 15<td align="center"><a href="../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="error_stepper.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="dense_output_stepper.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="section"> 26<div class="titlepage"><div><div><h3 class="title"> 27<a name="boost_numeric_odeint.concepts.controlled_stepper"></a><a class="link" href="controlled_stepper.html" title="Controlled Stepper">Controlled 28 Stepper</a> 29</h3></div></div></div> 30<p> 31 This concept specifies the interface a controlled stepper has to fulfill 32 to be used within <a class="link" href="../odeint_in_detail/integrate_functions.html" title="Integrate functions">integrate 33 functions</a>. 34 </p> 35<h5> 36<a name="boost_numeric_odeint.concepts.controlled_stepper.h0"></a> 37 <span class="phrase"><a name="boost_numeric_odeint.concepts.controlled_stepper.description"></a></span><a class="link" href="controlled_stepper.html#boost_numeric_odeint.concepts.controlled_stepper.description">Description</a> 38 </h5> 39<p> 40 A controlled stepper following this Controlled Stepper concept provides the 41 possibility to perform one step of the solution <span class="emphasis"><em>x(t)</em></span> 42 of an ODE with step-size <span class="emphasis"><em>dt</em></span> to obtain <span class="emphasis"><em>x(t+dt)</em></span> 43 with a given step-size <span class="emphasis"><em>dt</em></span>. Depending on an error estimate 44 of the solution the step might be rejected and a smaller step-size is suggested. 45 </p> 46<h5> 47<a name="boost_numeric_odeint.concepts.controlled_stepper.h1"></a> 48 <span class="phrase"><a name="boost_numeric_odeint.concepts.controlled_stepper.associated_types"></a></span><a class="link" href="controlled_stepper.html#boost_numeric_odeint.concepts.controlled_stepper.associated_types">Associated 49 types</a> 50 </h5> 51<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 52<li class="listitem"> 53 <p><span class="bold"><strong>state_type</strong></span></p> 54<p><code class="computeroutput"><span class="identifier">Stepper</span><span class="special">::</span><span class="identifier">state_type</span></code></p> 55<p>The 56 type characterizing the state of the ODE, hence <span class="emphasis"><em>x</em></span>.</p> 57 </li> 58<li class="listitem"> 59 <p><span class="bold"><strong>deriv_type</strong></span></p> 60<p><code class="computeroutput"><span class="identifier">Stepper</span><span class="special">::</span><span class="identifier">deriv_type</span></code></p> 61<p>The 62 type characterizing the derivative of the ODE, hence <span class="emphasis"><em>d x/dt</em></span>.</p> 63 </li> 64<li class="listitem"> 65 <p><span class="bold"><strong>time_type</strong></span></p> 66<p><code class="computeroutput"><span class="identifier">Stepper</span><span class="special">::</span><span class="identifier">time_type</span></code></p> 67<p>The 68 type characterizing the dependent variable of the ODE, hence the time 69 <span class="emphasis"><em>t</em></span>.</p> 70 </li> 71<li class="listitem"> 72 <p><span class="bold"><strong>value_type</strong></span></p> 73<p><code class="computeroutput"><span class="identifier">Stepper</span><span class="special">::</span><span class="identifier">value_type</span></code></p> 74<p>The 75 numerical data type which is used within the stepper, something like 76 <code class="computeroutput"><span class="keyword">float</span></code>, <code class="computeroutput"><span class="keyword">double</span></code>, 77 <code class="computeroutput"><span class="identifier">complex</span><span class="special">&</span><span class="identifier">lt</span><span class="special">;</span> <span class="keyword">double</span> <span class="special">&</span><span class="identifier">gt</span><span class="special">;</span></code>.</p> 78 </li> 79<li class="listitem"> 80 <p><span class="bold"><strong>stepper_category</strong></span></p> 81<p><code class="computeroutput"><span class="identifier">Stepper</span><span class="special">::</span><span class="identifier">stepper_category</span></code></p> 82<p>A 83 tag type characterizing the category of the stepper. This type must be 84 convertible to <code class="computeroutput"><span class="identifier">controlled_stepper_tag</span></code>.</p> 85 </li> 86</ul></div> 87<h5> 88<a name="boost_numeric_odeint.concepts.controlled_stepper.h2"></a> 89 <span class="phrase"><a name="boost_numeric_odeint.concepts.controlled_stepper.notation"></a></span><a class="link" href="controlled_stepper.html#boost_numeric_odeint.concepts.controlled_stepper.notation">Notation</a> 90 </h5> 91<div class="variablelist"> 92<p class="title"><b></b></p> 93<dl class="variablelist"> 94<dt><span class="term"><code class="computeroutput"><span class="identifier">ControlledStepper</span></code></span></dt> 95<dd><p> 96 A type that is a model of Controlled Stepper 97 </p></dd> 98<dt><span class="term"><code class="computeroutput"><span class="identifier">State</span></code></span></dt> 99<dd><p> 100 A type representing the state <span class="emphasis"><em>x</em></span> of the ODE 101 </p></dd> 102<dt><span class="term"><code class="computeroutput"><span class="identifier">Time</span></code></span></dt> 103<dd><p> 104 A type representing the time <span class="emphasis"><em>t</em></span> of the ODE 105 </p></dd> 106<dt><span class="term"><code class="computeroutput"><span class="identifier">stepper</span></code></span></dt> 107<dd><p> 108 An object of type <code class="computeroutput"><span class="identifier">ControlledStepper</span></code> 109 </p></dd> 110<dt><span class="term"><code class="computeroutput"><span class="identifier">x</span></code></span></dt> 111<dd><p> 112 Object of type <code class="computeroutput"><span class="identifier">State</span></code> 113 </p></dd> 114<dt><span class="term"><code class="computeroutput"><span class="identifier">t</span></code>, <code class="computeroutput"><span class="identifier">dt</span></code></span></dt> 115<dd><p> 116 Objects of type <code class="computeroutput"><span class="identifier">Time</span></code> 117 </p></dd> 118<dt><span class="term"><code class="computeroutput"><span class="identifier">sys</span></code></span></dt> 119<dd><p> 120 An object defining the ODE, should be a model of <a class="link" href="system.html" title="System">System</a>, 121 <a class="link" href="symplectic_system.html" title="Symplectic System">Symplectic 122 System</a>, <a class="link" href="simple_symplectic_system.html" title="Simple Symplectic System">Simple 123 Symplectic System</a> or <a class="link" href="implicit_system.html" title="Implicit System">Implicit 124 System</a>. 125 </p></dd> 126</dl> 127</div> 128<h5> 129<a name="boost_numeric_odeint.concepts.controlled_stepper.h3"></a> 130 <span class="phrase"><a name="boost_numeric_odeint.concepts.controlled_stepper.valid_expressions"></a></span><a class="link" href="controlled_stepper.html#boost_numeric_odeint.concepts.controlled_stepper.valid_expressions">Valid 131 Expressions</a> 132 </h5> 133<div class="informaltable"><table class="table"> 134<colgroup> 135<col> 136<col> 137<col> 138<col> 139</colgroup> 140<thead><tr> 141<th> 142 <p> 143 Name 144 </p> 145 </th> 146<th> 147 <p> 148 Expression 149 </p> 150 </th> 151<th> 152 <p> 153 Type 154 </p> 155 </th> 156<th> 157 <p> 158 Semantics 159 </p> 160 </th> 161</tr></thead> 162<tbody><tr> 163<td> 164 <p> 165 Do step 166 </p> 167 </td> 168<td> 169 <p> 170</p> 171<pre xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="table-programlisting"><span class="identifier">stepper</span><span class="special">.</span><span class="identifier">try_step</span><span class="special">(</span> <span class="identifier">sys</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> 172<p> 173 </p> 174 </td> 175<td> 176 <p> 177 <code class="computeroutput"><span class="identifier">controlled_step_result</span></code> 178 </p> 179 </td> 180<td> 181 <p> 182 Tries one step of step size <code class="computeroutput"><span class="identifier">dt</span></code>. 183 If the step was successful, <code class="computeroutput"><span class="identifier">success</span></code> 184 is returned, the resulting state is written to <code class="computeroutput"><span class="identifier">x</span></code>, 185 the new time is stored in <code class="computeroutput"><span class="identifier">t</span></code> 186 and <code class="computeroutput"><span class="identifier">dt</span></code> now contains 187 a new (possibly larger) step-size for the next step. If the error 188 was too big, <code class="computeroutput"><span class="identifier">rejected</span></code> 189 is returned and the results are neglected - <code class="computeroutput"><span class="identifier">x</span></code> 190 and <code class="computeroutput"><span class="identifier">t</span></code> are unchanged 191 and <code class="computeroutput"><span class="identifier">dt</span></code> now contains 192 a reduced step-size to be used for the next try. 193 </p> 194 </td> 195</tr></tbody> 196</table></div> 197<h5> 198<a name="boost_numeric_odeint.concepts.controlled_stepper.h4"></a> 199 <span class="phrase"><a name="boost_numeric_odeint.concepts.controlled_stepper.models"></a></span><a class="link" href="controlled_stepper.html#boost_numeric_odeint.concepts.controlled_stepper.models">Models</a> 200 </h5> 201<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 202<li class="listitem"> 203 <code class="computeroutput"><span class="identifier">controlled_error_stepper</span><span class="special"><</span> <span class="identifier">runge_kutta_cash_karp54</span> 204 <span class="special">></span></code> 205 </li> 206<li class="listitem"> 207 <code class="computeroutput"><span class="identifier">controlled_error_stepper_fsal</span><span class="special"><</span> <span class="identifier">runge_kutta_dopri5</span> 208 <span class="special">></span></code> 209 </li> 210<li class="listitem"> 211 <code class="computeroutput"><span class="identifier">controlled_error_stepper</span><span class="special"><</span> <span class="identifier">runge_kutta_fehlberg78</span> 212 <span class="special">></span></code> 213 </li> 214<li class="listitem"> 215 <code class="computeroutput"><span class="identifier">rosenbrock4_controller</span></code> 216 </li> 217<li class="listitem"> 218 <code class="computeroutput"><span class="identifier">bulirsch_stoer</span></code> 219 </li> 220</ul></div> 221</div> 222<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 223<td align="left"></td> 224<td align="right"><div class="copyright-footer">Copyright © 2009-2015 Karsten Ahnert and Mario Mulansky<p> 225 Distributed under the Boost Software License, Version 1.0. (See accompanying 226 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>) 227 </p> 228</div></td> 229</tr></table> 230<hr> 231<div class="spirit-nav"> 232<a accesskey="p" href="error_stepper.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="dense_output_stepper.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a> 233</div> 234</body> 235</html> 236