Runge Kutta Methods Bernd Schr oder logo1 Bernd Schr oder - - PowerPoint PPT Presentation

runge kutta methods
SMART_READER_LITE
LIVE PREVIEW

Runge Kutta Methods Bernd Schr oder logo1 Bernd Schr oder - - PowerPoint PPT Presentation

Error Analysis Improved Euler Method Runge-Kutta Methods Runge Kutta Methods Bernd Schr oder logo1 Bernd Schr oder Louisiana Tech University, College of Engineering and Science Runge Kutta Methods Error Analysis Improved Euler Method


slide-1
SLIDE 1

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Runge Kutta Methods

Bernd Schr¨

  • der

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-2
SLIDE 2

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-3
SLIDE 3

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 1. Taylor’s Formula. If the function y is n+1 times

differentiable, then for any h there is a c between x and x+h so that y(x+h)=y(x)+y′(x)h+y′′(x) 2! h2+···+y(n)(x) n! hn+y(n+1)(c) (n+1)! hn+1.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-4
SLIDE 4

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 1. Taylor’s Formula. If the function y is n+1 times

differentiable, then for any h there is a c between x and x+h so that y(x+h)=y(x)+y′(x)h+y′′(x) 2! h2+···+y(n)(x) n! hn+y(n+1)(c) (n+1)! hn+1.

  • 2. Euler’s method. For y′ = F(x,y), y(x) = y0 we use that

y(x+∆x) ≈ y(x)+y′(x)∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-5
SLIDE 5

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 1. Taylor’s Formula. If the function y is n+1 times

differentiable, then for any h there is a c between x and x+h so that y(x+h)=y(x)+y′(x)h+y′′(x) 2! h2+···+y(n)(x) n! hn+y(n+1)(c) (n+1)! hn+1.

  • 2. Euler’s method. For y′ = F(x,y), y(x) = y0 we use that

y(x+∆x) ≈ y(x)+y′(x)∆x = y0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-6
SLIDE 6

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 1. Taylor’s Formula. If the function y is n+1 times

differentiable, then for any h there is a c between x and x+h so that y(x+h)=y(x)+y′(x)h+y′′(x) 2! h2+···+y(n)(x) n! hn+y(n+1)(c) (n+1)! hn+1.

  • 2. Euler’s method. For y′ = F(x,y), y(x) = y0 we use that

y(x+∆x) ≈ y(x)+y′(x)∆x = y0 +F(x,y0)∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-7
SLIDE 7

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 1. Taylor’s Formula. If the function y is n+1 times

differentiable, then for any h there is a c between x and x+h so that y(x+h)=y(x)+y′(x)h+y′′(x) 2! h2+···+y(n)(x) n! hn+y(n+1)(c) (n+1)! hn+1.

  • 2. Euler’s method. For y′ = F(x,y), y(x) = y0 we use that

y(x+∆x) ≈ y(x)+y′(x)∆x = y0 +F(x,y0)∆x =: yEuler(x+∆x)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-8
SLIDE 8

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-9
SLIDE 9

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-10
SLIDE 10

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) =

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-11
SLIDE 11

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-12
SLIDE 12

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-13
SLIDE 13

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-14
SLIDE 14

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2 = yEuler(x+∆x)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-15
SLIDE 15

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2 = yEuler(x+∆x)+ y′′(c) 2! (∆x)2

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-16
SLIDE 16

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2 = yEuler(x+∆x)+ y′′(c) 2! (∆x)2

  • 4. So the error in each step is proportional to (∆x)2.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-17
SLIDE 17

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2 = yEuler(x+∆x)+ y′′(c) 2! (∆x)2

  • 4. So the error in each step is proportional to (∆x)2.
  • 5. Summing the errors for b−a

∆x steps gives an overall error proportional to ∆x.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-18
SLIDE 18

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Errors in Euler’s Method

  • 3. But we know that

