<?xml version='1.0'?>
<?xml-stylesheet type='text/xsl' href='pmathml.xsl'?>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title>An Error Controller for ODE Solvers</title>
<meta name="description" id="description" content="An Error Controller for ODE Solvers"/>
<meta name="keywords" id="keywords" content=" Odeerrcontrol Ode control error differential equation "/>
<style type='text/css'>
body { color : black }
body { background-color : white }
A:link { color : blue }
A:visited { color : purple }
A:active { color : purple }
</style>
<script type='text/javascript' language='JavaScript' src='_odeerrcontrol_xml.js'>
</script>
</head>
<body>
<table><tr>
<td>
<a href="http://www.coin-or.org/CppAD/" target="_top"><img border="0" src="_image.gif"/></a>
</td>
<td><a href="rosen34.cpp.xml" target="_top">Prev</a>
</td><td><a href="odeerrcontrol.cpp.xml" target="_top">Next</a>
</td><td>
<select onchange='choose_across0(this)'>
<option>Index-&gt;</option>
<option>contents</option>
<option>reference</option>
<option>index</option>
<option>search</option>
<option>external</option>
</select>
</td>
<td>
<select onchange='choose_up0(this)'>
<option>Up-&gt;</option>
<option>CppAD</option>
<option>library</option>
<option>OdeErrControl</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>CppAD-&gt;</option>
<option>Install</option>
<option>Introduction</option>
<option>AD</option>
<option>ADFun</option>
<option>multi_thread</option>
<option>library</option>
<option>cppad_ipopt_nlp</option>
<option>Example</option>
<option>preprocessor</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>library-&gt;</option>
<option>ErrorHandler</option>
<option>NearEqual</option>
<option>speed_test</option>
<option>SpeedTest</option>
<option>time_test</option>
<option>NumericType</option>
<option>CheckNumericType</option>
<option>SimpleVector</option>
<option>CheckSimpleVector</option>
<option>nan</option>
<option>pow_int</option>
<option>Poly</option>
<option>LuDetAndSolve</option>
<option>RombergOne</option>
<option>RombergMul</option>
<option>Runge45</option>
<option>Rosen34</option>
<option>OdeErrControl</option>
<option>OdeGear</option>
<option>OdeGearControl</option>
<option>BenderQuad</option>
<option>opt_val_hes</option>
<option>LuRatio</option>
<option>CppAD_vector</option>
<option>thread_alloc</option>
<option>memory_leak</option>
</select>
</td>
<td>
<select onchange='choose_down0(this)'>
<option>OdeErrControl-&gt;</option>
<option>OdeErrControl.cpp</option>
<option>OdeErrMaxabs.cpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Syntax</option>
<option>Description</option>
<option>Include</option>
<option>Notation</option>
<option>xf</option>
<option>Method</option>
<option>---..step</option>
<option>---..Nan</option>
<option>---..order</option>
<option>ti</option>
<option>tf</option>
<option>xi</option>
<option>smin</option>
<option>smax</option>
<option>scur</option>
<option>eabs</option>
<option>erel</option>
<option>ef</option>
<option>maxabs</option>
<option>nstep</option>
<option>Error Criteria Discussion</option>
<option>Scalar</option>
<option>Vector</option>
<option>Example</option>
<option>Theory</option>
<option>Source Code</option>
</select>
</td>
</tr></table><br/>










 
<center><b><big><big>An Error Controller for ODE Solvers</big></big></b></center>
<br/>
<b><big><a name="Syntax" id="Syntax">Syntax</a></big></b>

