77
Numerical Treatment . . . Euler’s Method Discretization Error Order of Convergence Method of Runge and . . . Alternative: Multistep . . . Implicit Methods Types of Problems for . . . Ill-Conditioned Problems Stability Stiffness Boundary Value . . . Boundary Value . . . Page 1 of 13 Introduction to Scientific Computing 5. Numerical Methods for ODE Miriam Mehl 1. Numerical Treatment of ODE • remember population dynamics: one or some ODE given as an initial value problem: starting point given

1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 1 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

1. Numerical Treatment of ODE

• remember population dynamics: one or some ODE

– given as an initial value problem : starting point given

Page 2: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 1 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

1. Numerical Treatment of ODE

• remember population dynamics: one or some ODE

– given as an initial value problem : starting point given

– sometimes also as a boundary value problem: starting andfinal point given (think of a space shuttle’s trajectory, e.g.)

Page 3: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 1 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

1. Numerical Treatment of ODE

• remember population dynamics: one or some ODE

– given as an initial value problem : starting point given

– sometimes also as a boundary value problem: starting andfinal point given (think of a space shuttle’s trajectory, e.g.)

• prototypes of an initial value problem (IVP):

y(t) = f(t, y(t)), y(a) = ya, t ≥ a

Page 4: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 1 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

1. Numerical Treatment of ODE

• remember population dynamics: one or some ODE

– given as an initial value problem : starting point given

– sometimes also as a boundary value problem: starting andfinal point given (think of a space shuttle’s trajectory, e.g.)

• prototypes of an initial value problem (IVP):

y(t) = f(t, y(t)), y(a) = ya, t ≥ a

or for several unknowns yi, i = 1, . . . , n:

yi(t) = fi(t, y1(t), . . . , yn(t)), yi(a) = yi,a, t ≥ a, i = 1, . . . , n

Page 5: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 1 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

1. Numerical Treatment of ODE

• remember population dynamics: one or some ODE

– given as an initial value problem : starting point given

– sometimes also as a boundary value problem: starting andfinal point given (think of a space shuttle’s trajectory, e.g.)

• prototypes of an initial value problem (IVP):

y(t) = f(t, y(t)), y(a) = ya, t ≥ a

or for several unknowns yi, i = 1, . . . , n:

yi(t) = fi(t, y1(t), . . . , yn(t)), yi(a) = yi,a, t ≥ a, i = 1, . . . , n

• if f depends on t only: simple integration or quadrature

Page 6: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 2 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

2. Euler’s Method

• standard approach for IVP: finite difference approximation (dif-ference quotient instead of derivative)

yk+1−yk

δt= f(tk, yk), tk = a + kδt, k = 0, 1, . . .,

Page 7: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 2 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

2. Euler’s Method

• standard approach for IVP: finite difference approximation (dif-ference quotient instead of derivative)

yk+1−yk

δt= f(tk, yk), tk = a + kδt, k = 0, 1, . . .,

which gives an explicit formula for yk+1 once yk is given:

yk+1 = yk + δt · f(tk, yk).

Page 8: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 2 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

2. Euler’s Method

• standard approach for IVP: finite difference approximation (dif-ference quotient instead of derivative)

yk+1−yk

δt= f(tk, yk), tk = a + kδt, k = 0, 1, . . .,

which gives an explicit formula for yk+1 once yk is given:

yk+1 = yk + δt · f(tk, yk).

• this is the simplest strategy and called Euler’s method

Page 9: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 2 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

2. Euler’s Method

• standard approach for IVP: finite difference approximation (dif-ference quotient instead of derivative)

yk+1−yk

δt= f(tk, yk), tk = a + kδt, k = 0, 1, . . .,

which gives an explicit formula for yk+1 once yk is given:

yk+1 = yk + δt · f(tk, yk).

• this is the simplest strategy and called Euler’s method

• other derivation: truncated Taylor expansion of y(t)

y(tk+1) = y(tk) + δt · y(tk) + O(δt2).= y(tk) + δt · f(tk, yk)

Page 10: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 3 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

3. Discretization Error

• local discretization error: local influence of using differences in-stead of derivatives; here:

