Composition and Splitting Methods for NDSolve
Introduction
In some cases it is useful to split the differential system into subsystems and solve each subsystem using appropriate integration methods. Recombining the individual solutions often allows certain dynamical properties, such as volume, to be conserved. More information on splitting and composition can be found in [
MQ02,
HLW02], and specific aspects related to
NDSolve are discussed in [
SS05,
SS06].
Definitions
Of concern are initial value problems
y' (t)=f (y (t)),
y (0)=y0
n given.
Composition
Composition is a useful device for raising the order of a numerical integration scheme.
In contrast to the Aitken-Neville algorithm used in extrapolation, composition can conserve geometric properties of the base integration method (e.g. symplecticity).
Let

be a basic integration method that takes a step of size
ih with
1, ...,
s given real numbers.
Then the
s-stage composition method
f, h is given by
Often interest is in composition methods
f, h that involve the same base method
=
(i), i=1, ..., s.
An interesting special case is symmetric composition:
i=
s-i+1,
i=1, ...,
s/2
.
The most common types of composition are:
- Symmetric composition of symmetric second-order methods.
- Symmetric composition of first-order methods (e.g. a method
with its adjoint
*).
- Composition of first-order methods.
Splitting
An
s-stage splitting method is a generalization of a composition method in which
f is broken up in an additive fashion:
The essential point is that there can often be computational advantages in solving problems involving
fi instead of
f.
An
s-stage splitting method is a composition of the form
with
f1, ..., fs not necessarily distinct.
Each base integration method now only solves part of the problem, but a suitable composition can still give rise to a numerical scheme with advantageous properties.
If the vector field
fi is integrable, then the exact solution or flow
fi, h can be used in place of a numerical integration method.
A splitting method may also use a mixture of flows and numerical methods.
An example is Lie-Trotter splitting [
T59]:
Split
f=f1+f2 with
1=
2=1; then

