Numerical Solution of the 2D Laplace Equation Using Finite Difference Method and Gauss-Seidel Iteration

Read full text
Authors: Gebeyaw Endris Ahmed, Ebrahim Assen Getahun
Cited by: 0

Abstract

This MATLAB codebase provides a numerical framework for solving the 2D Laplace equation using the finite difference method (FDM) and the Gauss-Seidel iterative algorithm. The software is specifically designed to simulate electrostatic potential distributions in charge-free regions ($\nabla^2 V = 0$) under Dirichlet boundary conditions, effectively modeling capacitor-like configurations. The implementation allows users to reproduce the four distinct research cases detailed in the associated manuscript: Case 1: A $1 \times 1$ square domain with a fine $100 \times 100$ grid. Case 2: A $2 \times 1$ rectangular domain with a $200 \times 100$ grid. Case 3: A $1 \times 0.5$ narrow domain using a coarse $50 \times 25$ grid. Case 4: A $2 \times 2$ large domain with a dense $200 \times 200$ grid. The code includes built-in visualization tools to generate 3D surface plots of the scalar potential, 2D contour plots of equipotential lines, and quiver plots illustrating the magnitude and direction of the resulting electric field ($E = -\nabla\phi$).

Fields of Study & Subjects

Matrix Theory and Algorithms Electromagnetic Simulation and Numerical Methods Electromagnetic Scattering and Analysis

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
6 March 2026
Language
EN