Documentos de Académico
Documentos de Profesional
Documentos de Cultura
5004
Elevation (ft)
250
0 0 2 4 6 8 10 12 14
INTERPOLATION BY POLYNOMIALS
Assume now that the interpolating function is an algebraic polynomial pn(x) of degree at most n, where n = number of points of interpolation 1.
It is well known that the interpolating polynomial pn always exists and is unique
To determine the polynomial interpolation we use Newton's form. We shall describe briefly the Newton's method.
CIVE 3076
Interpolation 3
DIVIDED DIFFERENCES
Coefficients a0, a1, , an are called the divided differences and they can be computed recursively The k-th order divided difference based on points x0, xk, denoted by f[x0, , xk], s defined recursively as f[xm] = ym if k = 0 f[x0, , xk] = (f[x1, , xk] f[x0, , xk-1])/(xk x0) if k > 0 Coefficients {ak} and the divided differences are related in the following way ak = f[x0, , xk]
CIVE 3076 Interpolation 4
f[ , , , ]
f[xi xi +1,,xi+n,]
y0 f[x0, x1]
x
1
x
2
y2
f[x2, x3]
x
3
y3
CIVE 3076
EXAMPLE
From a table of values of y(xi) below y(1) = 1.5709 y(4) = 1.5727 y(6) = 1.5751 Find y(5), using the Newton method. xi 1 4 6 f[xi]=yi f[xi xi +1] f[xi xi +1,xi+2] 1.5709 0.0006 1.5727 0.0012 1.5751 0.00012
CIVE 3076
Interpolation
1.574
1.573
1.572
1.571 1 2 3 4 5 6
CIVE 3076
Interpolation
11
0.8460 0.9720
(i) On each subinterval [xi, xl+1] s(x) coincides with an algebraic polynomial of degree at most 3.
(ii) s(x) and its derivatives up to order k are all continuous on the interval [a, b]
CIVE 3076 Interpolation 13
CIVE 3076
Interpolation
14
10
12
14
16
18
CIVE 3076
Interpolation
16
CIVE 3076
Interpolation
17
0.5
1.5
2.5
3.5
4.5
CIVE 3076
Interpolation
18
method.
CIVE 3076
Interpolation
19
CIVE 3076
Interpolation
20
CIVE 3076
Interpolation
21
0.5
1.5
2.5
3.5
CIVE 3076
Interpolation
22
0.5
1.5
2.5
3.5
CIVE 3076
Interpolation
23
0.5
1.5
2.5
3.5
CIVE 3076
Interpolation
24
0.5
1.5
2.5
3.5
CIVE 3076
Interpolation
25
MATLAB built-in function zi = interp2(x, y, z, xi, yi, 'method') generates a bivariate interpolant on the rectangular grids and evaluates it in the points specified in the arrays xi and yi. Sixth input parameter 'method' is optional and specifies a method of interpolation
CIVE 3076 Interpolation 26
CIVE 3076
Interpolation
28
CIVE 3076
Interpolation
29
DATA = xlsread('ShapeData.xlsx','Input'); >> x=DATA(:,1); y=DATA(:,2); z=DATA(:,3); % Create a uniformly spaced grid >> xlin=linspace(min(x),max(x),100); >> ylin=linspace(min(y),max(y),100); >> [X,Y]=meshgrid(xlin,ylin); % Interpolate data for the grid created above >> Z=griddata(x,y,z,X,Y, binearest'); >> surf(Z) >> zlabel('Elevation (ft)'); >> title(Bilinear interpolant to Trapezoidal Basin');
CIVE 3076 Interpolation 30
5004
Elevation (ft)
5002 5000 4998 4996 4994 400 300 200 100 y (ft) 0 0 50 100 x (ft) 150 200 250
CIVE 3076
Interpolation
31
5004
Elevation (ft)
5002 5000 4998 4996 4994 400 300 200 100 y (ft) 0 0 50 100 x (ft) 150 200 250
CIVE 3076
Interpolation
32
QUESTIONS?
CIVE 3076
Interpolation
33