yields a first-order integration method.
Computationally it can be advantageous to combine flows using the group property:
Implementation
Several changes to the new
NDSolve framework were needed in order to implement splitting and composition methods.
- Allow a method to call an arbitrary number of submethods.
- The ability to pass around a function for numerically evaluating a subfield, instead of the entire vector field.
- A LocallyExact method to compute the flow; analytically solve a subsystem and advance the (local) solution numerically.
- Cache data for identical methods to avoid repeated initialization. Data for numerically evaluating identical subfields is also cached.
A simplified input syntax allows omitted vector fields and methods to be filled in cyclically. These must be defined unambiguously:
{f1, f2, f1, f2} can be input as
{f1, f2}.
{f1, f2, f3, f2, f1} cannot be input as
{f1, f2, f3} since this corresponds to
{f1, f2, f3, f1, f2}.
Nested methods
The following example constructs a high-order splitting method from a low-order splitting using composition.
Simplification
A more efficient integrator can be obtained in the previous example using the group property of flows and calling the
Splitting method directly.
Examples
The following examples will use a second-order symmetric splitting known as the Strang splitting [
S68], [
M68]. The splitting coefficients are automatically determined from the structure of the equations.
This defines a method known as symplectic leapfrog in terms of the method SymplecticPartitionedRungeKutta. |
Load a package with some useful example problems. |
Symplectic splitting
Symplectic leapfrog
SymplecticPartitionedRungeKutta is an efficient method for solving separable Hamiltonian systems
H (p, q)=T (p)+V (q) with favorable long time dynamics.
Splitting is a more general-purpose method, but it can be used to construct partitioned symplectic methods (though it is somewhat less efficient than
SymplecticPartitionedRungeKutta).
Consider the harmonic oscillator that arises from a linear differential system that is governed by the separable Hamiltonian H (p, q)=p2/2+q2/2.
| Out[5]= |  |
|
Split the Hamiltonian vector field into independent components governing momentum and position. This is done by setting the relevant right-hand sides of the equations to zero. |
This composition of weighted (first-order) Euler integration steps corresponds to the symplectic (second-order) leapfrog method.
| Out[14]= |  |
|
The method
ExplicitEuler could only have been specified once, since the second and third instances would have been filled in cyclically.
This is the result at the end of the integration step.
Out[15]//InputForm= |
| |  |
|
This invokes the built-in integration method corresponding to the symplectic leapfrog integrator.
| Out[16]= |  |
|
The result at the end of the integration step is identical to the result of the splitting method.
Out[17]//InputForm= |
| |  |
|
Composition of symplectic leapfrog
This takes the symplectic leapfrog scheme as the base integration method and constructs a fourth-order symplectic integrator using a symmetric composition of Ruth-Yoshida [ Y90].
| Out[20]= |  |
|
This is the result at the end of the integration step.
Out[21]//InputForm= |
| |  |
|
This invokes the built-in symplectic integration method using coefficients for the fourth-order methods of Ruth, Yoshida.
| Out[23]= |  |
|
The result at the end of the integration step is identical to the result of the composition method.
Out[24]//InputForm= |
| |  |
|
Hybrid methods
While a closed-form solution often does not exist for the entire vector field, in some cases it is possible to analytically solve a system of differential equations for part of the vector field.
When a solution can be found by
DSolve, direct numerical evaluation can be used to locally advance the solution.
This idea is implemented in the method
LocallyExact.
Harmonic oscillator test example
This example checks that the solution for the exact flows of split components of the harmonic oscillator equations is the same as applying Euler's method to each of the split components.
Out[34]//InputForm= |
| |  |
Out[38]//InputForm= |
| |  |
|
Hybrid numeric-symbolic splitting methods (ABC flow)
Consider the Arnold, Beltrami, and Childress flow, a widely studied model for volume-preserving three-dimensional flows.
| Out[39]= |  |
|
When applied directly, a volume preserving integrator would not in general preserve symmetries. A symmetry-preserving integrator, such as the implicit midpoint rule, would not preserve volume.
This defines a splitting of the system by setting some of the right-hand side components to zero.
| Out[45]= |  |
| Out[46]= |  |
|
The system for
Y1 is solvable exactly by
DSolve so that you can use the
LocallyExact method.
Y2 is not solvable, however, so you need to use a suitable numerical integrator in order to obtain the desired properties in the splitting method.
This defines a method for computing the implicit midpoint rule in terms of the built-in ImplicitRungeKutta method. |
This defines a second-order, volume-preserving, reversing symmetry-group integrator [ MQ02].
| Out[48]= |  |
|
Lotka-Volterra equations
Various numerical integrators for this system are compared within "
Numerical methods for solving the Lotka-
Volterra equations".
Euler's equations
Various numerical integrators for Euler's equations are compared within
"Rigid body solvers".
Non-autonomous vector fields
Consider the Duffing oscillator, a forced planar non-autonomous differential system.
| Out[49]= |  |
|
This defines a splitting of the system. |
The splitting of the time component among the vector fields is ambiguous, so the method issues an error message.
| Out[52]= |  |
|
The equations can be extended by introducing a new "dummy" variable Z[T] such that Z[T] T and specifying how it should be distributed in the split differential systems. |
This defines a geometric splitting method that satisfies 1+ 2=- for any finite time interval, where 1 and 2 are the Lyapunov exponents [ MQ02].
| Out[59]= |  |
|
Here is a plot of the solution.
| Out[60]= |  |
|
Option summary
The default coefficient choice in
Composition tries to automatically select between
SymmetricCompositionCoefficients and
SymmetricCompositionSymmetricMethodCoefficients depending on the properties of the methods specified using the
Method option.
| | |
| Coefficients | Automatic | specify the coefficients to use in the composition method |
| DifferenceOrder | Automatic | specify the order of local accuracy of the method |
| Method | None | specify the base methods to use in the numerical integration |
Options of the method Composition.
| | |
| Coefficients | {} | specify the coefficients to use in the splitting method |
| DifferenceOrder | Automatic | specify the order of local accuracy of the method |
| Equations | {} | specify the way in which the equations should be split |
| Method | None | specify the base methods to use in the numerical integration |
Options of the method Splitting.