Numerical Methods in Engineering with MATLAB

Given the n data points ( x i, y i), i=1,2, , n, estimate y( x).
Discrete data sets, or tables of the form
| x 1 | x 2 | x 3 |
| x n |
| y 1 | y 2 | y 3 |
| y n |
are commonly involved in technical calculations. The source of the data may be experimental observations or numerical computations. There is a distinction between interpolation and curve fitting. In interpolation we construct a curve through the data points. In doing so, we make the implicit assumption that the data points are accurate and distinct. Curve fitting is applied to data that contain scatter (noise), usually due to measurement errors. Here we want to find a smooth curve that approximates the data in some sense. Thus the curve does not have to hit the data points. This difference between interpolation and curve fitting is illustrated in Fig. 3.1.
The simplest form of an interpolant is a polynomial. It is always possible to construct a unique polynomial P n ?1 ( x) of degree n ?1 that passes through n distinct data points.
One means of obtaining this polynomial is the formula of Lagrange
| (3.1a) | |
where
| (3.1b) | |
are called the cardinal functions.
For example, if n= 2, the interpolant is the straight line P 1 ( x) =y 1