science forum beginner
Joined: 21 Jul 2006
|Posted: Fri Jul 21, 2006 1:57 pm Post subject:
2D Lagrangian interpolation
I would like to perform 2D quadratic interpolation of a function. The
function values are known over a grid which for now is Cartesian
uniform. Requirements in order of importance:
1) I must write the interpolation subroutine myself, so it must be
2) I'd like to evaluate the coefficients of the interpolating
polynomial, since I may need its derivatives;
3) finally, I'd like the method to work also on a grid with possibly
local anisotropic refinement (for example, square cells of side dx,
with two neighboring rectangular cells of smaller side dx/2). That's
not too important, anyway.
In your opinion, which method is best amongst the following, for what
it concerns accuracy and coding simplicity?
1) Quadratic interpolation over a 6 node simplex, performed by writing
the Vandermonde system, solving it with LU and finally evaluating the
polynomial with Horner's method (how is this performed for multivariate
polynomials?). I know the condition number grows exponentially with the
number of nodes, but since I only use a 2nd degree polynomial, maybe
that's not so bad.
2) Quadratic interpolation over simplex using shape functions and
3) As 1), but using least square interpolation over at least six
surrounding nodes (good for possible future extension to
anisotropically refined grids). Is it better to do perform least square
interpolation with shape functions, i. e. as in 2)?
4) Another method suggested by you, possibly as simple as the ones I
presented, otherwise I may not be able to code it myself
Well, that's all, I look forward for an answer of yours,
deltaquattro (Sergio Rossi)