next up previous
Next: 1.4 Sample Applications Up: 1.3 Difference Quotients Previous: 1.3.3 First derivatives in


1.3.4 Second derivatives in 2 dimensions

By again fixing one of the independent variables - $y$, say - and considering only $f_{xx}$, we obtain, in terms of the Stirling (centered) approximation,
$\displaystyle [F_{xx}]_{i,j}$ $\textstyle \approx$ $\displaystyle \frac{1}{(\Delta x)^{2}} [f_{i+1,j}-2f_{i,j}+f_{i-1,j}]
+O[(\Delta x)^{2}]$  
  $\textstyle \equiv$ $\displaystyle \frac{\delta_{i}^{2}f_{i,j}}{(\Delta x)^{2}}
+ O[(\Delta x)^{2}]$  

Analogous (and less accurate) formulae are valid within the NGF- and NGB-approximations, respectively.

How about mixed derivatives?


Mixed derivatives

Approximating $f_{xy}$ use the same kind of approximation with respect to both the $x$- and the $y$-direction. (This may not hold if $x$ and $y$ have a different character, e.g. one space and one time variable.)

Stirling:

$\displaystyle [F_{xy}]_{i,j}$ $\textstyle \approx$ $\displaystyle \frac{1}{4\Delta x \Delta y} \left[ f_{i+1,j+1}-f_{i+1,j-1}-
f_{i-1,j+1}+f_{i-1,j-1} \right] +O[\Delta x \Delta y]$  
  $\textstyle \equiv$ $\displaystyle \frac{\mu \delta_{i}}{\Delta x}
\left[\frac{\mu \delta_{j} f_{i,j}} {\Delta y} \right]
+O[\Delta x \Delta y]$  

And now, fow for the curvature of $f(x,y)$:


Curvature of a function f(x,y)

To find the local curvature at the grid point $(i,j)$ we have to apply the nabla operator $\nabla$ twice.(*) There are two ways:
Either ``difference'' along the grid axes,

$\displaystyle \nabla^{2} f(x,y)$ $\textstyle \approx$ $\displaystyle \frac{1}{(\Delta l)^{2}}
\left[ f_{i+1,j}+f_{i,j+1}+f_{i-1,j}+f_{i,j-1}-4f_{i,j}\right]$  

or apply ``diagonal differencing'', writing
    $\displaystyle \nabla^{2} f(x,y) \approx$  
    $\displaystyle \frac{1}{2(\Delta l)^{2}}
\left[ f_{i+1,j+1}+f_{i-1,j+1}+f_{i-1,j-1}+f_{i+1,j-1}-4f_{i,j}\right]$  

 
 
Axial vs. diagonal differencing


(*) Note that the nabla operator $\nabla$ mentioned here is not to be mixed up with the backward difference for which we use the same symbol.
next up previous
Next: 1.4 Sample Applications Up: 1.3 Difference Quotients Previous: 1.3.3 First derivatives in
Franz J. Vesely Oct 2005
See also:
"Computational Physics - An Introduction," Kluwer-Plenum 2001