Grid systems are important not only for physics: many other branches exploit the concepts of potentials and adapt it to their own problem —e.g., for a robot (a positive charge we want to find the trajectory for) trying to reach a goal (negative charge) with obstacles along the way (positive charge)—. Performing the calculations for the grid considering every point is too computationally expensive, so different schemes —namely Jacobi, Gauss-Siedel, and Succesive Over-Relaxation (SOR)— are implemented.
This is a simple model, where each charge is represented by a pointwise particles, which make up an electric quadrupole (adjacent particles have opposite charges). The potential behaves as expected, which supports the validity of the code.
This configuration is more complicated: a U-shaped curve of positive charges is created, with a negative (stronger) charge in the bottom. This scenario could be useful to represent an obstacle and a goal, but notice that there are local minima inside the U curve (this could lead to problems in the robot-seeking-goal scenario).