John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... ·...

64
Introduction Formulation Taylor series: exact solution Approximation Order conditions John Butcher’s tutorials Introduction to Runge–Kutta methods Φ(t)= 1 γ (t) Introduction to Runge–Kutta methods

Transcript of John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... ·...

Page 1: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

John Butcher’s tutorials

Introduction to Runge–Kutta methods

Φ(t) =1

γ(t)

Introduction to Runge–Kutta methods

Page 2: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction

It will be convenient to consider only autonomous initial valueproblems

y′(x) = f(y(x)), y(x0) = y0,

f : RN

→ RN .

The Euler method is the simplest way of obtaining numericalapproximations at

x1 = x0 + h, x2 = x1 + h, . . .

using the formula

yn = yn−1 + hf(yn−1), h = xn − xn−1, n = 1, 2, . . . .

Introduction to Runge–Kutta methods

Page 3: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction

It will be convenient to consider only autonomous initial valueproblems

y′(x) = f(y(x)), y(x0) = y0,

f : RN

→ RN .

The Euler method is the simplest way of obtaining numericalapproximations at

x1 = x0 + h, x2 = x1 + h, . . .

using the formula

yn = yn−1 + hf(yn−1), h = xn − xn−1, n = 1, 2, . . . .

Introduction to Runge–Kutta methods

Page 4: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction

It will be convenient to consider only autonomous initial valueproblems

y′(x) = f(y(x)), y(x0) = y0,

f : RN

→ RN .

The Euler method is the simplest way of obtaining numericalapproximations at

x1 = x0 + h, x2 = x1 + h, . . .

using the formula

yn = yn−1 + hf(yn−1), h = xn − xn−1, n = 1, 2, . . . .

Introduction to Runge–Kutta methods

Page 5: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

This method can be made more accurate by using either themid-point quadrature formula

yn = yn−1 + hf(

yn−1 + 12hf(yn−1)

)

.

or the trapezoidal rule quadrature formula:

yn = yn−1 + 12hf(yn−1) + 1

2hf(

yn−1 + hf(yn−1))

.

These methods from Runge’s 1895 paper are “second order”because the error in a single step behaves like O(h3).

This is in contrast to the first order Euler method where theorder behaviour is O(h2).

Introduction to Runge–Kutta methods

Page 6: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

This method can be made more accurate by using either themid-point quadrature formula

yn = yn−1 + hf(

yn−1 + 12hf(yn−1)

)

.

or the trapezoidal rule quadrature formula:

yn = yn−1 + 12hf(yn−1) + 1

2hf(

yn−1 + hf(yn−1))

.

These methods from Runge’s 1895 paper are “second order”because the error in a single step behaves like O(h3).

This is in contrast to the first order Euler method where theorder behaviour is O(h2).

Introduction to Runge–Kutta methods

Page 7: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

This method can be made more accurate by using either themid-point quadrature formula

yn = yn−1 + hf(

yn−1 + 12hf(yn−1)

)

.

or the trapezoidal rule quadrature formula:

yn = yn−1 + 12hf(yn−1) + 1

2hf(

yn−1 + hf(yn−1))

.

These methods from Runge’s 1895 paper are “second order”because the error in a single step behaves like O(h3).

This is in contrast to the first order Euler method where theorder behaviour is O(h2).

Introduction to Runge–Kutta methods

Page 8: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

This method can be made more accurate by using either themid-point quadrature formula

yn = yn−1 + hf(

yn−1 + 12hf(yn−1)

)

.

or the trapezoidal rule quadrature formula:

yn = yn−1 + 12hf(yn−1) + 1

2hf(

yn−1 + hf(yn−1))

.

These methods from Runge’s 1895 paper are “second order”because the error in a single step behaves like O(h3).

This is in contrast to the first order Euler method where theorder behaviour is O(h2).

Introduction to Runge–Kutta methods

Page 9: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

A few years later, Heun gave a full explanation of order 3methods.

Shortly afterwards Kutta gave a detailed analysis of order 4methods.

In the early days of Runge–Kutta methods the aim seemed tobe to find explicit methods of higher and higher order.

Later the aim shifted to finding methods that seemed to beoptimal in terms of local truncation error and to finding built-inerror estimators.