y(x+∆x) = y(x)+y′(x)∆x+ y′′(c) 2! (∆x)2 = yEuler(x+∆x)+ y′′(c) 2! (∆x)2

  • 4. So the error in each step is proportional to (∆x)2.
  • 5. Summing the errors for b−a

∆x steps gives an overall error proportional to ∆x. (Details are more subtle than it looks.)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-19
SLIDE 19

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-20
SLIDE 20

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

  • 1. Shrinking ∆x is costly.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-21
SLIDE 21

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

  • 1. Shrinking ∆x is costly.
  • 2. So a formula with a smaller error would be nice.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-22
SLIDE 22

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

  • 1. Shrinking ∆x is costly.
  • 2. So a formula with a smaller error would be nice.
  • 3. The global error’s proportionality to ∆x in Euler’s method

came from the fact that Euler’s method uses the first two terms of the Taylor expansion.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-23
SLIDE 23

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

  • 1. Shrinking ∆x is costly.
  • 2. So a formula with a smaller error would be nice.
  • 3. The global error’s proportionality to ∆x in Euler’s method

came from the fact that Euler’s method uses the first two terms of the Taylor expansion.

  • 4. If we can capture more than the first two terms of the

Taylor expansion, we could get a global error proportional to (∆x)n.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-24
SLIDE 24

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

How can we Shrink the Error?

  • 1. Shrinking ∆x is costly.
  • 2. So a formula with a smaller error would be nice.
  • 3. The global error’s proportionality to ∆x in Euler’s method

came from the fact that Euler’s method uses the first two terms of the Taylor expansion.

  • 4. If we can capture more than the first two terms of the

Taylor expansion, we could get a global error proportional to (∆x)n. This would be good, because ∆x is usually small, so a higher power of ∆x would be even smaller.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-25
SLIDE 25

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-26
SLIDE 26

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-27
SLIDE 27

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-28
SLIDE 28

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2 y′′(x) = y′(x+h)−y′(x) h − y′′′(˜ c) 2! h

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-29
SLIDE 29

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2 y′′(x) = y′(x+h)−y′(x) h − y′′′(˜ c) 2! h y(x+h) = y(x)+y′(x)h+ y′′(x) 2! h2 + y

′′′(c)

3! h3

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-30
SLIDE 30

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2 y′′(x) = y′(x+h)−y′(x) h − y′′′(˜ c) 2! h y(x+h) = y(x)+y′(x)h+ y′′(x) 2! h2 + y

′′′(c)

3! h3 = y(x)+y′(x)h+ 1 2h2 y′(x+h)−y′(x) h − y′′′(˜ c) 2! h

  • + y

′′′(c)

3! h3

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-31
SLIDE 31

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2 y′′(x) = y′(x+h)−y′(x) h − y′′′(˜ c) 2! h y(x+h) = y(x)+y′(x)h+ y′′(x) 2! h2 + y

′′′(c)

3! h3 = y(x)+y′(x)h+ 1 2h2 y′(x+h)−y′(x) h − y′′′(˜ c) 2! h

  • + y

′′′(c)

3! h3 = y(x)+y′(x)h+ 1 2y′(x+h)h− 1 2y′(x)h− 1 2 y′′′(˜ c) 2! h3 + y

′′′(c)

3! h3

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-32
SLIDE 32

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improving Euler’s Method

We’ll get y′′ from the expansion for y′. y′(x+h) = y′(x)+y′′(x)h+ y′′′(˜ c) 2! h2 y′′(x) = y′(x+h)−y′(x) h − y′′′(˜ c) 2! h y(x+h) = y(x)+y′(x)h+ y′′(x) 2! h2 + y

′′′(c)

3! h3 = y(x)+y′(x)h+ 1 2h2 y′(x+h)−y′(x) h − y′′′(˜ c) 2! h

  • + y

′′′(c)

3! h3 = y(x)+y′(x)h+ 1 2y′(x+h)h− 1 2y′(x)h− 1 2 y′′′(˜ c) 2! h3 + y

