# Runge Kutta and local error

1. Apr 27, 2010

### MaxManus

1. The problem statement, all variables and given/known data
h is the timestep

Y' = F(Y)

Mk,1 = F(Yk)

Mk,2 = F(Yk + 0.5*Mk,1)

Mk,3 = F(Yk + h*Mk,2)

Mk,4 = F(Yk + h*Mk,3)

Yk+1 = Yk + (h/6)*(Mk,1 + 4Mk,2 + Mk,4)

Show that the local error is of fourth order

3. The attempt at a solution

I have written down the fourth order tayler series of Y

and the equation for Runge Kutta k = 0

What I need help with is what order I am supposed to write the tayler series for M4, M3 and M2

2. Apr 27, 2010

### D H

Staff Emeritus
Fourth order means that the error is on the order of h5. What does that tell you about the order of those Taylor series?

3. Apr 27, 2010

### MaxManus

Thanks, my taylor series for Y has an error of order 4 so then it is of third order and not fourth.

I'm not sure about your question. Are you saying that I'm supposed to write the third order taylor series for M2,M3 and M4?

Last edited: Apr 27, 2010
4. Apr 27, 2010

### MaxManus

My Taylor series for Y

Y(t1) = Y(to) + Y'(t0)h + 0.5Y''(t0)h^2 + (1/6)*Y'''(t0)h^3 + (1/24)*Y''''(E)h^4

E is between t0 and t1

5. Apr 27, 2010

### D H

Staff Emeritus
Your Taylor series should be fifth order.

6. Apr 27, 2010

### MaxManus

If Y(t1) is my tayler series and Y1 is my RungeKutta expression
I thought I should get:
Y1 = Y/t0) + Y'(to)h + 0.5Y''(t0)h^2 + (1/6)Y'''h^3 + Q*h^4

Where Q is a function of Y and its derivatives

To find the local error
abs(Y(t1) - Yt1) = W*h^4

where W is a function of Y and its derivatives.

But this is wrong?

7. Apr 27, 2010

### D H

Staff Emeritus
An nth order method means that the error is on the order of hn+1. This means your Taylor series should be fourth order plus a fifth order error term to show that the method is fourth order.

8. Apr 27, 2010

### MaxManus

But I'm supposed to show that the local error is of fourth order. That means that the method is of third order?
And I should use third order Taylor series for Y(t1)?

9. Apr 27, 2010

### MaxManus

Solved with two questions
My solution:
M4: Second order Taylor
M3: First order Taylor
M2: Here I used second order for the term that stands alone and zero order for the one inside M3

The trick was to do M4 first to see what Taylor order you needed for M3 to keep the error of order four

Am I allowed to use to different Taylor orders for M2. And is zero order allowed?