With the emergence of stiff problems as an importantapplication area, attention moved to implicit methods.

Introduction to Runge–Kutta methods

Page 10: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

A few years later, Heun gave a full explanation of order 3methods.

Shortly afterwards Kutta gave a detailed analysis of order 4methods.

In the early days of Runge–Kutta methods the aim seemed tobe to find explicit methods of higher and higher order.

Later the aim shifted to finding methods that seemed to beoptimal in terms of local truncation error and to finding built-inerror estimators.

With the emergence of stiff problems as an importantapplication area, attention moved to implicit methods.

Introduction to Runge–Kutta methods

Page 11: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

A few years later, Heun gave a full explanation of order 3methods.

Shortly afterwards Kutta gave a detailed analysis of order 4methods.

In the early days of Runge–Kutta methods the aim seemed tobe to find explicit methods of higher and higher order.

Later the aim shifted to finding methods that seemed to beoptimal in terms of local truncation error and to finding built-inerror estimators.

With the emergence of stiff problems as an importantapplication area, attention moved to implicit methods.

Introduction to Runge–Kutta methods

Page 12: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

A few years later, Heun gave a full explanation of order 3methods.

Shortly afterwards Kutta gave a detailed analysis of order 4methods.

In the early days of Runge–Kutta methods the aim seemed tobe to find explicit methods of higher and higher order.

Later the aim shifted to finding methods that seemed to beoptimal in terms of local truncation error and to finding built-inerror estimators.

With the emergence of stiff problems as an importantapplication area, attention moved to implicit methods.

Introduction to Runge–Kutta methods

Page 13: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

A few years later, Heun gave a full explanation of order 3methods.

Shortly afterwards Kutta gave a detailed analysis of order 4methods.

In the early days of Runge–Kutta methods the aim seemed tobe to find explicit methods of higher and higher order.

Later the aim shifted to finding methods that seemed to beoptimal in terms of local truncation error and to finding built-inerror estimators.

With the emergence of stiff problems as an importantapplication area, attention moved to implicit methods.

Introduction to Runge–Kutta methods

Page 14: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Formulation of Runge–Kutta methods

In carrying out a step we evaluate s stage values

Y1, Y2, . . . , Ys

and s stage derivatives

F1, F2, . . . , Fs,

using the formula Fi = f(Yi).

Each Yi is defined as a linear combination of the Fj added on toy0:

Yi = y0 + h

s∑

j=1

aijFj , i = 1, 2, . . . , s,

and the approximation at x1 = x0 + h is found from

y1 = y0 + h

s∑

i=1

biFi.

Introduction to Runge–Kutta methods

Page 15: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Formulation of Runge–Kutta methods

In carrying out a step we evaluate s stage values

Y1, Y2, . . . , Ys

and s stage derivatives

F1, F2, . . . , Fs,

using the formula Fi = f(Yi).

Each Yi is defined as a linear combination of the Fj added on toy0:

Yi = y0 + h

s∑

j=1

aijFj , i = 1, 2, . . . , s,

and the approximation at x1 = x0 + h is found from

y1 = y0 + h

s∑

i=1

biFi.

Introduction to Runge–Kutta methods

Page 16: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

We represent the method by a tableau:

c1 a11 a12 · · · a1s

c2 a21 a22 · · · a2s

......

......

cs as1 as2 · · · ass

b1 b2 · · · bs

or, if the method is explicit, by the simplified tableau

0c2 a21...

......

. . .

cs as1 as2 · · · as,s−1

b1 b2 · · · bs−1 bs

In each case, ci (i = 1, 2, . . . ) is defined as∑s

j=1 aij . The valueof ci indicates the point Xi = x0 + hci for which Yi is a goodapproximation to y(Xi).

Introduction to Runge–Kutta methods

Page 17: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

We represent the method by a tableau:

c1 a11 a12 · · · a1s

c2 a21 a22 · · · a2s

......

......

cs as1 as2 · · · ass

b1 b2 · · · bs

or, if the method is explicit, by the simplified tableau

0c2 a21...

......

. . .

cs as1 as2 · · · as,s−1

b1 b2 · · · bs−1 bs

In each case, ci (i = 1, 2, . . . ) is defined as∑s

