Numerical ODE Solutions (Runge-Kutta and Extensions) Kiel Williams - - PowerPoint PPT Presentation

numerical ode solutions runge kutta and extensions
SMART_READER_LITE
LIVE PREVIEW

Numerical ODE Solutions (Runge-Kutta and Extensions) Kiel Williams - - PowerPoint PPT Presentation

Numerical ODE Solutions (Runge-Kutta and Extensions) Kiel Williams 09/23/2016 Algorithms Group Form of the Problem Need to solve: Other initial condition types exist for higher-order equations (boundary-values) Accurate ODE


slide-1
SLIDE 1

Numerical ODE Solutions (Runge-Kutta and Extensions)

Kiel Williams 09/23/2016 Algorithms Group

slide-2
SLIDE 2

Form of the Problem

 Need to solve:  Other initial condition types exist for higher-order equations

(boundary-values)

 Accurate ODE solutions essential to countless theoretical

problems

 Many, many, many different approaches for doing this. We'll

review some of the most common and straightforward

slide-3
SLIDE 3

Simplest Guess: Euler Approach

 Simplest guess for

discretizing solution:

 But method works poorly:  How can we do better in

controlled way?

− Runge-Kutta family of

techniques

slide-4
SLIDE 4

Going Beyond: Runge-Kutta

 Runge-Kutta methods all take form:  Described pictorially by Butcher tables:  For the Euler method:

slide-5
SLIDE 5

4th-Order Runge-Kutta

 The Runge-Kutta method typically refers to 4th-order

Runge-Kutta:

 In Butcher form:

slide-6
SLIDE 6

4th-Order Runge-Kutta

 The Runge-Kutta method typically refers to 4th-order

Runge-Kutta:

 In Butcher form:

slide-7
SLIDE 7

Runge-Kutta Examples and Contrast

 RK4 does well, even

for large step-sizes

− RK4 error of

~0.0001, compared to ~0.1 for Euler

 RK4 error scales as

O(h5)

 If y' depends strictly

  • n x, RK4 is

equivalent to Simpson's Rule integration

slide-8
SLIDE 8

Runge-Kutta Alternatives: Multi-Step Methods

 Runge-Kutta isn't the only feasible option

− Instead of expanding the Butcher table, evaluate the

derivative at more places

 2-Step Adams-Bashforth is one of the simplest useful

methods:

 Like Euler's method, but weights first-derivative value at

different places

 Coefficient determined by Lagrange polynomial interpolation

formula

slide-9
SLIDE 9

 Adams-Bashforth

substantially beats Euler

− A-B error of ~0.01,

compared to ~0.1 for Euler

 Adams-Bashforth error

scales as O(h3)

 One drawback: need 2

points to start the chain

− Need one Euler or

RK4 step to initiate

Runge-Kutta Alternatives: Multi-Step Methods

slide-10
SLIDE 10

Implicit Methods for ODE's

 All methods shown so far are explicit methods, with recursion

relations of form:

 Implicit methods involve recursions relations of the form:  Offer improved accuracy, but need to solve an equation to get

yn+1, evaluate right-hand side of equation

 Typical ways to do this: fixed-point iteration, Newton's method

slide-11
SLIDE 11

Implicit Methods for ODE's, Backward-Euler

 Backward's Euler is simplest implicit method:  To extract value of yn+1 needed to evaluate right-hand side, use

fixed-point iteration to achieve self-consistency:

(Forward Euler, Explicit) (Backward Euler, Implicit)

slide-12
SLIDE 12

 In this example,

backward-Euler doesn't do much better than basic Euler – Not always true!

 Error-scaling is the

same as Euler

 Added complication:

need input tolerance for self-consistency loop

Best to have tolerance as function of h

Implicit Methods for ODE's, Backward-Euler

slide-13
SLIDE 13

Implicit Multi-Step: Adams-Moulton

 Adams-Moulton methods family combine Adams-Bashforth

multi-step approach with implicit techniques

 Most-obvious non-trivial example is ODE analog to the

trapezoid rule:

 Arbitrarily high-order algorithms generated very similarly to

higher-order Adams-Bashforth approach

slide-14
SLIDE 14

 Trapezoid much

better Euler, competitive with RK4

− Much simpler

algorithm than RK4!

 Error scaling goes as

O(h4) – compare to O(h3) for 2-step Adams-Bashforth

Implicit Multi-Step: Adams-Moulton

slide-15
SLIDE 15

Exponential Integrators

 Equations whose solutions contain eax terms notoriously hard

to handle – exp. integrators consider ODE's of form:

 We can discretize the exact formal solution to this equation:  Allows exponential part of y' to be handled exactly – can treat

the “rest” of y' as a perturbative expansion

slide-16
SLIDE 16

Exponential Integrators

 Exponential methods

exactly solve y = y' – Even “good” explicit methods accumulate large errors

 Big drawback: one must

  • ften approximate to get

ODE in proper form to implement

slide-17
SLIDE 17

Summary

 Euler method is poor, motivates superior techniques:

− Explicit methods solve ODE by extrapolating from

values of y, y' at previous points

− Examples include all Runge-Kutta type methods,

including RK4, multi-step methods like Adams- Bashforth

 Implicit methods require knowledge of function value

at next point:

− Require solving an equation, but give better

scaling for same # of function evaluations

− Often preferred in solution of “stiff” ODE's.