<code><font color="blue"><br/>
# include &lt;cppad/ode_err_control.hpp&gt;</font></code>
<code><span style='white-space: nowrap'><br/>
</span></code><code><font color="blue"></font></code><i><span style='white-space: nowrap'>xf</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;OdeErrControl(</span></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>ti</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>tf</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>xi</span></i><code><font color="blue"><span style='white-space: nowrap'>,<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>smin</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>smax</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>scur</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>eabs</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>erel</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>ef</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;,&#xA0;</span></font></code><i><span style='white-space: nowrap'>maxabs</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>nstep</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;)</span></font></code>


<br/>
<br/>
<b><big><a name="Description" id="Description">Description</a></big></b>
<br/>
Let 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
</mrow></math>

 denote the real numbers
and let 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>F</mi>
<mo stretchy="false">:</mo>
<mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mo stretchy="false">&#x000D7;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
</mrow></math>

 be a smooth function.
We define 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">:</mo>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
</mrow></math>

 by 
the following initial value problem:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>xi</mi>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">'</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>F</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
</mtd></mtr></mtable>
</mrow></math>

The routine <code><font color="blue">OdeErrControl</font></code> can be used to adjust the step size
used an arbitrary integration methods in order to be as fast as possible
and still with in a requested error bound.

<br/>
<br/>
<b><big><a name="Include" id="Include">Include</a></big></b>
<br/>
The file <code><font color="blue">cppad/ode_err_control.hpp</font></code> is included by 
<code><font color="blue">cppad/cppad.hpp</font></code>
but it can also be included separately with out the rest of 
the <code><font color="blue">CppAD</font></code> routines.

<br/>
<br/>
<b><big><a name="Notation" id="Notation">Notation</a></big></b>
<br/>
The template parameter types <a href="odeerrcontrol.xml#Scalar" target="_top"><span style='white-space: nowrap'>Scalar</span></a>
 and
<a href="odeerrcontrol.xml#Vector" target="_top"><span style='white-space: nowrap'>Vector</span></a>
 are documented below.

<br/>
<br/>
<b><big><a name="xf" id="xf">xf</a></big></b>
<br/>
The return value <i>xf</i> has the prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;</span></font></code><i><span style='white-space: nowrap'>xf</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>(see description of <a href="odeerrcontrol.xml#Vector" target="_top"><span style='white-space: nowrap'>Vector</span></a>
 below). 
and the size of <i>xf</i> is equal to <i>n</i>.
If <i>xf</i> contains not a number <a href="nan.xml" target="_top"><span style='white-space: nowrap'>nan</span></a>
,
see the discussion of <a href="odeerrcontrol.xml#Method.Nan" target="_top"><span style='white-space: nowrap'>step</span></a>
.

<br/>
<br/>
<b><big><a name="Method" id="Method">Method</a></big></b>
<br/>
The class <i>Method</i>
and the object <i>method</i> satisfy the following syntax
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Method</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The object <i>method</i> must support <code><font color="blue">step</font></code> and 
<code><font color="blue">order</font></code> member functions defined below:

<br/>
<br/>
<b><a name="Method.step" id="Method.step">step</a></b>
<br/>
The syntax
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'>.step(</span></font></code><i><span style='white-space: nowrap'>ta</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>tb</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>xa</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>xb</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>eb</span></i><code><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>executes one step of the integration method. 
<code><font color="blue"><span style='white-space: nowrap'><br/>
<br/>
</span></font></code><i><span style='white-space: nowrap'>ta</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The argument <i>ta</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>ta</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It specifies the initial time for this step in the 
ODE integration.
(see description of <a href="odeerrcontrol.xml#Scalar" target="_top"><span style='white-space: nowrap'>Scalar</span></a>
 below). 
<code><font color="blue"><span style='white-space: nowrap'><br/>
<br/>
</span></font></code><i><span style='white-space: nowrap'>tb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The argument <i>tb</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>tb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It specifies the final time for this step in the 
ODE integration.
<code><font color="blue"><span style='white-space: nowrap'><br/>
<br/>
</span></font></code><i><span style='white-space: nowrap'>xa</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The argument <i>xa</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>xa</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
It specifies the value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>ta</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
(see description of <a href="odeerrcontrol.xml#Vector" target="_top"><span style='white-space: nowrap'>Vector</span></a>
 below). 
<code><font color="blue"><span style='white-space: nowrap'><br/>
<br/>
</span></font></code><i><span style='white-space: nowrap'>xb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The argument value <i>xb</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>xb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
The input value of its elements does not matter.
On output, 
it contains the approximation for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 that the method obtains.
<code><font color="blue"><span style='white-space: nowrap'><br/>
<br/>
</span></font></code><i><span style='white-space: nowrap'>eb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The argument value <i>eb</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>eb</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
The input value of its elements does not matter.
On output, 
it contains an estimate for the error in the approximation <i>xb</i>.
It is assumed (locally) that the error bound in this approximation 
nearly equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>K</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ta</mi>
<msup><mo stretchy="false">)</mo>
<mi mathvariant='italic'>m</mi>
</msup>
</mrow></math>

 
where <i>K</i> is a fixed constant and <i>m</i>
is the corresponding argument to <code><font color="blue">CodeControl</font></code>.