j=1 aij . The valueof ci indicates the point Xi = x0 + hci for which Yi is a goodapproximation to y(Xi).

Introduction to Runge–Kutta methods

Page 18: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

We represent the method by a tableau:

c1 a11 a12 · · · a1s

c2 a21 a22 · · · a2s

......

......

cs as1 as2 · · · ass

b1 b2 · · · bs

or, if the method is explicit, by the simplified tableau

0c2 a21...

......

. . .

cs as1 as2 · · · as,s−1

b1 b2 · · · bs−1 bs

In each case, ci (i = 1, 2, . . . ) is defined as∑s

j=1 aij . The valueof ci indicates the point Xi = x0 + hci for which Yi is a goodapproximation to y(Xi).

Introduction to Runge–Kutta methods

Page 19: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Examples:

y1 = y0 + 0hf(y0) + 1hf(

y0 + 1

2hf(y0)

)

012

1

2

0 1

Introduction to Runge–Kutta methods

Page 20: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Examples:

y1 = y0 + 0hf(y0) + 1hf(

y0 + 1

2hf(y0)

)

012

1

2

0 1

Y1 Y2

Introduction to Runge–Kutta methods

Page 21: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Examples:

y1 = y0 + 0hf(y0) + 1hf(

y0 + 1

2hf(y0)

)

012

1

2

0 1

Y1 Y2

y1 = y0 + 1

2hf(y0) + 1

2hf

(

y0 + 1hf(y0))

01 1

1

2

1

2

Introduction to Runge–Kutta methods

Page 22: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Examples:

y1 = y0 + 0hf(y0) + 1hf(

y0 + 1

2hf(y0)

)

012

1

2

0 1

Y1 Y2

y1 = y0 + 1

2hf(y0) + 1

2hf

(

y0 + 1hf(y0))

01 1

1

2

1

2

Y1 Y2

Introduction to Runge–Kutta methods

Page 23: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 24: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 25: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 26: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 27: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 28: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 29: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of exact solution

We need formulae for the second, third, . . . , derivatives.

y′(x) = f(y(x))

y′′(x) = f ′(y(x))y′(x)

= f ′(y(x))f(y(x))

y′′′(x) = f ′′(y(x))(f(y(x)), y′(x))+f ′(y(x))f ′(y(x))y′(x)

= f ′′(y(x))(f(y(x)), f(y(x)))

+ f ′(y(x))f ′(y(x))f(y(x))

This will become increasingly complicated as we evaluate higherderivatives.Hence we look for a systematic pattern.Write f = f(y(x)), f′ = f ′(y(x)), f′′ = f ′′(y(x)), . . . .

Introduction to Runge–Kutta methods

Page 30: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

y′(x) = f f

y′′(x) = f′f f′f

y′′′(x) = f′′(f, f) f′′f f

+ f′f′f f′f′f

The various terms have a structure related to rooted-trees.

Hence, we introduce the set of all rooted trees and somefunctions on this set.

Introduction to Runge–Kutta methods

Page 31: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

y′(x) = f f

y′′(x) = f′f f′f

y′′′(x) = f′′(f, f) f′′f f

+ f′f′f f′f′f

The various terms have a structure related to rooted-trees.

Hence, we introduce the set of all rooted trees and somefunctions on this set.

Introduction to Runge–Kutta methods

Page 32: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

y′(x) = f f

y′′(x) = f′f f′f

y′′′(x) = f′′(f, f) f′′f f

+ f′f′f f′f′f

The various terms have a structure related to rooted-trees.

Hence, we introduce the set of all rooted trees and somefunctions on this set.

Introduction to Runge–Kutta methods

Page 33: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

Introduction to Runge–Kutta methods

Page 34: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical tree

Introduction to Runge–Kutta methods

Page 35: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of vertices

Introduction to Runge–Kutta methods

Page 36: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism group

Introduction to Runge–Kutta methods

Page 37: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism groupγ(t) density of t

Introduction to Runge–Kutta methods

Page 38: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism groupγ(t) density of t

α(t) number of ways of labelling with an ordered set

Introduction to Runge–Kutta methods

Page 39: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism groupγ(t) density of t

α(t) number of ways of labelling with an ordered setβ(t) number of ways of labelling with an unordered set

Introduction to Runge–Kutta methods

