Design of optimal Runge-Kutta methods David I. Ketcheson King - - PowerPoint PPT Presentation

design of optimal runge kutta methods
SMART_READER_LITE
LIVE PREVIEW

Design of optimal Runge-Kutta methods David I. Ketcheson King - - PowerPoint PPT Presentation

Design of optimal Runge-Kutta methods David I. Ketcheson King Abdullah University of Science & Technology (KAUST) D. Ketcheson (KAUST) 1 / 36 Acknowledgments Some parts of this are joint work with: Aron Ahmadia Matteo Parsani D.


slide-1
SLIDE 1

Design of optimal Runge-Kutta methods

David I. Ketcheson

King Abdullah University of Science & Technology (KAUST)

  • D. Ketcheson (KAUST)

1 / 36

slide-2
SLIDE 2

Acknowledgments

Some parts of this are joint work with: Aron Ahmadia Matteo Parsani

  • D. Ketcheson (KAUST)

2 / 36

slide-3
SLIDE 3

Outline

1

High order Runge-Kutta methods

2

Linear properties of Runge-Kutta methods

3

Nonlinear properties of Runge-Kutta methods

4

Putting it all together: some optimal methods and applications

  • D. Ketcheson (KAUST)

3 / 36

slide-4
SLIDE 4

Outline

1

High order Runge-Kutta methods

2

Linear properties of Runge-Kutta methods

3

Nonlinear properties of Runge-Kutta methods

4

Putting it all together: some optimal methods and applications

  • D. Ketcheson (KAUST)

4 / 36

slide-5
SLIDE 5

Solution of hyperbolic PDEs

The fundamental algorithmic barrier is the CFL condition: ∆t ≤ a∆x Implicit methods don’t usually help (due to reduced accuracy)

  • D. Ketcheson (KAUST)

5 / 36

slide-6
SLIDE 6

Solution of hyperbolic PDEs

The fundamental algorithmic barrier is the CFL condition: ∆t ≤ a∆x Implicit methods don’t usually help (due to reduced accuracy) Strong scaling limits the effectiveness of spatial parallelism alone

  • D. Ketcheson (KAUST)

5 / 36

slide-7
SLIDE 7

Solution of hyperbolic PDEs

The fundamental algorithmic barrier is the CFL condition: ∆t ≤ a∆x Implicit methods don’t usually help (due to reduced accuracy) Strong scaling limits the effectiveness of spatial parallelism alone Strategy: keep ∆x as large as possible by using high order methods

  • D. Ketcheson (KAUST)

5 / 36

slide-8
SLIDE 8

Solution of hyperbolic PDEs

The fundamental algorithmic barrier is the CFL condition: ∆t ≤ a∆x Implicit methods don’t usually help (due to reduced accuracy) Strong scaling limits the effectiveness of spatial parallelism alone Strategy: keep ∆x as large as possible by using high order methods But: high order methods cost more and require more memory

  • D. Ketcheson (KAUST)

5 / 36

slide-9
SLIDE 9

Solution of hyperbolic PDEs

The fundamental algorithmic barrier is the CFL condition: ∆t ≤ a∆x Implicit methods don’t usually help (due to reduced accuracy) Strong scaling limits the effectiveness of spatial parallelism alone Strategy: keep ∆x as large as possible by using high order methods But: high order methods cost more and require more memory Can we develop high order methods that are as efficient as lower

  • rder methods?
  • D. Ketcheson (KAUST)

5 / 36

slide-10
SLIDE 10

Time Integration

Using a better time integrator is usually simple but can be highly beneficial.

  • D. Ketcheson (KAUST)

6 / 36

slide-11
SLIDE 11

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required

  • D. Ketcheson (KAUST)

6 / 36

slide-12
SLIDE 12

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required Alleviate timestep resrictions due to

  • D. Ketcheson (KAUST)

6 / 36

slide-13
SLIDE 13

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required Alleviate timestep resrictions due to

Linear stability

  • D. Ketcheson (KAUST)

6 / 36

