Peano
Loading...
Searching...
No Matches
Finite Difference

Finite-difference methods (FD) are a class of numerical methods for solving differential equations by approximating derivatives with finite differences. By this, we can convert ODEs or PDEs (which may be nonlinear) into a system of linear equations that can be solved by matrix algebra techniques.

Here we give a classic example using the FD method to solve the 2D Poisson equation:

We consider

\[ -\Delta u = f \ \text{in} \ \Omega = (0,1)^2 \\ u|_{\partial \Omega} = 0 \]

Let \( h>0 \) the mesh size such that \( Mh = 1 \) for \( M \in \mathbb{N} \). We introduce the equidistant mesh \( \Omega_h = \{ (x_h, y_l) = (kh, lh) \ | \ 0 \leq k,l \leq M \} \), the discrete boundary \( \partial \Omega_h = \partial \Omega \cap \Omega_h \) and a discrete function \( u_h: \Omega_h \to \mathbb{R} \), abbreviating \( u_{k,l} = u_h(x_k, y_l)\). For interior points in \( \Omega_h \), we discretize the Laplace operator as

\[ u_{xx}(x_k, y_l) = \frac{1}{h^2} (u_{k-1, l} - 2u_{k, l} + u_{k+1, l}) + O(h^2) \\ u_{yy}(x_k, y_l) = \frac{1}{h^2} (u_{k, l - 1} - 2u_{k, l} + u_{k, l+1}) + O(h^2) \]

We thus define a discrete Laplace operator according to

\[ -h^2 \Delta_h u_h(x_k, y_l) = (4u_{k,l} - u_{k-1, l} - u_{k+1, l} - u_{k, l - 1} - u_{k, l+1}) \]

With the discrete right-handside \( (f_h)_{k,l} = f(x_k, y_l) \), we obtain the interior discretization of \( -\Delta u = f \ \text{in}\ \Omega\) as

\[ -\Delta_h u_h = f_h \]