Explicit Central Difference Method

Description

The explicit central difference method is an explicit second order method for approximating the solution of the second order differential equation y''(x) = f(x, y) with initial conditions y(x0) = y0, y'(x0) = y'0.

Note that the integrand f(x,y) does not depend upon y'.

The algorithm for the explicit central difference method is derived by using the central difference approximations for y'(x) and y''(x):

y'(x) = (y(x+h) - y(x-h) ) / 2h,
and
y''(x) = (y(x+h) - 2y(x) + y(x-h)) / h2.

Let xn = x0 + nh, yn be the approximation to y(xn), and fn = f(xn, yn), the procedure proceeds recursively via the explicit equation for yn + 1 as follows:

yn + 1 = 2 yn - yn - 1 + h2 fn.

In order to begin the recursion, two successive starting values of y are required, one of which is y0 and the other starting value y1 is approximated by

y1 = h y'(x0) + h2 f(x0, y0) / 2.

Particular classes of problems may have a more accurate estimate for y1.

Richardson extrapolation may be used to increase to increase both the order and accuracy.

Function List

C Source