next up previous contents
Next: 9.4.3 Whittacker's interpolation formula Up: 9.4 Interpolation and extrapolation Previous: 9.4.1 Finite-difference interpolation formulas

9.4.2 Lagrange interpolation

An alternate method of interpolation is to use polynomial fits to the available values to interpolate between those values. If there are N data values, a polynomial of degree N-1 can be found that will pass through all the points. The Lagrange polynomials provide a convenient alternative to solving the simultaneous equations that result from requiring the polynomials to pass through the data values. The Lagrange interpolation formula is
\begin{displaymath}f(x) = \sum_{i=1}^Nf(x_i)P^L_i(x) \end{displaymath} (9.24)
 

where f(xi) are the known values of the function and f(x) is the desired value of the function. The Lagrange polynomial PLi is the polynomial of order N-1 that has the value 1 when x=xi and 0 for all $x_{j\ne i}$:

\begin{displaymath}P^L_i(x) = {{\prod_{j\ne i}(x-x_j)}\over{\prod_{j\nei}(x_i-x_j)}} \ \ .\end{displaymath} (9.25)
 

This is a particularly convenient way to interpolate among tabulated values with polynomials.

An advantage of Lagrange interpolation is that the method does not need evenly spaced values in x. However, it is usually preferable to search for the nearest value in the table and then use the lowest-order interpolation consistent with the functional form of the data. High-order polynomials that match many entries in the table simultaneously can introduce undesirable rapid fluctuations between tabulated values. If used for extrapolation with a high-order polynomial, this method may give serious errors.


next up previous contents
Next: 9.4.3 Whittacker's interpolation formula Up: 9.4 Interpolation and extrapolation Previous: 9.4.1 Finite-difference interpolation formulas 


NCAR Advanced Study Program
http://www.asp.ucar.edu