# "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 , where .

#### "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 with given real numbers.

Then the -stage composition method is given by

Often interest is in composition methods that involve the same base method

An interesting special case is symmetric composition: , .

The most common types of composition are:

#### "Splitting"

An -stage splitting method is a generalization of a composition method in which is broken up in an additive fashion:

The essential point is that there can often be computational advantages in solving problems involving instead of .

An -stage splitting method is a composition of the form

with 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 is integrable, then the exact solution or flow 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 with ; 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.

- Add the ability to pass around a function for numerically evaluating a subfield, instead of the entire vector field.

- Add a method to compute the flow; analytically solve a subsystem and advance the (local) solution numerically.

- Add 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:

### Nested Methods

The following example constructs a high-order splitting method from a low-order splitting using .

### Simplification

A more efficient integrator can be obtained in the previous example using the group property of flows and calling the 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.

In[1]:= |

In[2]:= |

### Symplectic Splitting

#### Symplectic Leapfrog

is an efficient method for solving separable Hamiltonian systems with favorable long-time dynamics.

is a more general-purpose method, but it can be used to construct partitioned symplectic methods (though it is somewhat less efficient than ).

In[4]:= |

Out[4]= |

In[5]:= |

In[10]:= |

Out[13]= |

The method could only have been specified once, since the second and third instances would have been filled in cyclically.

In[15]:= |

Out[15]= |

#### Composition of Symplectic Leapfrog

In[17]:= |

Out[19]= |

In[21]:= |

Out[22]= |

### 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

In[24]:= |

In[32]:= |

#### Hybrid Numeric-Symbolic Splitting Methods (ABC Flow)

In[36]:= |

Out[36]= |

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.

In[37]:= |

In[42]:= |

Out[42]= |

In[43]:= |

Out[43]= |

The system for is solvable exactly by DSolve so that you can use the "LocallyExact" method.

is not solvable, however, so you need to use a suitable numerical integrator in order to obtain the desired properties in the splitting method.

In[44]:= |

In[45]:= |

Out[45]= |

#### 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

In[46]:= |

Out[46]= |

In[47]:= |

In[49]:= |

Out[49]= |

In[50]:= |

In[56]:= |

Out[56]= |

In[57]:= |

Out[57]= |

## Option Summary

The default coefficient choice in tries to automatically select between and depending on the properties of the methods specified using the Method option.

option name | default value | |

"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 |

option name | default value | |

"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 |