Page 11: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 3 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

3. Discretization Error

• local discretization error: local influence of using differences in-stead of derivatives; here:

l(δt) = max[a,b]{| y(t+δt)−y(t)δt

− f(t, y(t)) |}

with y(t) exact solution of the ODE.

Page 12: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 3 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

3. Discretization Error

• local discretization error: local influence of using differences in-stead of derivatives; here:

l(δt) = max[a,b]{| y(t+δt)−y(t)δt

− f(t, y(t)) |}

with y(t) exact solution of the ODE.

• global discretization error: maximum error of all computed dis-crete approximations:

e(δt) = max[a,b]{| yk − y(tk) |}

with y(t) exact solution of the ODE, yk, k = 1, 2, . . . solution ofthe discretized equation.

Page 13: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 3 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

3. Discretization Error

• local discretization error: local influence of using differences in-stead of derivatives; here:

l(δt) = max[a,b]{| y(t+δt)−y(t)δt

− f(t, y(t)) |}

with y(t) exact solution of the ODE.

• global discretization error: maximum error of all computed dis-crete approximations:

e(δt) = max[a,b]{| yk − y(tk) |}

with y(t) exact solution of the ODE, yk, k = 1, 2, . . . solution ofthe discretized equation.

• consistency:

l(δt) → 0 for δt → 0

Page 14: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 3 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

3. Discretization Error

• local discretization error: local influence of using differences in-stead of derivatives; here:

l(δt) = max[a,b]{| y(t+δt)−y(t)δt

− f(t, y(t)) |}

with y(t) exact solution of the ODE.

• global discretization error: maximum error of all computed dis-crete approximations:

e(δt) = max[a,b]{| yk − y(tk) |}

with y(t) exact solution of the ODE, yk, k = 1, 2, . . . solution ofthe discretized equation.

• consistency:

l(δt) → 0 for δt → 0

• convergence (stronger):

e(δt) → 0 for δt → 0

Page 15: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

Page 16: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

Page 17: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

Page 18: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

Page 19: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

• look for higher-order methods (faster convergence)

Page 20: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

• look for higher-order methods (faster convergence)

– start from Taylor expansion: leads to complicated formulas(higher derivatives of f )

Page 21: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

• look for higher-order methods (faster convergence)

– start from Taylor expansion: leads to complicated formulas(higher derivatives of f )

– use additional evaluations of f : Runge-Kutta-type methods

Page 22: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

• look for higher-order methods (faster convergence)

– start from Taylor expansion: leads to complicated formulas(higher derivatives of f )

– use additional evaluations of f : Runge-Kutta-type methods

– simplest representative: method of Heun

yk+1 = yk + δt2

(f(tk, yk) + f(tk+1, yk + δt · f(tk, yk))

)

Page 23: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 4 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

4. Order of Convergence

• Euler (some restrictions with respect to y and f ):

– consistent of first order: l(δt) = O(δt)

– convergent of first order: e(δt) = O(δt)

– There are methods which are consistent but do not con-verge!

• look for higher-order methods (faster convergence)

– start from Taylor expansion: leads to complicated formulas(higher derivatives of f )

– use additional evaluations of f : Runge-Kutta-type methods

– simplest representative: method of Heun

yk+1 = yk + δt2

(f(tk, yk) + f(tk+1, yk + δt · f(tk, yk))

)both consistent and convergent of second order

Page 24: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 5 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

5. Method of Runge and Kutta

• most famous representative: Runge-Kutta method

Page 25: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 5 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

5. Method of Runge and Kutta

• most famous representative: Runge-Kutta method

yk+1 = yk +δt

6(T1 + 2T2 + 2T3 + T4),

T1 = f(tk, yk),

T2 = f

(tk +

δt

2, yk +

δt

2T1

),

T3 = f

(tk +

δt

2, yk +

δt

2T2

),

T4 = f(tk+1, yk + δtT3)

Page 26: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 5 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

5. Method of Runge and Kutta

• most famous representative: Runge-Kutta method

yk+1 = yk +δt

6(T1 + 2T2 + 2T3 + T4),