Page 40: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism groupγ(t) density of t

α(t) number of ways of labelling with an ordered setβ(t) number of ways of labelling with an unordered set

F (t)(y0) elementary differential

Introduction to Runge–Kutta methods

Page 41: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Let T denote the set of rooted trees:

T =

{

, , , , , , , , . . .

}

We identify the following functions on T .

In this table, t will denote a typical treer(t) order of t = number of verticesσ(t) symmetry of t = order of automorphism groupγ(t) density of t

α(t) number of ways of labelling with an ordered setβ(t) number of ways of labelling with an unordered set

F (t)(y0) elementary differential

We will give examples of these functions based on t =

Introduction to Runge–Kutta methods

Page 42: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

Introduction to Runge–Kutta methods

Page 43: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

Introduction to Runge–Kutta methods

Page 44: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

σ(t) = 8

Introduction to Runge–Kutta methods

Page 45: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

σ(t) = 8

γ(t) = 63 7

33

1 1 11

Introduction to Runge–Kutta methods

Page 46: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

σ(t) = 8

γ(t) = 63 7

33

1 1 11

α(t) = r(t)!σ(t)γ(t) = 10

Introduction to Runge–Kutta methods

Page 47: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

σ(t) = 8

γ(t) = 63 7

33

1 1 11

α(t) = r(t)!σ(t)γ(t) = 10

β(t) = r(t)!σ(t) = 630

Introduction to Runge–Kutta methods

Page 48: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

t =

r(t) = 7 7

65

1 2 43

σ(t) = 8

γ(t) = 63 7

33

1 1 11

α(t) = r(t)!σ(t)γ(t) = 10

β(t) = r(t)!σ(t) = 630

F (t) = f′′(

f′′(f, f), f′′(f, f))

f′′

f′′

f′′

f f ff

Introduction to Runge–Kutta methods

Page 49: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

These functions are easy to compute up to order-4 trees:

t

r(t) 1 2 3 3 4 4 4 4

σ(t) 1 1 2 1 6 1 2 1

γ(t) 1 2 3 6 4 8 12 24

α(t) 1 1 1 1 1 3 1 1

β(t) 1 2 3 6 4 24 12 24

F (t) f f′f f′′(f, f) f′f′f f(3)(f, f, f) f′′(f, f′f) f′f′′(f, f) f′f′f′f

Introduction to Runge–Kutta methods

Page 50: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the solution at x0 + h is

y(x0 + h) = y0 +∑

t∈T

α(t)hr(t)

r(t)!F (t)(y0)

Using the known formula for α(t), we can write this as

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

Our aim will now be to find a corresponding formula for theresult computed by one step of a Runge–Kutta method.

By comparing these formulae term by term, we will be able toobtain conditions for a specific order of accuracy.

Introduction to Runge–Kutta methods

Page 51: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the solution at x0 + h is

y(x0 + h) = y0 +∑

t∈T

α(t)hr(t)

r(t)!F (t)(y0)

Using the known formula for α(t), we can write this as

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

Our aim will now be to find a corresponding formula for theresult computed by one step of a Runge–Kutta method.

By comparing these formulae term by term, we will be able toobtain conditions for a specific order of accuracy.

Introduction to Runge–Kutta methods

Page 52: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the solution at x0 + h is

y(x0 + h) = y0 +∑

t∈T

α(t)hr(t)

r(t)!F (t)(y0)

Using the known formula for α(t), we can write this as

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

Our aim will now be to find a corresponding formula for theresult computed by one step of a Runge–Kutta method.

By comparing these formulae term by term, we will be able toobtain conditions for a specific order of accuracy.

Introduction to Runge–Kutta methods

Page 53: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the solution at x0 + h is

y(x0 + h) = y0 +∑

t∈T

α(t)hr(t)

r(t)!F (t)(y0)

Using the known formula for α(t), we can write this as

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

Our aim will now be to find a corresponding formula for theresult computed by one step of a Runge–Kutta method.

By comparing these formulae term by term, we will be able toobtain conditions for a specific order of accuracy.

Introduction to Runge–Kutta methods

Page 54: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of approximation

We need to evaluate various expressions which depend on thetableau for a particular method.

Introduction to Runge–Kutta methods

Page 55: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of approximation

