Finite difference approximation for third order partials?

  • Thread starter swuster
  • Start date
  • #1
42
0

Main Question or Discussion Point

I'm attempting to perform interpolation in 3 dimensions and have a question that hopefully someone can answer.

The derivative approximation is simple in a single direction:

df/dx(i,j,k)= [f(i+1,j,k) - f(i-1,j,k)] / 2

And I know that in the second order:

d2f/dxdy(i,j,k)= [f(i+1,j+1,k) - f(i+1,j,k) - f(i,j+1,k) + f(i-1,j-1,k)] / 4

The final item I need is the third order approximation, and I'm not sure how to scale the first two into a third variable.

d3f/dxdydz(i,j,k)= ?

Can anyone shed some light on this?

Thanks in advance!
 

Answers and Replies

  • #2
hunt_mat
Homework Helper
1,724
16
can't you just apply Taylor series? You want
[tex]
\frac{\partial^{3}f}{\partial x\partial y\partial z}
[/tex]
Right?
 
  • #3
42
0
Yes but I don't have the function itself; I only have its value at various points i-2, i-1, i, i+1, i+2, etc.
 
  • #4
hunt_mat
Homework Helper
1,724
16
Just apply Taylors theorem in 1D to each variable in turn.
 
  • #5
14
0
You already have
d2f/dxdy(i,j,k) = [f(i+1,j+1,k) - f(i+1,j,k) - f(i,j+1,k) + f(i-1,j-1,k)] / 4
so you have to do the first order derivation for z, which means for indexes in short-hand
notation

[(k->k+1) - (k->k-1)]/2

By the way, congratulations for having chosen the symetrical representation of the first derivative, it is much more accurate than [(k->k+1) - ()].

So lets do it:
d3f(x,y,z)/dxdydz = {[f(i+1,j+1,k+1) - f(i+1,j,k+1) - f(i,j+1,k+1) + f(i-1,j-1,k+1)]
- [f(i+1,j+1,k-1) - f(i+1,j,k-1) - f(i,j+1,k-1) + f(i-1,j-1,k-1)]}/8 =
[f(i+1,j+1,k+1) - f(i+1,j,k+1) - f(i,j+1,k+1) + f(i-1,j-1,k+1)
- f(i+1,j+1,k-1) + f(i+1,j,k-1) + f(i,j+1,k-1) - f(i-1,j-1,k-1)]/8
That's it.
 

Related Threads on Finite difference approximation for third order partials?

Replies
6
Views
1K
  • Last Post
Replies
0
Views
1K
Replies
3
Views
839
Replies
7
Views
1K
Replies
2
Views
945
  • Last Post
Replies
3
Views
970
Replies
1
Views
27K
Replies
4
Views
1K
  • Last Post
Replies
0
Views
3K
Top