Mathematical Tools for Physics

(coco) #1
11—Numerical Analysis 316

where the last term gives an estimate of the error:+h^2 f′′(0)/ 8.
As an example, interpolate the functionf(x) = 2xbetween 0 and 1. Hereh= 1.


21 /^2 ≈


1


2


[


20 + 2^1


]


= 1. 5


The error term is
error≈(ln 2)^22 x/8 for x=. 5
= (.693)^2 (1.5)/8 =. 090 ,


and of course the true error is 1. 5 − 1 .414 =. 086
You can write a more general interpolation method for an arbitrary point betweenx 0 andx 0 +h. The
solution is a simple extension of the above result.
The line passing through the two points of the graph is


y−f 0 = (x−x 0 )(f 1 −f 0 )/h,

x 0 x 1

where
f 0 =f(x 0 ), f 1 =f(x 0 +h).


At the pointx=x 0 +phyou have


y=f 0 + (ph)(f 1 −f 0 )/h=f 0 (1−p) +f 1 p.

As before, this approach doesn’t suggest the error, but again, the Taylor series allows you to work it out to be[
h^2 p(1−p)f′′(x 0 +ph)/ 2


]


.


The use of only two points to do an interpolation ignores the data available in the rest of the table. By
using more points, you can greatly improve the accuracy. The simplest example of this method is the 4-point
interpolation to find the function halfway between the data points. Again, the independent variable has an
incrementh= 2k, so the problem can be stated as one of finding the value off(0)givenf(±k)andf(± 3 k).

Free download pdf