"DoubleStep" Method for NDSolve

Introduction

The method "DoubleStep" performs a single application of Richardson's extrapolation for any one-step integration method.

Although it is not always optimal, it is a general scheme for equipping a method with an error estimate (hence adaptivity in the step size) and extrapolating to increase the order of local accuracy.

"DoubleStep" is a special case of extrapolation but has been implemented as a separate method for efficiency.

Given a method of order :

• Take a step of size to get a solution .
• Take two steps of size to get a solution .
• Find an error estimate of order as:
• The correction term can be used for error estimation enabling an adaptive step-size scheme for any base method.
• Either use for the new solution, or form an improved approximation using local extrapolation as:
• If the base numerical integration method is symmetric, then the improved approximation has order ; otherwise it has order .

Examples

Load some package with example problems and utility functions.
 In[1]:=
Select a nonstiff problem from the package.
 In[5]:=
Select a stiff problem from the package.
 In[6]:=

Extending Built-in Methods

The method "ExplicitEuler" carries out one integration step using Euler's method. It has no local error control and hence uses fixed step sizes.

This integrates a differential system using one application of Richardson's extrapolation (see (1)) with the base method "ExplicitEuler".
The local error estimate (2) is used to dynamically adjust the step size throughout the integration.
 In[7]:=
 Out[7]=
This illustrates how the step size varies during the numerical integration.
 In[8]:=
 Out[8]=
The stiffness detection device (described within "StiffnessTest Method Option for NDSolve") ascertains that the "ExplicitEuler" method is restricted by stability rather than local accuracy.
 In[9]:=
 Out[9]=
An alternative base method is more appropriate for this problem.
 In[10]:=
 Out[10]=

User-Defined Methods and Method Properties

Integration methods can be added to the NDSolve framework.

In order for these to work like built-in methods it can be necessary to specify various method properties. These properties can then be used by other methods to build up compound integrators.

Here is how to define a top-level plug-in for the classical RungeKutta method (see "NDSolve Method Plug-in Framework: Classical RungeKutta" and "ExplicitRungeKutta Method for NDSolve" for more details).
 In[11]:=

Method properties used by "DoubleStep" are now described.

Order and Symmetry

This attempts to integrate a system using one application of Richardson's extrapolation based on the classical RungeKutta method.
 In[12]:=

Without knowing the order of the base method, "DoubleStep" is unable to carry out Richardson's extrapolation.

This defines a method property to communicate to the framework that the classical RungeKutta method has order four.
 In[13]:=
The method "DoubleStep" is now able to ascertain that ClassicalRungeKutta is of order four and can use this information when refining the solution and estimating the local error.
 In[14]:=
 Out[14]=

The order of the result of Richardson's extrapolation depends on whether the extrapolated method has a local error expansion in powers of or (the latter occurs if the base method is symmetric).

If no method property for symmetry is defined, the "DoubleStep" method assumes by default that the base integrator is not symmetric.

This explicitly specifies that the classical RungeKutta method is not symmetric using the "SymmetricMethodQ" property.
 In[15]:=

Stiffness Detection

Details of the scheme used for stiffness detection can be found within "StiffnessTest Method Option for NDSolve".

Stiffness detection relies on knowledge of the linear stability boundary of the method, which has not been defined.

Computing the exact linear stability boundary of a method under extrapolation can be quite complicated. Therefore a default value is selected which works for all methods. This corresponds to considering the p order power series approximation to the exponential at 0 and ignoring higher order terms.

• If "LocalExtrapolation" is True then a generic value is selected corresponding to a method of order p + 2 (symmetric) or p + 1.
• If "LocalExtrapolation" is False then the property "LinearStabilityBoundary" of the base method is checked. If no value has been specified then a default for a method of order p is selected.
This computes the linear stability boundary for a generic method of order 4.
 In[16]:=
 Out[16]=
A default value for the "LinearStabilityBoundary" property is used.
 In[17]:=
This shows how to specify the linear stability boundary of the method for the framework. This value will only be used if "DoubleStep" is invoked with "LocalExtrapolation"->True .
 In[18]:=
"DoubleStep" assumes by default that a method is not appropriate for stiff problems (and hence uses stiffness detection) when no "StiffMethodQ" property is specified. This shows how to define the property.
 In[19]:=

Higher Order

The following example extrapolates the classical RungeKutta method of order four using two applications of (3).

The inner specification of "DoubleStep" constructs a method of order five.

A second application of "DoubleStep" is used to obtain a method of order six, which uses adaptive step sizes.

Nested applications of "DoubleStep" are used to raise the order and provide an adaptive step-size estimate.
 In[20]:=
 Out[20]=

In general the method "Extrapolation" is more appropriate for constructing high-order integration schemes from low-order methods.

Option Summary

 option name default value "LocalExtrapolation" True specify whether to advance the solution using local extrapolation according to (4) Method None specify the method to use as the base integration scheme "StepSizeRatioBounds" {,4} specify the bounds on a relative change in the new step size hn+1 from the current step size hn as low ≤ hn+1/hn ≤ high "StepSizeSafetyFactors" Automatic specify the safety factors to incorporate into the error estimate (5) used for adaptive step sizes "StiffnessTest" Automatic specify whether to use the stiffness detection capability

Options of the method "DoubleStep".

The default setting of Automatic for the option "StiffnessTest" indicates that the stiffness test is activated if a nonstiff base method is used.

The default setting of Automatic for the option "StepSizeSafetyFactors" uses the values {9/10,4/5} for a stiff base method and {9/10,13/20} for a nonstiff base method.