We need to evaluate various expressions which depend on thetableau for a particular method.

These are known as “elementary weights”.

Introduction to Runge–Kutta methods

Page 56: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of approximation

We need to evaluate various expressions which depend on thetableau for a particular method.

These are known as “elementary weights”.We use the example tree we have already considered toillustrate the construction of the elementary weight Φ(t).

t =i

kj

l m on

Introduction to Runge–Kutta methods

Page 57: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of approximation

We need to evaluate various expressions which depend on thetableau for a particular method.

These are known as “elementary weights”.We use the example tree we have already considered toillustrate the construction of the elementary weight Φ(t).

t =i

kj

l m on

Φ(t) =

s∑

i,j,k,l,m,n,o=1

biaijaikajlajmaknako

Introduction to Runge–Kutta methods

Page 58: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Taylor series of approximation

We need to evaluate various expressions which depend on thetableau for a particular method.

These are known as “elementary weights”.We use the example tree we have already considered toillustrate the construction of the elementary weight Φ(t).

t =i

kj

l m on

Φ(t) =

s∑

i,j,k,l,m,n,o=1

biaijaikajlajmaknako

Simplify by summing over l,m, n, o:

Φ(t) =

s∑

i,j,k=1

biaijc2jaikc

2k

Introduction to Runge–Kutta methods

Page 59: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Now add Φ(t) to the table of functions:

t

r(t) 1 2 3 3

α(t) 1 1 1 1

β(t) 1 2 3 6

Φ(t)∑

bi

bici

bic2i

biaijcj

t

r(t) 4 4 4 4

α(t) 1 3 1 1

β(t) 4 24 12 24

Φ(t)∑

bic3i

biciaijcj

biaijc2j

biaijajkck

Introduction to Runge–Kutta methods

Page 60: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the numerical approximation tothe solution at x0 + h is

y1 = y0 +∑

t∈T

β(t)hr(t)

r(t)!Φ(t)F (t)(y0)

Using the known formula for β(t), we can write this as

y1 = y0 +∑

t∈T

hr(t)

σ(t)Φ(t)F (t)(y0)

Introduction to Runge–Kutta methods

Page 61: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The formal Taylor expansion of the numerical approximation tothe solution at x0 + h is

y1 = y0 +∑

t∈T

β(t)hr(t)

r(t)!Φ(t)F (t)(y0)

Using the known formula for β(t), we can write this as

y1 = y0 +∑

t∈T

hr(t)

σ(t)Φ(t)F (t)(y0)

Introduction to Runge–Kutta methods

Page 62: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Order conditions

To match the Taylor series

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

y1 = y0 +∑

t∈T

hr(t)

σ(t)Φ(t)F (t)(y0)

up to hp terms we need to ensure that

Φ(t) =1

γ(t),

for all trees such thatr(t) ≤ p.

These are the “order conditions”.

Introduction to Runge–Kutta methods

Page 63: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

Order conditions

To match the Taylor series

y(x0 + h) = y0 +∑

t∈T

hr(t)

σ(t)γ(t)F (t)(y0)

y1 = y0 +∑

t∈T

hr(t)

σ(t)Φ(t)F (t)(y0)

up to hp terms we need to ensure that

Φ(t) =1

γ(t),

for all trees such thatr(t) ≤ p.

These are the “order conditions”.

Introduction to Runge–Kutta methods

Page 64: John Butcher’s tutorials - Department of Mathematicsbutcher/ODE-book-2008/Tutorials/... · Introduction Formulation Taylor series: exact solution Approximation Order conditions

Introduction Formulation Taylor series: exact solution Approximation Order conditions

The order conditions will be illustrated in the case of explicit 4stage methods with order 4.

t Φ(t) = 1γ(t)

b1 + b2 + b3 + b4 = 1

b2c2 + b3c3 + b4c4 = 12

b2c22 + b3c

23 + b4c

24 = 1

3

b3a32c2 + b4a42c2 + b4a43c3 = 16

b2c32 + b3c

33 + b4c

34 = 1

4

b3c3a32c2 + b4c4a42c2 + b4c4a43c3 = 18

b3a32c22 + b4a42c

22 + b4a43c

23 = 1

12

b4a43a32c2 = 124

Introduction to Runge–Kutta methods