slide-14
SLIDE 14

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required Alleviate timestep resrictions due to

Linear stability Nonlinear stability

  • D. Ketcheson (KAUST)

6 / 36

slide-15
SLIDE 15

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required Alleviate timestep resrictions due to

Linear stability Nonlinear stability

Improve accuracy (truncation error, dispersion, dissipation)

  • D. Ketcheson (KAUST)

6 / 36

slide-16
SLIDE 16

Time Integration

Using a better time integrator is usually simple but can be highly beneficial. Using a different time integrator can: Reduce the number of RHS evaluations required Alleviate timestep resrictions due to

Linear stability Nonlinear stability

Improve accuracy (truncation error, dispersion, dissipation) Reduce storage requirements

  • D. Ketcheson (KAUST)

6 / 36

slide-17
SLIDE 17

Runge-Kutta Methods

To solve the initial value problem: u′(t) = F(u(t)), u(0) = u0 a Runge-Kutta method computes approximations un ≈ u(n∆t): yi = un + ∆t

i−1

  • j=1

aijF(yj) un+1 = un + ∆t

s−1

  • j=1

bjF(yj) The accuracy and stability of the method depend on the coefficient matrix A and vector b.

  • D. Ketcheson (KAUST)

7 / 36

slide-18
SLIDE 18

Runge-Kutta Methods: a philosophical aside

An RK method builds up information about the solution derivatives through the computation of intermediate stages At the end of a step all of this information is thrown away! Use more stages = ⇒ keep information around longer

  • D. Ketcheson (KAUST)

8 / 36

slide-19
SLIDE 19

Outline

1

High order Runge-Kutta methods

2

Linear properties of Runge-Kutta methods

3

Nonlinear properties of Runge-Kutta methods

4

Putting it all together: some optimal methods and applications

  • D. Ketcheson (KAUST)

9 / 36

slide-20
SLIDE 20

The Stability Function