<br/>
<br/>
<b><a name="Method.Nan" id="Method.Nan">Nan</a></b>
<br/>
If any element of the vector <i>eb</i> or <i>xb</i> are
not a number <code><font color="blue">nan</font></code>,
the current step is considered to large.
If this happens with the current step size equal to <i>smin</i>, 
<code><font color="blue">OdeErrControl</font></code> returns with <i>xf</i> and <i>ef</i> as vectors
of <code><font color="blue">nan</font></code>.

<br/>
<br/>
<b><a name="Method.order" id="Method.order">order</a></b>
<br/>
If <i>m</i> is <code><font color="blue">size_t</font></code>,
the object <i>method</i> must also support the following syntax 
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>m</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'>.order()<br/>
</span></font></code>The return value <i>m</i> is the order of the error estimate;
i.e., there is a constant K such that if 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>ta</mi>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>tf</mi>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>eb</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">|</mo>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>K</mi>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ta</mi>
<msup><mo stretchy="false">|</mo>
<mi mathvariant='italic'>m</mi>
</msup>
</mrow></math>

where <i>ta</i>, <i>tb</i>, and <i>eb</i> are as in 
<code><font color="blue"></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'>.step(</span></font></code><i><span style='white-space: nowrap'>ta</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>tb</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>xa</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>xb</span></i><code><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font></code><i><span style='white-space: nowrap'>eb</span></i><code><font color="blue"><span style='white-space: nowrap'>)</span></font></code>


<br/>
<br/>
<b><big><a name="ti" id="ti">ti</a></big></b>
<br/>
The argument <i>ti</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>ti</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It specifies the initial time for the integration of 
the differential equation.


<br/>
<br/>
<b><big><a name="tf" id="tf">tf</a></big></b>
<br/>
The argument <i>tf</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>tf</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It specifies the final time for the integration of 
the differential equation.

<br/>
<br/>
<b><big><a name="xi" id="xi">xi</a></big></b>
<br/>
The argument <i>xi</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>xi</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
It specifies value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="smin" id="smin">smin</a></big></b>
<br/>
The argument <i>smin</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>smin</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The step size during a call to <i>method</i> is defined as
the corresponding value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ta</mi>
</mrow></math>

.
If 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>smin</mi>
</mrow></math>

,
the integration will be done in one step of size <i>tf - ti</i>.
Otherwise,
the minimum value of <i>tb - ta</i> will be 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>smin</mi>
</mrow></math>


except for the last two calls to <i>method</i> where it may be
as small as 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>smin</mi>
<mo stretchy="false">/</mo>
<mn>2</mn>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="smax" id="smax">smax</a></big></b>
<br/>
The argument <i>smax</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>smax</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>It specifies the maximum step size to use during the integration; 
i.e., the maximum value for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ta</mi>
</mrow></math>

 in a call to <i>method</i>.
The value of <i>smax</i> must be greater than or equal <i>smin</i>.

<br/>
<br/>
<b><big><a name="scur" id="scur">scur</a></big></b>
<br/>
The argument <i>scur</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>scur</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>The value of <i>scur</i> is the suggested next step size,
based on error criteria, to try in the next call to <i>method</i>.
On input it corresponds to the first call to <i>method</i>,
in this call to <code><font color="blue">OdeErrControl</font></code> (where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>ta</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>ti</mi>
</mrow></math>

).
On output it corresponds to the next call to <i>method</i>,
in a subsequent call to <code><font color="blue">OdeErrControl</font></code> (where <i>ta = tf</i>).

