On a grid I am having the values of a physical quantity say for example Temperature, at the E,W,N,S and P node all of them being calculated using a second order discretization scheme. I want a second order accurate estimate of the value of Temperature at point X. How to get that.

Note- I can get a second order accurate value of temperature at point IP1 (using second order polynomial fitting with point E, W and P) and at point IP2 (using second order polynomial fitting with point N, S and P). Both IP1 and IP2 are at distance Δx/4Δx/4 from point P.

Kindly refer to the stencil for details.



In 2D you would need a bi-quadratic interpolation function such as $(a_0 + a_1 x + a_2 x^2)(b_0 + b_1 y + b_2 y^2)$ giving rise to 9 undetermined coefficients. Thus you need 9 points where the values are known then you can determine these coefficients.

At the least you need incomplete polynomial up to 2nd order for a 2nd order estimate, i.e., $\{1,x,y,x^2,y^2,xy\}$ with 6 coefficients, thus you need 6 points.

With 5 points and 6 coefficients you will have an under determined linear least squares problem. You can convert it to an over determined system by adding more points, especially if you are on, say, a finite difference grid. You can find details in any numerical analysis text book. See also this. I give some basics below.

Your goal is to find the polynomial function coefficients - the function itself is linear in the coefficients. Now express the sum of the square of error between interpolated values $v^I$ and actual values $v^A$ at $n>6$ points as: \begin{align*} E = \sum_{i=1}^n(v^I(a_p, \mathbf x_i) - v^A_i)^2 \qquad& v^I \text{ is linear in } a_p \text{ evaluated at } \mathbf x_i \\ = \sum_{i=1}^n(v^I_p(\mathbf x_i) a_p - v^A_i)^2\qquad& \text{p}^{th} (1...6) \text{ coefficient of } v^I \text{ at } \mathbf x_i \\ {{\partial E}\over{\partial a_k}} = \sum_{i=1}^n 2(v^I_p(\mathbf x_i) a_p - v^A_i) v^I_p(\mathbf x_i)\delta_{pk} = 0\qquad& \text{minimize w.r.t. } a_k \\ \implies \sum_{i=1}^n v^I_k(\mathbf x_i) v^I_p(\mathbf x_i) a_p = \sum_{i=1}^n v^I_k(\mathbf x_i) v^A_i\qquad& \end{align*}

Clearly if you have an over determined system, you can also go with the approach of bi-quadratic functions with 9 coefficients (on a 3x3 grid) at each point.

  • $\begingroup$ does that mean if i have the values of corner nodes (to P) which are not marked in the figure above then i can get the value at X (2nd order accurate). I am trying to avoid this situation since the stencil grows in size and i intend to solve implicitly for the values at each node. How to proceed with lest squares thing. (sorry for asking this trivial question) $\endgroup$ – datapanda Apr 23 '16 at 13:25
  • $\begingroup$ Don't understand your 1st point on corner nodes and stencil growth. Please add a picture to help your explanation. I have added some details on linear least squares problem to the answer. $\endgroup$ – NameRakes Apr 23 '16 at 20:38
  • $\begingroup$ By corner points i mean to say that making the cells NE (north east), SE, NW and SW as part of the stencil. $\endgroup$ – datapanda Apr 23 '16 at 21:05
  • $\begingroup$ Got it. I want to say that is the cost of doing business. In fact looking at your original points IP1 and IP2, they may be 2nd order accurate in E-W and N-S direction but not necessarily with respect to N-S and E-W directions respectively. What exactly is the problem you're trying to solve? what is the big picture here? $\endgroup$ – NameRakes Apr 23 '16 at 21:21
  • $\begingroup$ well the bigger picture is that the stencil shown here arises at one of the faces (in 3D geometry) in adaptive mesh refinement using octtree. The idea is to form a second order accurate laplacian operator at heterogeneous faces where coarse-fine boundaries occur. [The Paper (go to page 6 and 7 (577 and 578)] (pages.csam.montclair.edu/~yecko/icodes/Popinet_GERRIS.pdf). The stencil shown above occurs in 3D rendition of the method. $\endgroup$ – datapanda Apr 24 '16 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.