1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 The GSL Team.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "GNU General Public License" and "Free Software
Needs Free Documentation", the Front-Cover text being "A GNU Manual",
and with the Back-Cover Text being (a) (see below). A copy of the
license is included in the section entitled "GNU Free Documentation
License".
(a) The Back-Cover Text is: "You have the freedom to copy and modify this
GNU Manual." -->
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Scientific Library – Reference Manual: Stepping Functions</title>
<meta name="description" content="GNU Scientific Library – Reference Manual: Stepping Functions">
<meta name="keywords" content="GNU Scientific Library – Reference Manual: Stepping Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Function-Index.html#Function-Index" rel="index" title="Function Index">
<link href="Ordinary-Differential-Equations.html#Ordinary-Differential-Equations" rel="up" title="Ordinary Differential Equations">
<link href="Adaptive-Step_002dsize-Control.html#Adaptive-Step_002dsize-Control" rel="next" title="Adaptive Step-size Control">
<link href="Defining-the-ODE-System.html#Defining-the-ODE-System" rel="previous" title="Defining the ODE System">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Stepping-Functions"></a>
<div class="header">
<p>
Next: <a href="Adaptive-Step_002dsize-Control.html#Adaptive-Step_002dsize-Control" accesskey="n" rel="next">Adaptive Step-size Control</a>, Previous: <a href="Defining-the-ODE-System.html#Defining-the-ODE-System" accesskey="p" rel="previous">Defining the ODE System</a>, Up: <a href="Ordinary-Differential-Equations.html#Ordinary-Differential-Equations" accesskey="u" rel="up">Ordinary Differential Equations</a> [<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Stepping-Functions-1"></a>
<h3 class="section">27.2 Stepping Functions</h3>
<p>The lowest level components are the <em>stepping functions</em> which
advance a solution from time <em>t</em> to <em>t+h</em> for a fixed
step-size <em>h</em> and estimate the resulting local error.
</p>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005falloc"></a>Function: <em>gsl_odeiv2_step *</em> <strong>gsl_odeiv2_step_alloc</strong> <em>(const gsl_odeiv2_step_type * <var>T</var>, size_t <var>dim</var>)</em></dt>
<dd><a name="index-gsl_005fodeiv2_005fstep"></a>
<a name="index-gsl_005fodeiv2_005fstep_005ftype"></a>
<p>This function returns a pointer to a newly allocated instance of a
stepping function of type <var>T</var> for a system of <var>dim</var>
dimensions. Please note that if you use a stepper method that
requires access to a driver object, it is advisable to use a driver
allocation method, which automatically allocates a stepper, too.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005freset"></a>Function: <em>int</em> <strong>gsl_odeiv2_step_reset</strong> <em>(gsl_odeiv2_step * <var>s</var>)</em></dt>
<dd><p>This function resets the stepping function <var>s</var>. It should be used
whenever the next use of <var>s</var> will not be a continuation of a
previous step.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005ffree"></a>Function: <em>void</em> <strong>gsl_odeiv2_step_free</strong> <em>(gsl_odeiv2_step * <var>s</var>)</em></dt>
<dd><p>This function frees all the memory associated with the stepping function
<var>s</var>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fname"></a>Function: <em>const char *</em> <strong>gsl_odeiv2_step_name</strong> <em>(const gsl_odeiv2_step * <var>s</var>)</em></dt>
<dd><p>This function returns a pointer to the name of the stepping function.
For example,
</p>
<div class="example">
<pre class="example">printf ("step method is '%s'\n",
gsl_odeiv2_step_name (s));
</pre></div>
<p>would print something like <code>step method is 'rkf45'</code>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005forder"></a>Function: <em>unsigned int</em> <strong>gsl_odeiv2_step_order</strong> <em>(const gsl_odeiv2_step * <var>s</var>)</em></dt>
<dd><p>This function returns the order of the stepping function on the previous
step. The order can vary if the stepping function itself is adaptive.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fset_005fdriver"></a>Function: <em>int</em> <strong>gsl_odeiv2_step_set_driver</strong> <em>(gsl_odeiv2_step * <var>s</var>, const gsl_odeiv2_driver * <var>d</var>)</em></dt>
<dd><p>This function sets a pointer of the driver object <var>d</var> for stepper
<var>s</var>, to allow the stepper to access control (and evolve) object
through the driver object. This is a requirement for some steppers, to
get the desired error level for internal iteration of
stepper. Allocation of a driver object calls this function
automatically.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fapply"></a>Function: <em>int</em> <strong>gsl_odeiv2_step_apply</strong> <em>(gsl_odeiv2_step * <var>s</var>, double <var>t</var>, double <var>h</var>, double <var>y</var>[], double <var>yerr</var>[], const double <var>dydt_in</var>[], double <var>dydt_out</var>[], const gsl_odeiv2_system * <var>sys</var>)</em></dt>
<dd><p>This function applies the stepping function <var>s</var> to the system of
equations defined by <var>sys</var>, using the step-size <var>h</var> to advance
the system from time <var>t</var> and state <var>y</var> to time <var>t</var>+<var>h</var>.
The new state of the system is stored in <var>y</var> on output, with an
estimate of the absolute error in each component stored in <var>yerr</var>.
If the argument <var>dydt_in</var> is not null it should point an array
containing the derivatives for the system at time <var>t</var> on input. This
is optional as the derivatives will be computed internally if they are
not provided, but allows the reuse of existing derivative information.
On output the new derivatives of the system at time <var>t</var>+<var>h</var> will
be stored in <var>dydt_out</var> if it is not null.
</p>
<p>The stepping function returns <code>GSL_FAILURE</code> if it is unable to
compute the requested step. Also, if the user-supplied functions
defined in the system <var>sys</var> return a status other than
<code>GSL_SUCCESS</code> the step will be aborted. In that case, the
elements of <var>y</var> will be restored to their pre-step values and the
error code from the user-supplied function will be returned. Failure
may be due to a singularity in the system or too large step-size
<var>h</var>. In that case the step should be attempted again with a
smaller step-size, e.g. <em><var>h</var>/2</em>.
</p>
<p>If the driver object is not appropriately set via
<code>gsl_odeiv2_step_set_driver</code> for those steppers that need it, the
stepping function returns <code>GSL_EFAULT</code>. If the user-supplied
functions defined in the system <var>sys</var> returns <code>GSL_EBADFUNC</code>,
the function returns immediately with the same return code. In this
case the user must call <code>gsl_odeiv2_step_reset</code> before calling
this function again.
</p>
</dd></dl>
<p>The following algorithms are available,
</p>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk2"></a>Step Type: <strong>gsl_odeiv2_step_rk2</strong></dt>
<dd><a name="index-RK2_002c-Runge_002dKutta-method"></a>
<a name="index-Runge_002dKutta-methods_002c-ordinary-differential-equations"></a>
<p>Explicit embedded Runge-Kutta (2, 3) method.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk4"></a>Step Type: <strong>gsl_odeiv2_step_rk4</strong></dt>
<dd><a name="index-RK4_002c-Runge_002dKutta-method"></a>
<p>Explicit 4th order (classical) Runge-Kutta. Error estimation is
carried out by the step doubling method. For more efficient estimate
of the error, use the embedded methods described below.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frkf45"></a>Step Type: <strong>gsl_odeiv2_step_rkf45</strong></dt>
<dd><a name="index-Fehlberg-method_002c-differential-equations"></a>
<a name="index-RKF45_002c-Runge_002dKutta_002dFehlberg-method"></a>
<p>Explicit embedded Runge-Kutta-Fehlberg (4, 5) method. This method is
a good general-purpose integrator.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frkck"></a>Step Type: <strong>gsl_odeiv2_step_rkck</strong></dt>
<dd><a name="index-Runge_002dKutta-Cash_002dKarp-method"></a>
<a name="index-Cash_002dKarp_002c-Runge_002dKutta-method"></a>
<p>Explicit embedded Runge-Kutta Cash-Karp (4, 5) method.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk8pd"></a>Step Type: <strong>gsl_odeiv2_step_rk8pd</strong></dt>
<dd><a name="index-Runge_002dKutta-Prince_002dDormand-method"></a>
<a name="index-Prince_002dDormand_002c-Runge_002dKutta-method"></a>
<p>Explicit embedded Runge-Kutta Prince-Dormand (8, 9) method.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk1imp"></a>Step Type: <strong>gsl_odeiv2_step_rk1imp</strong></dt>
<dd><a name="index-Implicit-Euler-method"></a>
<p>Implicit Gaussian first order Runge-Kutta. Also known as implicit
Euler or backward Euler method. Error estimation is carried out by the
step doubling method. This algorithm requires the Jacobian and
access to the driver object via <code>gsl_odeiv2_step_set_driver</code>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk2imp"></a>Step Type: <strong>gsl_odeiv2_step_rk2imp</strong></dt>
<dd><a name="index-Implicit-Runge_002dKutta-method"></a>
<p>Implicit Gaussian second order Runge-Kutta. Also known as implicit
mid-point rule. Error estimation is carried out by the step doubling
method. This stepper requires the Jacobian and access to the driver
object via <code>gsl_odeiv2_step_set_driver</code>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005frk4imp"></a>Step Type: <strong>gsl_odeiv2_step_rk4imp</strong></dt>
<dd><p>Implicit Gaussian 4th order Runge-Kutta. Error estimation is carried
out by the step doubling method. This algorithm requires the Jacobian
and access to the driver object via <code>gsl_odeiv2_step_set_driver</code>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fbsimp"></a>Step Type: <strong>gsl_odeiv2_step_bsimp</strong></dt>
<dd><a name="index-Bulirsch_002dStoer-method"></a>
<a name="index-Bader-and-Deuflhard_002c-Bulirsch_002dStoer-method_002e"></a>
<a name="index-Deuflhard-and-Bader_002c-Bulirsch_002dStoer-method_002e"></a>
<p>Implicit Bulirsch-Stoer method of Bader and Deuflhard. The method is
generally suitable for stiff problems. This stepper requires the
Jacobian.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fmsadams"></a>Step Type: <strong>gsl_odeiv2_step_msadams</strong></dt>
<dd><a name="index-Adams-method"></a>
<a name="index-multistep-methods_002c-ODEs"></a>
<a name="index-predictor_002dcorrector-method_002c-ODEs"></a>
<a name="index-Nordsieck-form"></a>
<p>A variable-coefficient linear multistep Adams method in Nordsieck
form. This stepper uses explicit Adams-Bashforth (predictor) and
implicit Adams-Moulton (corrector) methods in <em>P(EC)^m</em>
functional iteration mode. Method order varies dynamically between 1
and 12. This stepper requires the access to the driver object via
<code>gsl_odeiv2_step_set_driver</code>.
</p></dd></dl>
<dl>
<dt><a name="index-gsl_005fodeiv2_005fstep_005fmsbdf"></a>Step Type: <strong>gsl_odeiv2_step_msbdf</strong></dt>
<dd><a name="index-BDF-method"></a>
<p>A variable-coefficient linear multistep backward differentiation
formula (BDF) method in Nordsieck form. This stepper uses the explicit
BDF formula as predictor and implicit BDF formula as corrector. A
modified Newton iteration method is used to solve the system of
non-linear equations. Method order varies dynamically between 1 and
5. The method is generally suitable for stiff problems. This stepper
requires the Jacobian and the access to the driver object via
<code>gsl_odeiv2_step_set_driver</code>.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Adaptive-Step_002dsize-Control.html#Adaptive-Step_002dsize-Control" accesskey="n" rel="next">Adaptive Step-size Control</a>, Previous: <a href="Defining-the-ODE-System.html#Defining-the-ODE-System" accesskey="p" rel="previous">Defining the ODE System</a>, Up: <a href="Ordinary-Differential-Equations.html#Ordinary-Differential-Equations" accesskey="u" rel="up">Ordinary Differential Equations</a> [<a href="Function-Index.html#Function-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|