|
- This program demonstrates the interpolation of a real function of two
variables by a continuous
piecewise linear function over a triangulation of the (x,y)-data.
- Piecewise linear continuous interpolation has a goodness of approximation similar to the onedimensional
case: the approximation error is second order in the grid size (with the error constant depending on the
second order partial derivatives of the function) and its gradient, although piecewise constant only, approximates
the true gradient to first order in the grid size. But here the geometry of the triangularization plays
an additional role. The error is bounded by O(h/sin(φ)), with φ the smallest interior angle
of an triangle and h the longest edge (individually, for each triangle).
- There are three forms of input: you either define a rectangular grid via the number of points and the grid size
for the x- and y-direction, which then is transformed internally into a triangularization, or
define a scattered (x,y) set, choose a predefined
or self defined function, generate the z-data, interpolate these and get the interpolation
and its error returned,
or you specify a scattered set of (x,y,z) -data and get the interpolating
function as a plot only.
- a triangulation is defined internally, and the interpolating
function and its gradient is obtained
piecewise from independent systems of linear equations in three unknowns, over each triangle.
The gradient of this piecewise linear function, being well defined in the interior of each
triangle, can serve as an approximation of the gradient of the original function.
In the case of artificially generated data this can be compared to the true gradient.
In the case of a self defined function you don't need to specify the gradient. This is obtained
here by a highly precise finite difference formula which has a much smaller discretization error
than the linear interpolation can provide.
- If you only specify (x,y,z)-data then of course no error estimation is available.
- you might evaluate the interpolant in the case of your own data at a
given set of (x,y) data. But you should be aware of the fact that the result
depends on the triangulation chosen on which you have no influence.
Sometimes the result may be surprising. For example if you enter
the data (1,2,*),(2,0,*),(2,4,*),(3,0,*),(3,4,*) then you get three
triangles: {(1,2),(2,0),(3,0)};{(1,2),(3,0),(3,4)};{(1,2),(2,4),(3,4)}.
Since finding a corresponding triangle must be unique, such a point
must not lie on an edge. Otherwise you get the result ''outside mesh''.
Disturbing a coordinate quite a little bit might help.
|
|
- You first define the form of your input via a radio button: either a function based experiment,
either on a rectangular grid , defined
by four values n1,hx and n2,hy (number of grid points and their distance in x- and
y-direction) (for generation of artificial data) or on a scattered (x,y) data
set or mere input of a scattered data set of (x,y,z)-data.
In the latter case you might require the interpolation results for
a set of given (x,y)-data.
- In the case of artificial data generation you might choose between 3 predefined functions or define
a function yourself. This is then used to generate the z-data.
- in both cases a (projected) 3D plot is generated. Hence you need
- generation of a view point. This is done here by defining two rotation angles: one for the x-axis and
one for the z-axis. How this works is described on the input form.
|