<br/>
<br/>
<b><big><a name="eabs" id="eabs">eabs</a></big></b>
<br/>
The argument <i>eabs</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>eabs</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
Each of the elements of <i>eabs</i> must be 
greater than or equal zero.
It specifies a bound for the absolute
error in the return value <i>xf</i> as an approximation for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
(see the 
<a href="odeerrcontrol.xml#Error Criteria Discussion" target="_top"><span style='white-space: nowrap'>error&#xA0;criteria&#xA0;discussion</span></a>
 
below). 

<br/>
<br/>
<b><big><a name="erel" id="erel">erel</a></big></b>
<br/>
The argument <i>erel</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;</span></font></code><i><span style='white-space: nowrap'>Scalar</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>erel</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and is greater than or equal zero.
It specifies a bound for the relative 
error in the return value <i>xf</i> as an approximation for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">)</mo>
</mrow></math>


(see the 
<a href="odeerrcontrol.xml#Error Criteria Discussion" target="_top"><span style='white-space: nowrap'>error&#xA0;criteria&#xA0;discussion</span></a>
 
below). 

<br/>
<br/>
<b><big><a name="ef" id="ef">ef</a></big></b>
<br/>
The argument value <i>ef</i> has prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>ef</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
The input value of its elements does not matter.
On output, 
it contains an estimated bound for the 
absolute error in the approximation <i>xf</i>; i.e.,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<msub><mi mathvariant='italic'>ef</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">&gt;</mo>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">-</mo>
<msub><mi mathvariant='italic'>xf</mi>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">|</mo>
</mrow></math>

If on output <i>ef</i> contains not a number <code><font color="blue">nan</font></code>,
see the discussion of <a href="odeerrcontrol.xml#Method.Nan" target="_top"><span style='white-space: nowrap'>step</span></a>
.

<br/>
<br/>
<b><big><a name="maxabs" id="maxabs">maxabs</a></big></b>
<br/>
The argument <i>maxabs</i> is optional in the call to <code><font color="blue">OdeErrControl</font></code>.
If it is present, it has the prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>Vector</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>maxabs</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>and size <i>n</i>.
The input value of its elements does not matter.
On output, 
it contains an estimate for the 
maximum absolute value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">)</mo>
</mrow></math>

; i.e.,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mi mathvariant='italic'>maxabs</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">&#x02248;</mo>
<mi>max</mi>
<mrow><mo stretchy="true">{</mo><mrow><mo stretchy="false">|</mo>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>t</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">|</mo>
<mspace width='.3em'/>
<mo stretchy="false">:</mo>
<mspace width='.3em'/>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">&#x02208;</mo>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">]</mo>
</mrow><mo stretchy="true">}</mo></mrow>
</mrow></math>

<br/>
<b><big><a name="nstep" id="nstep">nstep</a></big></b>
<br/>
The argument <i>nstep</i> is optional in the call to <code><font color="blue">OdeErrControl</font></code>.
If it is present, it has the prototype
<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font></code><i><span style='white-space: nowrap'>size_t</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&amp;</span></font></code><i><span style='white-space: nowrap'>nstep</span></i><code><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>Its input value does not matter and its output value
is the number of calls to <code><font color="blue"></font></code><i><span style='white-space: nowrap'>method</span></i><code><font color="blue"><span style='white-space: nowrap'>.step</span></font></code> 
used by <code><font color="blue">OdeErrControl</font></code>.

<br/>
<br/>
<b><big><a name="Error Criteria Discussion" id="Error Criteria Discussion">Error Criteria Discussion</a></big></b>
<br/>
The relative error criteria <i>erel</i> and
absolute error criteria <i>eabs</i> are enforced during each step of the
integration of the ordinary differential equations.
In addition, they are inversely scaled by the step size so that
the total error bound is less than the sum of the error bounds.
To be specific, if 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mover accent='false'><mrow><mi mathvariant='italic'>X</mi>
</mrow>
<mo stretchy='false'>&#x002DC;</mo></mover>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>t</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 is the approximate solution
at time 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>t</mi>
</mrow></math>

