# central difference scheme

• Nov 10th 2009, 10:01 AM
calculushelptx
central difference scheme
I need a little clarification about how to use this equation.

f'(x)=f(x+h)-f(x-h)/2h + O(h^2)

here is the info
time___ 0 20 40 . . . . . . . . . . . .......................... . . 160 180 200
altitude 60 10170 33835 ........................107892 119626 162095

find the central difference at t=20 and t=180

I know how to find h but how to i put all these x values into the equation?
• Nov 11th 2009, 03:36 AM
HallsofIvy
Quote:

Originally Posted by calculushelptx
I need a little clarification about how to use this equation.

f'(x)=f(x+h)-f(x-h)/2h + O(h^2)

here is the info
time___ 0 20 40 . . . . . . . . . . . .......................... . . 160 180 200
altitude 60 10170 33835 ........................107892 119626 162095

find the central difference at t=20 and t=180

I know how to find h but how to i put all these x values into the equation?

Then presumably you saw that h= 20. So just put the numbers into the equation. With x= 20 and h= 20, x+h= 40 and x- h= 0. f(x-h)= f(0)= 60 while f(x+h)= f(40)= 33835. (f(x+h)- f(x-h))/(2h)= (f(40)- f(0))/(2(20))= (33835- 60)/60.
• Nov 12th 2009, 10:17 AM
jeneverboy
Quote:

(f(x+h)- f(x-h))/(2h)= (f(40)- f(0))/(2(20))= (33835- 60)/60.
Liitle mistake here, should be (33835 - 60)/(40)

And O(h^2) is the error you make, cause you are calculating a numerical approximation.
• Nov 13th 2009, 06:09 AM
HallsofIvy
Quote:

Originally Posted by jeneverboy
Liitle mistake here, should be (33835 - 60)/(40)

And O(h^2) is the error you make, cause you are calculating a numerical approximation.

Yes, of course. Thank you for the correction.