For the linear equation u′ = λu, a Runge-Kutta method yields a solution un+1 = φ(λ∆t)un, where φ is called the stability function of the method: φ(z) = det(I − z(A − ebT) det(I − zA)

  • D. Ketcheson (KAUST)

10 / 36

slide-21
SLIDE 21

The Stability Function

For the linear equation u′ = λu, a Runge-Kutta method yields a solution un+1 = φ(λ∆t)un, where φ is called the stability function of the method: φ(z) = det(I − z(A − ebT) det(I − zA) Example: Euler’s Method un+1 = un + ∆tF(u); φ(z) = 1 + z.

  • D. Ketcheson (KAUST)

10 / 36

slide-22
SLIDE 22

The Stability Function

For the linear equation u′ = λu, a Runge-Kutta method yields a solution un+1 = φ(λ∆t)un, where φ is called the stability function of the method: φ(z) = det(I − z(A − ebT) det(I − zA) Example: Euler’s Method un+1 = un + ∆tF(u); φ(z) = 1 + z. For explicit methods of order p: φ(z) =

p

  • j=0

1 j!zj +

s

  • j=p+1

αjzj.

  • D. Ketcheson (KAUST)

10 / 36

slide-23
SLIDE 23

Absolute Stability

For the linear equation u′(t) = Lu we say the solution is absolutely stable if |φ(λ∆t)| ≤ 1 for all λ ∈ σ(L).

  • D. Ketcheson (KAUST)

11 / 36

slide-24
SLIDE 24

Absolute Stability

For the linear equation u′(t) = Lu we say the solution is absolutely stable if |φ(λ∆t)| ≤ 1 for all λ ∈ σ(L). Example: Euler’s Method un+1 = un + ∆tF(u); φ(z) = 1 + z. −1

  • D. Ketcheson (KAUST)

11 / 36

slide-25
SLIDE 25

Stability optimization

This leads naturally to the following problem.

Stability optimization

Given L, p, s, maximize ∆t subject to |φ(∆tλ)| − 1 ≤ 0, λ ∈ σ(L), where φ(z) =

p

  • j=0

1 j!zj +

s

  • j=p+1

αjzj. Here the decision variables are ∆t and the coefficients αj, j = p + 1, . . . , s. This problem is quite difficult; we approximate its solution by solving a sequence of convex problems (DK & A. Ahmadia, arXiv preprint).

  • D. Ketcheson (KAUST)

12 / 36

slide-26
SLIDE 26

Accuracy optimization

We could instead optimize accuracy over some region in C:

Accuracy optimization

Given L, p, s, maximize ∆t subject to |φ(∆tλ) − exp(∆tλ| ≤ ǫ, λ ∈ σ(L), where φ(z) =

p

  • j=0

1 j!zj +

s

  • j=p+1

αjzj. In the PDE case, we can replace exp(∆tλ) with the exact dispersion relation for each Fourier mode.

  • D. Ketcheson (KAUST)

13 / 36

slide-27
SLIDE 27

Stability Optimization: a toy example

As an example, consider the advection equation ut + ux = 0 discretized in space by first-order upwind differencing with unit spatial mesh size U′

i (t) = −(Ui(t) − Ui−1(t))

with periodic boundary condition U0(t) = UN(t).

4 3 2 10 1 8 6 4 2 2 4 6 8

  • D. Ketcheson (KAUST)

14 / 36

slide-28
SLIDE 28

Stability Optimization: a toy example

4 3 2 10 1 8 6 4 2 2 4 6 8

(a) RK(4,4)

14 12 10 8 6 4 2 8 6 4 2 2 4 6 8

(b) Optimized 10-stage method

  • D. Ketcheson (KAUST)

15 / 36

slide-29
SLIDE 29

Stability Optimization: a toy example

What is the relative efficiency? Stable step size Cost per step RK(4,4): 1.4 4 ≈ 0.35 RK(10,4): 6 10 = 0.6 By allowing even more stages, can asymptotically approach the efficiency

  • f Euler’s method.
  • D. Ketcheson (KAUST)

16 / 36

slide-30
SLIDE 30

Stability Optimization: a more interesting example

Second order discontinuous Galerkin discretization of advection:

  • D. Ketcheson (KAUST)

17 / 36

slide-31
SLIDE 31

Stability Optimization: one more example

80 70 60 50 40 30 20 10 20 15 10 5 5 10 15 20

s = 20

  • D. Ketcheson (KAUST)

18 / 36

slide-32
SLIDE 32

Stability Optimization: one more example

s = 20

  • D. Ketcheson (KAUST)

18 / 36

slide-33
SLIDE 33

Stability Optimization: one more example

s = 20

  • D. Ketcheson (KAUST)

18 / 36

slide-34
SLIDE 34

Outline

1

High order Runge-Kutta methods

2

Linear properties of Runge-Kutta methods

3

Nonlinear properties of Runge-Kutta methods

4

Putting it all together: some optimal methods and applications

  • D. Ketcheson (KAUST)

19 / 36

slide-35
SLIDE 35

Nonlinear accuracy

Besides the conditions on the stability polynomial coefficients, high order Runge-Kutta methods must satisfy additional nonlinear order conditions. p = 1:

i bi = 1

p = 2:

i,j biaij = 1/2

p = 3:

i,j,k biaijajk = 1/6

  • i,j,k biaijaik = 1/3

Number of conditions grows factorially (719 conditions for order 10).

  • D. Ketcheson (KAUST)

20 / 36

slide-36
SLIDE 36

Beyond linear stability

Classical stability theory and its extensions focus on weak bounds: un ≤ C(t) linear problems inner product norms For hyperbolic PDEs, we are often interested in strict bounds un ≤ C nonlinear problems L1, L∞, TV , or positivity We refer to bounds of the latter types as strong stability properties. For example: unTV ≤ un−1TV

  • D. Ketcheson (KAUST)

21 / 36

slide-37
SLIDE 37

Strong stability preservation

Designing fully-discrete schemes with strong stability properties is notoriously difficult!

  • D. Ketcheson (KAUST)

22 / 36

slide-38
SLIDE 38

Strong stability preservation

Designing fully-discrete schemes with strong stability properties is notoriously difficult! Instead, one often takes a method-of-lines approach and assumes explicit Euler time integration.

  • D. Ketcheson (KAUST)

22 / 36

slide-39
SLIDE 39

Strong stability preservation

Designing fully-discrete schemes with strong stability properties is notoriously difficult! Instead, one often takes a method-of-lines approach and assumes explicit Euler time integration. But in practice, we need to use higher order methods, for reasons of both accuracy and linear stability.

  • D. Ketcheson (KAUST)

22 / 36

slide-40
SLIDE 40

Strong stability preservation

Designing fully-discrete schemes with strong stability properties is notoriously difficult! Instead, one often takes a method-of-lines approach and assumes explicit Euler time integration. But in practice, we need to use higher order methods, for reasons of both accuracy and linear stability. Strong stability preserving methods provide higher order accuracy while maintaining any convex functional bound satisfied by Euler timestepping.

  • D. Ketcheson (KAUST)

22 / 36

slide-41
SLIDE 41

The Forward Euler condition

Recall our ODE system (typically from a PDE) ut = F(u), where the spatial discretization F(u) is carefully chosen1 so that the solution from the forward Euler method un+1 = un + ∆tF(un), satisfies the monotonicity requirement ||un+1|| ≤ ||un||, in some norm, semi-norm or convex functional || · ||, for a suitably restricted timestep ∆t ≤ ∆tFE.

1e.g. TVD, TVB

  • D. Ketcheson (KAUST)

23 / 36

slide-42
SLIDE 42

Runge–Kutta methods as a convex combination of Euler

Consider the two-stage method: y1 = un + ∆tF(un) un+1 = un + 1 2∆t

  • F(un) + F(y1)
  • Is ||un+1|| ≤ ||un||?
  • D. Ketcheson (KAUST)

24 / 36

slide-43
SLIDE 43

Runge–Kutta methods as a convex combination of Euler

Consider the two-stage method: y1 = un + ∆tF(un) un+1 = 1 2un + 1 2

  • y1 + ∆tF(y1)
  • .

Take ∆t ≤ ∆tFE. Then ||y1|| ≤ ||un||, so ||un+1|| ≤ 1 2||un|| + 1 2||y1 + ∆tF(y1)|| ≤ ||un||. ||un+1|| ≤ ||un||

  • D. Ketcheson (KAUST)

24 / 36

slide-44
SLIDE 44

Optimized SSP methods

In general, an SSP method preserves strong stability properties satisfied by Euler’s method, under a modified step size restriction: ∆t ≤ C∆tFE. A fair metric for comparison is the effective SSP coefficient: Ceff = C # of stages By designing high order methods with many stages, we can achieve Ceff → 1.

  • D. Ketcheson (KAUST)

25 / 36

slide-45
SLIDE 45

Example: A highly oscillatory flow field

ut +

  • cos2(20x + 45t)u
  • x = 0

u(0, t) = 0 Method ceff Monotone effective timestep NSSP(3,2) 0.037 SSP(50,2) 0.980 0.980 NSSP(3,3) 0.004 NSSP(5,3) 0.017 SSP(64,3) 0.875 0.875 RK(4,4) 0.287 SSP(5,4) 0.302 0.416 SSP(10,4) 0.600 0.602

  • D. Ketcheson (KAUST)

26 / 36

slide-46
SLIDE 46

Low storage methods

Straightforward implementation of an s-stage RK method requires s + 1 memory locations per unknown Special low-storage methods are designed so that each stage only depends on one or two most recent previous stages Thus older stages can be discarded as the new ones are computed It is often desirable to

Keep the previous solution around to be able to restart a step Compute an error estimate

This requires a minimum of three storage locations per unknown

  • D. Ketcheson (KAUST)

27 / 36

slide-47
SLIDE 47

Low storage methods

3S Algorithm

S3 := un (y1) S1 := un for i = 2 : m + 1 do S2 := S2 + δi−1S1 (yi) S1 := γi1S1 + γi2S2 + γi3S3 + βi,i−1∆tF(S1) end (ˆ un+1) S2 := 1 m+2

j=1 δj

(S2 + δm+1S1 + δm+2S3) un+1 = S1

  • D. Ketcheson (KAUST)

28 / 36

slide-48
SLIDE 48

Outline

1

High order Runge-Kutta methods

2

Linear properties of Runge-Kutta methods

3

Nonlinear properties of Runge-Kutta methods

4

Putting it all together: some optimal methods and applications

  • D. Ketcheson (KAUST)

29 / 36

slide-49
SLIDE 49

Two-step optimization process

Our optimization approach proceeds in two steps:

1 Optimize the linear stability or accuracy of the scheme by choosing

the stability polynomial coefficients αj

  • D. Ketcheson (KAUST)

30 / 36

slide-50
SLIDE 50

Two-step optimization process

Our optimization approach proceeds in two steps:

1 Optimize the linear stability or accuracy of the scheme by choosing

the stability polynomial coefficients αj

2 Optimize the nonlinear stability/accuracy and storage requirements by

choosing the Butcher coefficients aij, bj.

  • D. Ketcheson (KAUST)

30 / 36

slide-51
SLIDE 51

Two-step optimization process

Our optimization approach proceeds in two steps:

1 Optimize the linear stability or accuracy of the scheme by choosing

the stability polynomial coefficients αj

2 Optimize the nonlinear stability/accuracy and storage requirements by

choosing the Butcher coefficients aij, bj.

  • D. Ketcheson (KAUST)

30 / 36

slide-52
SLIDE 52

Two-step optimization process

Our optimization approach proceeds in two steps:

1 Optimize the linear stability or accuracy of the scheme by choosing

the stability polynomial coefficients αj

2 Optimize the nonlinear stability/accuracy and storage requirements by

choosing the Butcher coefficients aij, bj. Each of these steps is a complex numerical problem in itself, involving nonconvex optimization in dozens to hundreds of variables, with nonlinear equality and inequality constraints.

  • D. Ketcheson (KAUST)

30 / 36

slide-53
SLIDE 53

Optimizing for the SD spectrum

On regular grids, SD leads to a block-Toeplitz operator We perform a von Neumann-like analysis using a ”generating pattern”

i + 1, j − 1 i + 1, j i − 1, j

  • g2
  • g1

i, j + 1 i + 1, j + 1 i, j i − 1, j + 1 i − 1, j − 1 i, j − 1

dWi,j dt + a ∆g

  • T0,0 Wi,j + T−1,0 Wi−1,j + T0,−1 Wi,j−1

+T+1,0 Wi+1,j + T0,+1 Wi,j+1

  • = 0
  • D. Ketcheson (KAUST)

31 / 36

slide-54
SLIDE 54

Optimizing for the SD spectrum

Blue: eigenvalues; Red: RK stability boundary The convex hull of the generated spectrum is used as a proxy to accelerate the optimization process

  • D. Ketcheson (KAUST)

32 / 36

slide-55
SLIDE 55

Optimizing for the SD spectrum

Primarily optimized for stable step size Secondary optimization for nonlinear accuracy and low-storage (3 memory locations per unknown)

  • D. Ketcheson (KAUST)

33 / 36

slide-56
SLIDE 56

Application: flow past a wedge

fully unstructured mesh

  • D. Ketcheson (KAUST)

34 / 36

slide-57
SLIDE 57

Application: flow past a wedge

Density at t = 100 62% speedup using optimized method

  • D. Ketcheson (KAUST)

35 / 36

slide-58
SLIDE 58

Conclusions

Numerical optimization allows for flexible, targeted design of time integrators Stability optimization based on spectra from a model (linear) problem

  • n a uniform grid seems to work well even for nonlinear problems on

fully unstructured grids Significant speedup can be achieved in practice (greater for higher

  • rder methods)
  • D. Ketcheson (KAUST)

36 / 36