1.1.2.4. Finite Difference Formulas in 2D¶
1.1.2.4.1. Extend 1D formulas to 2D¶
Just apply the definition of a partial derivative w.r.t. \(x\) is the variation in \(x\) holding \(y\) constant
Build 2D grid defined by the following:
For i between \(0\) and \(nx-1\):
For j between \(0\) and \(nj-1\):
Define \(u_{i,j} = u(x_i,y_j)\)
1.1.2.4.2. Forward Differencing in 2D for 1st derivative¶
For the point \((i+1,j+1)\), Taylor series in 2D:
1st order FD in x-direction, i.e.
\(\Delta y = 0\)
\(j+1=j\)
Terms of higher order than 1 are zero
1.1.2.4.3. Central Differencing in 2D for 1st derivative¶
Take one foward Taylor step, one backward Taylor step
Subtract the forward and the backward steps
Re-arrange for the derivative
1.1.2.4.4. Central Differencing in 2D for 2nd derivative¶
Take one foward Taylor step, one backward Taylor step
Add the forward and the backward steps
Re-arrange for the derivative