T1 = f(tk, yk),

T2 = f

(tk +

δt

2, yk +

δt

2T1

),

T3 = f

(tk +

δt

2, yk +

δt

2T2

),

T4 = f(tk+1, yk + δtT3)

• consistent and convergent of fourth order

Page 27: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 5 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

5. Method of Runge and Kutta

• most famous representative: Runge-Kutta method

yk+1 = yk +δt

6(T1 + 2T2 + 2T3 + T4),

T1 = f(tk, yk),

T2 = f

(tk +

δt

2, yk +

δt

2T1

),

T3 = f

(tk +

δt

2, yk +

δt

2T2

),

T4 = f(tk+1, yk + δtT3)

• consistent and convergent of fourth order

• Euler/Heun/Runge-Kutta correspond to rectangle/trapezoidal/Simp-son quadrature!

Page 28: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

Page 29: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

Page 30: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

– prominent representative: second-order method

yk+1 = yk + δt2

(3f(tk, yk)− f(tk−1, yk−1)

)

Page 31: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

– prominent representative: second-order method

yk+1 = yk + δt2

(3f(tk, yk)− f(tk−1, yk−1)

)– idea: use evaluations of f for previous approximations

yk−p+1, . . . , yk to find an approximation of the f -integral inthe integral form of the ODE:

yk+1 = yk +∫ tk+1

tkf(t, y(t))dt.

Page 32: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

– prominent representative: second-order method

yk+1 = yk + δt2

(3f(tk, yk)− f(tk−1, yk−1)

)– idea: use evaluations of f for previous approximations

yk−p+1, . . . , yk to find an approximation of the f -integral inthe integral form of the ODE:

yk+1 = yk +∫ tk+1

tkf(t, y(t))dt.

– general form: take polynomial P (t) interpolating f in thediscrete points of time (tk−p+1, . . . , tk)

yk+1.= yk +

∫ tk+1

tkP (t)dt

Page 33: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

– prominent representative: second-order method

yk+1 = yk + δt2

(3f(tk, yk)− f(tk−1, yk−1)

)– idea: use evaluations of f for previous approximations

yk−p+1, . . . , yk to find an approximation of the f -integral inthe integral form of the ODE:

yk+1 = yk +∫ tk+1

tkf(t, y(t))dt.

– general form: take polynomial P (t) interpolating f in thediscrete points of time (tk−p+1, . . . , tk)

yk+1.= yk +

∫ tk+1

tkP (t)dt

– p = 1: Euler; p = 2: above method; generally: order p

Page 34: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 6 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

6. Alternative: Multistep Methods

• Runge-Kutta-type methods are expensive : many evaluationsof f (sometimes not given in closed form)

• different way to get higher order by profiting from history: Adams-Bashforth-type or multistep methods

– prominent representative: second-order method

yk+1 = yk + δt2

(3f(tk, yk)− f(tk−1, yk−1)

)– idea: use evaluations of f for previous approximations

yk−p+1, . . . , yk to find an approximation of the f -integral inthe integral form of the ODE:

yk+1 = yk +∫ tk+1

tkf(t, y(t))dt.

– general form: take polynomial P (t) interpolating f in thediscrete points of time (tk−p+1, . . . , tk)

yk+1.= yk +

∫ tk+1

tkP (t)dt

– p = 1: Euler; p = 2: above method; generally: order p

– start: no/not enough predecessors available; hence modify!

Page 35: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

Page 36: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

Page 37: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

Page 38: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

– second order variant:

yk+1 = yk + δt2(fk + fk+1)

Page 39: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

– second order variant:

yk+1 = yk + δt2(fk + fk+1)

– fourth order variant:

yk+1 = yk + δt24

(fk−2 − 5fk−1 + 19fk + 9fk+1)

Page 40: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

– second order variant:

yk+1 = yk + δt2(fk + fk+1)

– fourth order variant:

yk+1 = yk + δt24

(fk−2 − 5fk−1 + 19fk + 9fk+1)

• How to get fk+1 = f(yk+1, tk+1) in the implicit case?

Page 41: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

– second order variant:

