1

This question may sound mathematical, but it's more of a programming question related to discretization, so I decided to ask it here.

The problem is to find a 2nd order finite difference approximation of the partial derivative uxy, where u is a function of x and y.

Page 5 of this pdf I found does a centered difference approximation it in two steps. It first does the 2nd order centered finite-difference approximation of one of the partials, and then inserts the approximation of the second partial into it (using the same formula):

enter image description here

Inserting lines 2 and 3 into 1 gives (according to the pdf) the following:

enter image description here

The last O[(Δx)2,(Δy)2] is what I have a problem with. Notice that when the O(Δy)2 terms of lines 2 and 3 go into the numerator of 1, they are being divided by the Δx in the denominator. So how come the residual terms in line 3 are of O(Δy)2 instead of O(Δy2/Δx)? Would this be a '2nd order' approximation any more? (If, say, grid-spacing along both axes are the same (Δx=Δy=h), the term is of order h2/h =h, not h2.)

My suggestion would be to use a higher order approximation (3rd or more) in lines 2 and 3 in order to survive the division by Δx and still have the final expression in 2nd order. But I may be missing something here.

Abhranil Das
  • 5,702
  • 6
  • 35
  • 42
  • You might get more interest on [scicomp.SE](http://scicomp.stackexchange.com/) – Emmet Apr 07 '14 at 00:34
  • Found the answer in section 2.5 of this: http://www.springer.com/cda/content/document/cda_downloaddocument/9780387236193-c2.pdf">. Someone gave it to me, so I don't want to take credit by posting an answer. – Abhranil Das Apr 07 '14 at 01:24
  • Related pdf: http://www.mathematik.uni-dortmund.de/~kuzmin/cfdintro/lecture4.pdf – John Alexiou Apr 07 '14 at 01:48

2 Answers2

1

If I remember correctly, if you write more terms in the Taylor expansions, it quickly becomes obvious that the higher order terms cancel out. That is, that the "O(dy)^2 - O(dy)^2" that you'd get after substitution of (2) and (3) in the numerator of (1) actually does become zero.

Emmet
  • 6,192
  • 26
  • 39
0

You have two 1st order slopes that combined gives a 1st order plane. You are not gaining anything in terms of order by combining the two slopes to get (∂u/∂x)*(∂u/∂y).

This is still a 1st order approximation and if needed you will need to use more points into the finite difference to get higher order terms.

I think the notation of (∂²u/∂x∂y) is confusing the matter. Use the product of two 1st order operators to be more clear on what is going on.

John Alexiou
  • 28,472
  • 11
  • 77
  • 133
  • I think you've misinterpreted the notation. The two slopes have not been multiplied to get (du/dx)*(du/dy). They have been nested or composed to get the 2nd order partial derivative d2u/dxdy. Also, I think each of the slopes they plug in are 2nd order here, right? (I'm still pretty new to all this.) – Abhranil Das Apr 07 '14 at 01:03
  • It is the product of two operators (∂/∂x and ∂/∂y). Not a product of two slopes. Each slope is first order because the denominator is Δx and not Δx². The 2nd order of `u(x,y)` in terms of `x` is `(2*u(x,y)-u(x-h,y)-u(x+h,y))/h²`. Notice the square in the denominator. – John Alexiou Apr 07 '14 at 01:47
  • Although the denominator is Δx, it's a centered difference, which is 2nd order. – Abhranil Das Apr 07 '14 at 05:00
  • If the higher order terms are O(h²) then the approximation is 1st order. – John Alexiou Apr 07 '14 at 14:37
  • No, the *approximation* is the same order as the leading order error term. For example, [u(i+1)-u(i)]/Δx is a first order approximation for ∂u/∂x as the leading order error term following it is O(Δx). What you might be referring to is that a numerical scheme is one order lower than the order of its local truncation error. – Abhranil Das Apr 07 '14 at 22:32