′′′(c)

3! h3 = y(x)+ 1 2y′(x)+ 1 2y′(x+h)

  • h+
  • y

′′′(c)

3! − y′′′(˜ c) 4

  • h3

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-33
SLIDE 33

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-34
SLIDE 34

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-35
SLIDE 35

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-36
SLIDE 36

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-37
SLIDE 37

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x. The value yn will be an approximation for the value of the solution y at xn.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-38
SLIDE 38

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x. The value yn will be an approximation for the value of the solution y at xn. (Formulated to make the transition to Runge-Kutta methods easier.)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-39
SLIDE 39

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x. The value yn will be an approximation for the value of the solution y at xn. (Formulated to make the transition to Runge-Kutta methods easier.) The one step error is proportional to (∆x)3 and the global error is proportional to (∆x)2.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-40
SLIDE 40

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method

For a given step length ∆x, with initial values (x0,y0), we compute the two recursively defined sequences {xn}∞

n=0 and

{yn}∞

n=0 via

xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x. The value yn will be an approximation for the value of the solution y at xn. (Formulated to make the transition to Runge-Kutta methods easier.) The one step error is proportional to (∆x)3 and the global error is proportional to (∆x)2. (Again we omit the considerable details.)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-41
SLIDE 41

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-42
SLIDE 42

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-43
SLIDE 43

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-44
SLIDE 44

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-45
SLIDE 45

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-46
SLIDE 46

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-47
SLIDE 47

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Improved Euler Method versus Euler’s Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-48
SLIDE 48

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Reminder for Spreadsheet Implementation

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-49
SLIDE 49

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Reminder for Spreadsheet Implementation

Step length: ∆x. Initial values: (x0,y0). xn+1 := xn +∆x yn+1 = yn + 1 2k1 + 1 2k2, where k1 = F(xn,yn)∆x, k2 = F(xn +∆x,yn +k1)∆x. The value yn will be an approximation for the value of the solution y at xn.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-50
SLIDE 50

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-51
SLIDE 51

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-52
SLIDE 52

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-53
SLIDE 53

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Its increment is f(xi)∆x 6 +4f

  • xi+ 1

2

∆x 6 +f(xi+1)∆x 6 .

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-54
SLIDE 54

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Its increment is f(xi)∆x 6 +4f

  • xi+ 1

2

∆x 6 +f(xi+1)∆x 6 .

  • 3. So how do we translate this into a formula for differential

equations that has high accuracy?

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-55
SLIDE 55

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Its increment is f(xi)∆x 6 +4f

  • xi+ 1

2

∆x 6 +f(xi+1)∆x 6 .

  • 3. So how do we translate this into a formula for differential

equations that has high accuracy?

  • 4. Match as many terms of Taylor’s formula as possible. The

remainder term gives the order of the error.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-56
SLIDE 56

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Its increment is f(xi)∆x 6 +4f

  • xi+ 1

2

∆x 6 +f(xi+1)∆x 6 .

  • 3. So how do we translate this into a formula for differential

equations that has high accuracy?

  • 4. Match as many terms of Taylor’s formula as possible. The

remainder term gives the order of the error.

  • 5. The global error in Simpson’s rule is ∼ (∆x)4

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-57
SLIDE 57

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Further Improvements

  • 1. The increment in the improved Euler method

1 2F

  • x,y(x)
  • ∆x+ 1

2F

  • x+∆x,yEuler(x+∆x)
  • ∆x looks like

the increment in the trapezoidal rule in numerical integration: 1 2

  • f(xi)+f(xi+1)
  • ∆x
  • 2. Simpson’s rule is more accurate than the trapezoidal rule.

Its increment is f(xi)∆x 6 +4f

  • xi+ 1

2

∆x 6 +f(xi+1)∆x 6 .

  • 3. So how do we translate this into a formula for differential

equations that has high accuracy?

  • 4. Match as many terms of Taylor’s formula as possible. The

