Upload
others
View
60
Download
0
Embed Size (px)
Citation preview
Interpolation - 2D mappingTutorial 1: triangulation
Measurements (Zk) at irregular points (x
k , y
k)
Ex: CTD stations, mooring, etc ...The “known Data”
X
Y
How to computesome values on the
regular spacedgrid points (+) ?
The” unknown data”Z
i
knowndata
estimateddata
linearcombination
Interpolation - 2D mappingTutorial 1: triangulation
Measurements (Zk) at irregular points (x
k , y
k)
Ex: CTD stations, mooring, etc ...The “known Data”
X
Y
How to computesome values on the
regular spacedgrid points (+) ?
The” unknown data”Z
i
knowndata
estimateddata
linearcombination
1
3
2
Interpolation - 2D mappingTutorial 1: triangulation
http://en.wikipedia.org/wiki/Barycentric_coordinate_system
Interpolation - 2D mapping1 dimension linear
interpolation
Data Points
Estimated Value
RT is the error asociated to the method.
We try to estimate the maximum possible error.
Estimation of the error:
Interpolation - 2D mapping1 dimension linear
interpolation
Interpolation - 2D mapping1 dimension linear
interpolation
http://fr.mathworks.com/moler/
The derivative is notcontinuous:
Piecewise linearinterpolation is notdifferentiable at the
xdata points
Matlab tutorial:Make a Piecewise linear interpolation porgram using matlabCompare results with the interp1 matlab command
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolation
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolation
http://fr.mathworks.com/moler/
VANDERMONDE MATRIX
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolation
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolation
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolationExemple 2:
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Lagrange polynomial interpolationExemple 2:
Polynomial interpolation isdifferentiable at the xdata
points
Polynomial interpolationmay generate overshoots,
spikes
http://fr.mathworks.com/moler/
Interpolation - 2D mapping2 dimension bilinear
interpolation
Data Points
Estimated value
http://en.wikipedia.org/wiki/Bilinear_interpolation
Interpolation - 2D mapping2 dimension bilinear
interpolation
http://en.wikipedia.org/wiki/Bilinear_interpolation
http://fr.mathworks.com/moler/
Interpolation - 2D mapping1 dimension
Piecewise Cubic Hermite Interpolation
Hermite function :Functions that satisfy interpolation conditions derivatives
If we know P(xk),P'(x
k),P(x
k+1),P'(x
k+1) then piecewise cubic Hermite interpolation can reproduce
the data on the interval [xk x
k+1]
Problem: We usually do not know the values of derivatives
Interpolation - 2D mapping1 dimension
Piecewise cubic interpolation
Functions that satisfy interpolation conditions on derivatives: HERMITE interpolants
on the interval xk< x< x
k+1
s = x - xk
Conditions satisfiedby this function:
Knowing BOTH values of the functions and its FIRST derivatives at a discreteset of data points, then, we can reproduce the data on each interval x
k< x< x
k+1
Interpolation - 2D mapping1 dimension
Piecewise cubic interpolation
Knowing BOTH values of the functions and its FIRST derivatives at a discreteset of data points, then, we can reproduce the data on each interval x
k< x< x
k+1
PROBLEMS:What happens if we do not know the derivatives ....???
There are different ways of estimating these derivatives.We look for a way that reduces the overshoots and spikes.
- splines- shape preserving cubics
Interpolation - 2D mapping1 dimension
Shape preserving cubic interpolation
We wish to determine the slope dk so that the function values do not overshoot
Piecewise linear interpolation(straight line)
Curve line (shape preserving)
JUMP in secondderivative !
Interpolation - 2D mapping1 dimension
Shape preserving cubic interpolation
We wish to determine the slope dk so that the function values do not overshoot
Piecewise linear interpolation(straight line)
Curve line (shape preserving)
JUMP in secondderivative !
Interpolation - 2D mapping1 dimension
Shape preserving cubic interpolation
We wish to determine the slope dk so that the function values do not overshoot
We still need to evaluate the slopes dk
Harmonic mean at interior points (it tends (compared to the arithmetic mean) to mitigate the impact of largeoutliers and aggravate the impact of small ones. Ex: speed of a car)
One-sided formula at end points ....
Arithmetic and Harmonic mean:A car travels a distance h1 and speed v1, and distance h2 at speed v2
Arithmetic mean:vbarith=(v1+V2)/2
Harmonic mean:t1=d1/v1t2=d2/v2
vbarharm=(d1+d2)/(d1/v1+d2/v2)
Interpolation - 2D mapping1 dimension
Shape preserving cubic interpolation
Interpolation - 2D mapping1 dimension
Cubic Spline interpolation
We add a constraint on thecontinuity of the second derivative
Interpolation - 2D mapping1 dimension
Cubic Spline interpolationWe add a constraint on the continuity of the second derivative
Valid on the interval:x
k< x< x
k+1
Interpolation - 2D mapping1 dimension
Cubic Spline interpolationWe add a constraint on the continuity of the second derivative:
P''(xk
+)=P''(xk
-)
This approach can be applied to the interior “knots”, k=2,...n-1=> (n-2) equations
We must add boundary conditions on the “first” and “end” intervals
Here written for hk=cte
“not a knot “ choice for x2 and x
n-1
We write the equations on the interval:x
1< x < x
3
xn-2
<x<xn
Interpolation - 2D mapping1 dimension
Piecewise cubic interpolation
Functions that satisfy interpolation conditions on derivatives: HERMITE interpolants
on the interval xk< x< x
k+1
s = x - xk
Conditions satisfiedby this function:
Boundary Conditions for splines
● Natural Spline:
(N points, N-1 intervals)
Boundary Conditions for splines
● Not a Knot:
Boundary Conditions for splines
● Periodic boundary conditions:
x2
x3
x4
xN-3
xN-2
xN-1
xN
xN+1
x1
x0
GHOSTPOINT
GHOSTPOINT
L
Boundary Conditions for splines
● Periodic boundary conditions:
x2
x3
x4
xN-3
xN-2
xN-1
xN
xN+1
x1
x0
GHOSTPOINT
GHOSTPOINT
L
● These techniques can be adapted to 2D or 3D● If sparse data, and a smooth is what you are
looking for, then a spline surface is adapted● If very noisy data, or closely spaced data, then
a “smoothed spline”, may be better.● See Smith and Wessel (1990)