yk+1 = yk + δt2(fk + fk+1)

– fourth order variant:

yk+1 = yk + δt24

(fk−2 − 5fk−1 + 19fk + 9fk+1)

• How to get fk+1 = f(yk+1, tk+1) in the implicit case?

– straightforward way: solve the (generally nonlinear) equa-tion

Page 42: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 7 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

7. Implicit Methods

• All schemes mentioned so far are explicit ones: The rule showsa direct way to do another time step.

• now: use the new value yk+1 on the right-hand side, too

• This leads us to Adams-Moulton multistep schemes:

– use interpolation and previous values as with Adams-Bashforth(fj = f(yj, tj))

– second order variant:

yk+1 = yk + δt2(fk + fk+1)

– fourth order variant:

yk+1 = yk + δt24

(fk−2 − 5fk−1 + 19fk + 9fk+1)

• How to get fk+1 = f(yk+1, tk+1) in the implicit case?

– straightforward way: solve the (generally nonlinear) equa-tion

– easier (and widespread): predictor-correctorapproach

Page 43: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 8 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

8. Types of Problems for Numerical Methods for ODEs

• Ill-Conditioned Problems:

small changes in the input ⇒ big changes in the exact solutionof the ODE

Page 44: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 8 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

8. Types of Problems for Numerical Methods for ODEs

• Ill-Conditioned Problems:

small changes in the input ⇒ big changes in the exact solutionof the ODE

• Instabilities:

big errors in the approximate (i.e. numerical) solution comparedto the exact solution (for arbitrarily small time steps although themethod is consistent)

Page 45: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 8 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

8. Types of Problems for Numerical Methods for ODEs

• Ill-Conditioned Problems:

small changes in the input ⇒ big changes in the exact solutionof the ODE

• Instabilities:

big errors in the approximate (i.e. numerical) solution comparedto the exact solution (for arbitrarily small time steps although themethod is consistent)

• Stiffness:

small time steps required for acceptable errors in the approxi-mate solution (although the exact solution is smooth)

Page 46: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

Page 47: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

Page 48: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

• an example:

– consider the ODE: y(t)−N · y(t)− (N + 1) · y(t) = 0

– initial conditions: y(0) = 1, y(0) = −1

– exact solution: y(t) = e−t

Page 49: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

• an example:

– consider the ODE: y(t)−N · y(t)− (N + 1) · y(t) = 0

– initial conditions: y(0) = 1, y(0) = −1

– exact solution: y(t) = e−t

• slight change in initial condition:

– new value of y in t = 0: yε(0) = 1 + ε

Page 50: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

• an example:

– consider the ODE: y(t)−N · y(t)− (N + 1) · y(t) = 0

– initial conditions: y(0) = 1, y(0) = −1

– exact solution: y(t) = e−t

• slight change in initial condition:

– new value of y in t = 0: yε(0) = 1 + ε

– resulting new solution: yε(t) =

(1 + N+1

N+2ε

)e−t + ε

N+2e(N+1)t

Page 51: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

• an example:

– consider the ODE: y(t)−N · y(t)− (N + 1) · y(t) = 0

– initial conditions: y(0) = 1, y(0) = −1

– exact solution: y(t) = e−t

• slight change in initial condition:

– new value of y in t = 0: yε(0) = 1 + ε

– resulting new solution: yε(t) =

(1 + N+1

N+2ε

)e−t + ε

N+2e(N+1)t

– arbitrarily small change leads to completely different result:t →∞

Page 52: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 9 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

9. Ill-Conditioned Problems

• small changes in input entail completely different results

• Numerical treatment of such problems is difficult!

• an example:

– consider the ODE: y(t)−N · y(t)− (N + 1) · y(t) = 0

– initial conditions: y(0) = 1, y(0) = −1

– exact solution: y(t) = e−t

• slight change in initial condition:

– new value of y in t = 0: yε(0) = 1 + ε

– resulting new solution: yε(t) =

(1 + N+1

N+2ε

)e−t + ε

N+2e(N+1)t

– arbitrarily small change leads to completely different result:t →∞

• risk: non-precise input, round-off errors,. . .