, 
<i>ta</i> is the initial step time,
and <i>tb</i> is the final step time,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mrow><mo stretchy="true">|</mo><mrow><mover accent='false'><mrow><mi mathvariant='italic'>X</mi>
</mrow>
<mo stretchy='false'>&#x002DC;</mo></mover>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>j</mi>
</msub>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>j</mi>
</msub>
</mrow><mo stretchy="true">|</mo></mrow>
<mo stretchy="false">&#x02264;</mo>
<mfrac><mrow><mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
</mrow>
<mrow><mi mathvariant='italic'>tb</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ta</mi>
</mrow>
</mfrac>
<mrow><mo stretchy="true">[</mo><mrow><mi mathvariant='italic'>eabs</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">+</mo>
<mi mathvariant='italic'>erel</mi>
<mspace width='.3em'/>
<mo stretchy="false">|</mo>
<mover accent='false'><mrow><mi mathvariant='italic'>X</mi>
</mrow>
<mo stretchy='false'>&#x002DC;</mo></mover>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>j</mi>
</msub>
<mo stretchy="false">|</mo>
</mrow><mo stretchy="true">]</mo></mrow>
</mrow></math>

If 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>X</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tb</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>j</mi>
</msub>
</mrow></math>

 is near zero for some 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>tb</mi>
<mo stretchy="false">&#x02208;</mo>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">]</mo>
</mrow></math>

,
and one uses an absolute error criteria 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>eabs</mi>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">]</mo>
</mrow></math>

 of zero,
the error criteria above will force <code><font color="blue">OdeErrControl</font></code>
to use step sizes equal to 
<a href="odeerrcontrol.xml#smin" target="_top"><span style='white-space: nowrap'>smin</span></a>

for steps ending near 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>tb</mi>
</mrow></math>

.
In this case, the error relative to <i>maxabs</i> can be judged after
<code><font color="blue">OdeErrControl</font></code> returns.
If <i>ef</i> is to large relative to <i>maxabs</i>, 
<code><font color="blue">OdeErrControl</font></code> can be called again 
with a smaller value of <i>smin</i>.

<br/>
<br/>
<b><big><a name="Scalar" id="Scalar">Scalar</a></big></b>
<br/>
The type <i>Scalar</i> must satisfy the conditions
for a <a href="numerictype.xml" target="_top"><span style='white-space: nowrap'>NumericType</span></a>
 type.
The routine <a href="checknumerictype.xml" target="_top"><span style='white-space: nowrap'>CheckNumericType</span></a>
 will generate an error message
if this is not the case.
In addition, the following operations must be defined for 
<i>Scalar</i> objects <i>a</i> and <i>b</i>:

<table><tr><td align='left'  valign='top'>

<b>Operation</b> </td><td align='left'  valign='top'>
 <b>Description</b>  </td></tr><tr><td align='left'  valign='top'>

<code><font color="blue"></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;&lt;=&#xA0;</span></font></code><i><span style='white-space: nowrap'>b</span></i> </td><td align='left'  valign='top'>

	returns true (false) if <i>a</i> is less than or equal 
	(greater than) <i>b</i>.
</td></tr><tr><td align='left'  valign='top'>

<code><font color="blue"></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>&#xA0;==&#xA0;</span></font></code><i><span style='white-space: nowrap'>b</span></i> </td><td align='left'  valign='top'>

	returns true (false) if <i>a</i> is equal to <i>b</i>.
</td></tr><tr><td align='left'  valign='top'>

<code><font color="blue"><span style='white-space: nowrap'>log(</span></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>)</span></font></code> </td><td align='left'  valign='top'>

	returns a <i>Scalar</i> equal to the logarithm of <i>a</i>
</td></tr><tr><td align='left'  valign='top'>

<code><font color="blue"><span style='white-space: nowrap'>exp(</span></font></code><i><span style='white-space: nowrap'>a</span></i><code><font color="blue"><span style='white-space: nowrap'>)</span></font></code> </td><td align='left'  valign='top'>

	returns a <i>Scalar</i> equal to the exponential of <i>a</i>
