deltaquattro science forum beginner
Joined: 22 Mar 2006
Posts: 3
|
Posted: Mon Jun 19, 2006 1:29 pm Post subject:
Problems with interpolation of near zero values
|
|
|
Hello,
I would like to ask your help about an interpolation problem.
I have the analytical expression of an analytical function of
two variables z = f(x,y), which I evaluate at the cell centers
of an uniform cartesian grid covering the unit square. I also
have a circle contained in the unit square: the circle will
cross some of the grid cells. For each crossed cell i, I choose
a point P(i) on the arc of circle contained in the cell, and I
calculate z(i) = f(P(i)). Then I use 2D linear interpolation
over a triangle comprising the crossed cell and two neighbors,
in order to get a value z_interp(i). Finally, I calculate
the percentage relative error
e(i) = ABS((z(i)-z_interp(i))/z(i))*100, and study its
behaviour under grid refinemnt.
My problem is that, over the circle, f goes from 1.0 to -1.0
approximately, so when P(i) is near a root of f(x,y), the
percentage relative error is very big. What's worst, it
doesn't show the expected second order rate of decrease
when I refine the mesh.
One could think that, when trying to approximate a very small
value (small with respect to 1), for example 1e-3, then even a
small absolute error, like 1e-2 will result in a enormous
relative error. But this doesn't sound right to me; the
interpolation error depends only on mesh size and on the
derivatives of f(x,y), not on its absolute values:
f(x_i,y_i) = f(x_0,y_0) + f_x(x_0, y_0) * (x_i-x_0) +... ->
(f(x_i,y_i) - f(x_0,y_0))/f(x_i,y_i)*100 =
(f_x(x_0, y_0) * (x_i-x_0) +...)/f(x_i,y_i)*100
So I expect it to decrease with the usual second order rate.
Could you please suggest a cure for this problem? Thank you
very much for your attention,
Greetings,
Sergio Rossi |
|