Page 53: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

Page 54: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

Page 55: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

Page 56: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

• use the midpoint rule: yk+1 = yk−1 + 2δt · fk

yk+1 = yk−1 + 2δt(−2yk + 1) = yk−1 − 4δt · yk + 2δt, y0 = 1

Page 57: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

• use the midpoint rule: yk+1 = yk−1 + 2δt · fk

yk+1 = yk−1 + 2δt(−2yk + 1) = yk−1 − 4δt · yk + 2δt, y0 = 1

• 2-step rule: start with initial value and the exact y(δt)

Page 58: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

• use the midpoint rule: yk+1 = yk−1 + 2δt · fk

yk+1 = yk−1 + 2δt(−2yk + 1) = yk−1 − 4δt · yk + 2δt, y0 = 1

• 2-step rule: start with initial value and the exact y(δt)

– time step δt = 1.0 ⇒ y9 = −4945.5, y10 = 20953.9

– time step δt = 0.1 ⇒ y79 = −1725.3, y80 = 2105.7

– time step δt = 0.01 ⇒ y999 = −154.6, y1000 = 158.7

Page 59: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

• use the midpoint rule: yk+1 = yk−1 + 2δt · fk

yk+1 = yk−1 + 2δt(−2yk + 1) = yk−1 − 4δt · yk + 2δt, y0 = 1

• 2-step rule: start with initial value and the exact y(δt)

– time step δt = 1.0 ⇒ y9 = −4945.5, y10 = 20953.9

– time step δt = 0.1 ⇒ y79 = −1725.3, y80 = 2105.7

– time step δt = 0.01 ⇒ y999 = −154.6, y1000 = 158.7

• midpoint rule is second-order consistent, but does not convergehere: oscillations or instable behaviour

Page 60: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 10 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

10. Stability

• consider another IVP: y(t) = −2y(t) + 1, y(0) = 1

• exact solution: y(t) =

(e−2t + 1

)/2

• well-conditioned: yε(0) = 1 + ε ⇒ yε(t)− y(t) = εe−2t

• use the midpoint rule: yk+1 = yk−1 + 2δt · fk

yk+1 = yk−1 + 2δt(−2yk + 1) = yk−1 − 4δt · yk + 2δt, y0 = 1

• 2-step rule: start with initial value and the exact y(δt)

– time step δt = 1.0 ⇒ y9 = −4945.5, y10 = 20953.9

– time step δt = 0.1 ⇒ y79 = −1725.3, y80 = 2105.7

– time step δt = 0.01 ⇒ y999 = −154.6, y1000 = 158.7

• midpoint rule is second-order consistent, but does not convergehere: oscillations or instable behaviour

• there are stability conditions; generally:

consistency + stability = convergence

Page 61: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

Page 62: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

Page 63: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

• problem well-conditioned

Page 64: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

• problem well-conditioned

• explicit Euler: stable (as all explicit 1-step methods or all Adams-Bashforth or all s-step Adams-Moulton methods for s > 1 are)

Page 65: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

• problem well-conditioned

• explicit Euler: stable (as all explicit 1-step methods or all Adams-Bashforth or all s-step Adams-Moulton methods for s > 1 are)

yk+1 = yk + δt(−1000yk + 1000) = (1− 1000δt)yk + 1000δt

= (1− 1000δt)k+1 + 1

Page 66: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

• problem well-conditioned

• explicit Euler: stable (as all explicit 1-step methods or all Adams-Bashforth or all s-step Adams-Moulton methods for s > 1 are)

yk+1 = yk + δt(−1000yk + 1000) = (1− 1000δt)yk + 1000δt

= (1− 1000δt)k+1 + 1

• oscillations and divergence for δt > 0.002

Page 67: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 11 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

11. Stiffness

• for another phenomen, consider the IVP

y(t) = −1000y(t) + 1000, y(0) = y0 = 2

• exact solution: y(t) = e−1000t + 1

• problem well-conditioned

• explicit Euler: stable (as all explicit 1-step methods or all Adams-Bashforth or all s-step Adams-Moulton methods for s > 1 are)