remainder term gives the order of the error.

  • 5. The global error in Simpson’s rule is ∼ (∆x)4, so we must

match the first four terms of the Taylor expansion.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-58
SLIDE 58

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-59
SLIDE 59

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0),

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-60
SLIDE 60

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-61
SLIDE 61

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-62
SLIDE 62

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x,

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-63
SLIDE 63

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-64
SLIDE 64

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-65
SLIDE 65

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

k4 = F(xn +∆x,yn +k3)∆x,

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-66
SLIDE 66

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

k4 = F(xn +∆x,yn +k3)∆x, yn approximates the value of the solution y at xn.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-67
SLIDE 67

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

k4 = F(xn +∆x,yn +k3)∆x, yn approximates the value of the solution y at xn. One step error ∼ (∆x)5, global error ∼ (∆x)4.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-68
SLIDE 68

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

The most common Runge-Kutta Method

Step length ∆x, initial values (x0,y0), xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

k4 = F(xn +∆x,yn +k3)∆x, yn approximates the value of the solution y at xn. One step error ∼ (∆x)5, global error ∼ (∆x)4. (Considerable details omitted.)

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-69
SLIDE 69

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-70
SLIDE 70

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-71
SLIDE 71

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-72
SLIDE 72

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-73
SLIDE 73

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-74
SLIDE 74

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-75
SLIDE 75

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Fourth Order Runge-Kutta Method

y′ = y−x2, y(0) = 0

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-76
SLIDE 76

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

Reminder for Spreadsheet Implementation

Step length: ∆x. Initial values: (x0,y0). xn+1 := xn +∆x yn+1 = yn + 1 6 (k1 +2k2 +2k3 +k4), where k1 = F(xn,yn)∆x, k2 = F

  • xn + 1

2∆x,yn + 1 2k1

  • ∆x,

k3 = F

  • xn + 1

2∆x,yn + 1 2k2

  • ∆x,

k4 = F(xn +∆x,yn +k3)∆x, yn will be an approximation for the value of the solution y at xn.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-77
SLIDE 77

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-78
SLIDE 78

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-79
SLIDE 79

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-80
SLIDE 80

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-81
SLIDE 81

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta. Have seen a fourth order Runge-Kutta procedure.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-82
SLIDE 82

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta. Have seen a fourth order Runge-Kutta procedure. Setting up a formula for increments to match a Taylor polynomial actually leads to a system of equations for the parameters in the setup of the approximation formulas.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-83
SLIDE 83

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta. Have seen a fourth order Runge-Kutta procedure. Setting up a formula for increments to match a Taylor polynomial actually leads to a system of equations for the parameters in the setup of the approximation formulas. So there is more than one second order Runge-Kutta method.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-84
SLIDE 84

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta. Have seen a fourth order Runge-Kutta procedure. Setting up a formula for increments to match a Taylor polynomial actually leads to a system of equations for the parameters in the setup of the approximation formulas. So there is more than one second order Runge-Kutta method. Same goes for higher orders.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods

slide-85
SLIDE 85

logo1 Error Analysis Improved Euler Method Runge-Kutta Methods

General Runge-Kutta Methods

A jth order Runge-Kutta procedure computes an approximate solution to the differential equation y′ = F(x,y) by computing a sequence of values yn+1 := yn +a1k1 +a2k2 +···+amkm so that yn+1 agrees with the jth order Taylor polynomial of y at the previous evaluation point. The Euler method is a first order Runge-Kutta procedure. Improved Euler method: second order Runge-Kutta. Have seen a fourth order Runge-Kutta procedure. Setting up a formula for increments to match a Taylor polynomial actually leads to a system of equations for the parameters in the setup of the approximation formulas. So there is more than one second order Runge-Kutta method. Same goes for higher orders. Some of this freedom can be used to improve performance for certain types of equations.

Bernd Schr¨

  • der

Louisiana Tech University, College of Engineering and Science Runge Kutta Methods