</td></tr>
</table>
<br/>
<b><big><a name="Vector" id="Vector">Vector</a></big></b>
<br/>
The type <i>Vector</i> must be a <a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 class with
<a href="simplevector.xml#Elements of Specified Type" target="_top"><span style='white-space: nowrap'>elements&#xA0;of&#xA0;type&#xA0;Scalar</span></a>
.
The routine <a href="checksimplevector.xml" target="_top"><span style='white-space: nowrap'>CheckSimpleVector</span></a>
 will generate an error message
if this is not the case.

<br/>
<br/>
<b><big><a name="Example" id="Example">Example</a></big></b>

<br/>
The files
<a href="odeerrcontrol.cpp.xml" target="_top"><span style='white-space: nowrap'>OdeErrControl.cpp</span></a>

and
<a href="odeerrmaxabs.cpp.xml" target="_top"><span style='white-space: nowrap'>OdeErrMaxabs.cpp</span></a>

contain examples and tests of using this routine.
They return true if they succeed and false otherwise.

<br/>
<br/>
<b><big><a name="Theory" id="Theory">Theory</a></big></b>
<br/>
Let 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 be the error as a function of the
step size 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>s</mi>
</mrow></math>

 and suppose that there is a constant

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>K</mi>
</mrow></math>

 such that 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>K</mi>
<msup><mi mathvariant='italic'>s</mi>
<mi mathvariant='italic'>m</mi>
</msup>
</mrow></math>

.
Let 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>a</mi>
</mrow></math>

 be our error bound.
Given the value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
</mrow></math>

, a step of size 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='normal'>&#x003BB;</mi>
<mi mathvariant='italic'>s</mi>
</mrow></math>


would be ok provided that

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>a</mi>
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x02265;</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='normal'>&#x003BB;</mi>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">/</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='normal'>&#x003BB;</mi>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>a</mi>
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x02265;</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>K</mi>
<msup><mi mathvariant='normal'>&#x003BB;</mi>
<mi mathvariant='italic'>m</mi>
</msup>
<msup><mi mathvariant='italic'>s</mi>
<mi mathvariant='italic'>m</mi>
</msup>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">/</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='normal'>&#x003BB;</mi>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>a</mi>
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x02265;</mo>
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='normal'>&#x003BB;</mi>
<mrow><mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow>
</msup>
<msup><mi mathvariant='italic'>s</mi>
<mrow><mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">/</mo>
<msup><mi mathvariant='italic'>s</mi>
<mi mathvariant='italic'>m</mi>
</msup>
</mtd></mtr><mtr><mtd columnalign="right" >
<mi mathvariant='italic'>a</mi>
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x02265;</mo>
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='normal'>&#x003BB;</mi>
<mrow><mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
<mo stretchy="false">)</mo>
<mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">/</mo>
<mi mathvariant='italic'>s</mi>
</mtd></mtr><mtr><mtd columnalign="right" >
<msup><mi mathvariant='normal'>&#x003BB;</mi>
<mrow><mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow>
</msup>
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x02264;</mo>
</mtd><mtd columnalign="left" >
<mfrac><mrow><mi mathvariant='italic'>a</mi>
</mrow>
<mrow><mi mathvariant='italic'>e</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>s</mi>
<mo stretchy="false">)</mo>
</mrow>
</mfrac>
<mfrac><mrow><mi mathvariant='italic'>s</mi>
</mrow>
<mrow><mi mathvariant='italic'>tf</mi>
<mo stretchy="false">-</mo>
<mi mathvariant='italic'>ti</mi>
</mrow>
</mfrac>
</mtd></mtr></mtable>
</mrow></math>

Thus if the right hand side of the last inequality is greater 
than or equal to one, the step of size 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>s</mi>
</mrow></math>

 is ok. 

<br/>
<br/>
<b><big><a name="Source Code" id="Source Code">Source Code</a></big></b>
<br/>
The source code for this routine is in the file
<code><font color="blue">cppad/ode_err_control.hpp</font></code>.


<hr/>Input File: cppad/ode_err_control.hpp

</body>
</html>