yk+1 = yk + δt(−1000yk + 1000) = (1− 1000δt)yk + 1000δt

= (1− 1000δt)k+1 + 1

• oscillations and divergence for δt > 0.002

• Why that? Consistency and stability are asymptoticterms. Rem-edy: Implicit methods (try implicit Euler)!

Page 68: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 12 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

12. Boundary Value Problems: Outlook

• example:

y = f(t, y, y), ta ≤ t ≤ tb,

Page 69: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 12 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

12. Boundary Value Problems: Outlook

• example:

y = f(t, y, y), ta ≤ t ≤ tb,

y(ta) = ya, y(tb) = yb

Page 70: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 12 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

12. Boundary Value Problems: Outlook

• example:

y = f(t, y, y), ta ≤ t ≤ tb,

y(ta) = ya, y(tb) = yb

• special case:

y(t) = a(t)y(t) + b(t)y(t) + c(t), same b.c.

Page 71: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 12 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

12. Boundary Value Problems: Outlook

• example:

y = f(t, y, y), ta ≤ t ≤ tb,

y(ta) = ya, y(tb) = yb

• special case:

y(t) = a(t)y(t) + b(t)y(t) + c(t), same b.c.

• a vanishing and b positive: BVP has unique solution

Page 72: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 12 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

12. Boundary Value Problems: Outlook

• example:

y = f(t, y, y), ta ≤ t ≤ tb,

y(ta) = ya, y(tb) = yb

• special case:

y(t) = a(t)y(t) + b(t)y(t) + c(t), same b.c.

• a vanishing and b positive: BVP has unique solution

• discrete grid:

δt = (tb − ta)/n, t0 = ta, tn = tb, ti = ta + iδt

Page 73: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 13 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

13. Boundary Value Problem 2

• y(t) = b(t)y(t) + c(t), y(ta) = ya, y(tb) = yb

Page 74: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 13 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

13. Boundary Value Problem 2

• y(t) = b(t)y(t) + c(t), y(ta) = ya, y(tb) = yb

• finite difference approximation for second derivative:

y(t).= y(t+δt)−2y(t)+y(t−δt)

δt2

Page 75: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 13 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

13. Boundary Value Problem 2

• y(t) = b(t)y(t) + c(t), y(ta) = ya, y(tb) = yb

• finite difference approximation for second derivative:

y(t).= y(t+δt)−2y(t)+y(t−δt)

δt2

• discrete analogon to ODE in each grid point:

δt−2 · (yi+1 − 2yi + yi−1)− biyi = ci, i = 1, . . . , n− 1

Page 76: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 13 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

13. Boundary Value Problem 2

• y(t) = b(t)y(t) + c(t), y(ta) = ya, y(tb) = yb

• finite difference approximation for second derivative:

y(t).= y(t+δt)−2y(t)+y(t−δt)

δt2

• discrete analogon to ODE in each grid point:

δt−2 · (yi+1 − 2yi + yi−1)− biyi = ci, i = 1, . . . , n− 1

• tridiagonal system of linear equations

Page 77: 1. Numerical Treatment of ODE€¦ · Numerical Treatment... Euler’s Method Discretization Error Order of Convergence Method of Runge and... Alternative: Multistep... Implicit Methods

Numerical Treatment . . .

Euler’s Method

Discretization Error

Order of Convergence

Method of Runge and . . .

Alternative: Multistep . . .

Implicit Methods

Types of Problems for . . .

Ill-Conditioned Problems

Stability

Stiffness

Boundary Value . . .

Boundary Value . . .

Page 13 of 13

Introduction to Scientific Computing

5. Numerical Methods forODE

Miriam Mehl

13. Boundary Value Problem 2

• y(t) = b(t)y(t) + c(t), y(ta) = ya, y(tb) = yb

• finite difference approximation for second derivative:

y(t).= y(t+δt)−2y(t)+y(t−δt)

δt2

• discrete analogon to ODE in each grid point:

δt−2 · (yi+1 − 2yi + yi−1)− biyi = ci, i = 1, . . . , n− 1

• tridiagonal system of linear equations

• alternative: shooting methods(reduction to IVPs)