Finite Difference Solution: Two-Dimensional Laplace and Poisson Equations
Definition
The Laplace and Poisson equations are fundamental partial differential equations (PDEs) in physics and engineering. The Laplace equation ($\nabla^2\phi = 0$) describes steady-state potentials (like heat distribution or electrostatic potential) in regions without sources. The Poisson equation ($\nabla^2\phi = f(x,y)$) extends this by including a source term $f(x,y)$. The finite difference method (FDM) is a numerical technique that approximates these continuous PDEs by replacing derivatives with algebraic difference equations at discrete grid points.
Main Content
1. Discretization of the Domain
- The physical domain is divided into a rectangular grid with spacing $\Delta x = h$ and $\Delta y = k$.
- Any point in the grid is denoted as $(x_i, y_j)$, where the function value is $u_{i,j}$.
2. The Five-Point Stencil Approximation
- Using Taylor series expansion, the second-order partial derivatives are approximated: $\frac{\partial^2 u}{\partial x^2} \approx \frac{u_{i+1,j} - 2u_{i,j} + u_{i-1,j}}{h^2}$ $\frac{\partial^2 u}{\partial y^2} \approx \frac{u_{i,j+1} - 2u_{i,j} + u_{i,j-1}}{k^2}$
- For a square grid where $h=k$, the Laplace equation simplifies to the "Average Property": $u_{i,j} = \frac{1}{4}(u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1})$.
3. Poisson Equation Modification
- While Laplace assumes the sum of neighbors is 4 times the center, the Poisson equation accounts for the source term $f(x,y)$.
- The stencil becomes: $u_{i+1,j} + u_{i-1,j} + u_{i,j+1} + u_{i,j-1} - 4u_{i,j} = h^2 f(x_i, y_j)$.
Working / Process
1. Grid Generation and Boundary Conditions
- Define the region and divide it into a mesh of nodes.
- Assign known values to the boundaries (Dirichlet conditions) or specify flux (Neumann conditions).
y |
| o---o---o (Boundary)
| | | |
| o---o---o (Interior node)
| | | |
| o---o---o (Boundary)
+------------------ x
Visual representation of a 3x3 grid stencil for calculation.
2. Setting Up Algebraic Equations
- For every interior grid point, write the finite difference approximation.
- If you have an $N \times N$ interior grid, you will generate a system of $N^2$ linear equations.
3. Solving the Linear System
- Represent the system in matrix form $Ax = B$.
- Use iterative methods like Jacobi, Gauss-Seidel, or Successive Over-Relaxation (SOR) to find the values of $u_{i,j}$ until the change between iterations is below a predefined tolerance.
Advantages / Applications
- Computational Efficiency: FDM is relatively easy to implement on structured rectangular grids for complex engineering problems.
- Heat Transfer: Used to predict steady-state temperature distribution in metal plates or engine blocks.
- Electrostatics: Used to calculate the electric potential distribution in regions with specified charges.
- Fluid Dynamics: Helps in solving for pressure fields in incompressible flow problems.
Summary
The finite difference method transforms continuous Laplace and Poisson PDEs into a discrete system of algebraic equations by approximating derivatives with neighbor-point averages. By applying boundary conditions to a structured grid and solving the resulting matrix equation, we obtain an accurate approximation of the potential field. Key terms to remember are: Discretization, Stencil, Dirichlet Boundary Conditions, and Iterative Solvers.