2D Visualization of Electric Fields of Point Charges around a Dielectric Interface

Tyrone Curtis
2D_DielectricBoundary.nb - Mathematica notebook (for Mathematica 5.1)
LabelContour.m - Mathematica package required to label contour plots

Summary of notebook contents

This is a Mathematica notebook for plotting equipotentials and electric field lines for a series of point charges near a dielectric interface in the 2D plane.  Equipotentials are plotted using the standard Mathematica ContourPlot command, however extra commands found in the LabelContour package are used to label contours.  Field lines are plotted by numerically solving the differential equations of the electric field.  Please note that this notebook has been created using Mathematica Version 5.1.  As such there may be incompatibilities with earlier versions of Mathematica.


The contour plot of the electric potential for a random distribution of charges near an air-water interface is shown in figure 1.  Spatial dimensions are in units of Angstroms.  Positive charges are shown in blue, negative charges in red.  All charges are ±1 electron charge.

Equipotentials near dielectric boundary
Figure 1 - Equipotentials for a random charge distribution near air-water interface

Figure 2 shows the field lines for this configuration.  These field lines were found by solving numerically solving the differential equations of the electric field, using the Mathematica command NDSolve.

Field lines for charges near air-water interface

Figure 2 - Field lines for charges near air-water interface

Included in the notebook is alternative code for producing the field lines - the method used to produce the field lines in figure 2 uses NDSolve to compute the field lines from the parameterized differential equations, with "t" the parameter.  Since the electric field can be relatively weak in materials of high dielectric constant, the NDSolve routine must be run for quite some time to produce field lines which actually run from one charge to another.  Another problem that occurs occasionally when charges of similar strength are located near each other is that the initial step along the field line is too large, which results in the field line making too large a jump in one direction - this can lead to field lines crossing each other, which obviously should not happen!

To counter this problem, I included code which plots the field lines using a much simpler method, similar to the Euler method of solving DE's.  This method takes fixed spatial steps along the field lines, rather than steps in the time parameter t.  Figures 3 and 4 show a particular example of how this method may be more effective than the more advanced NDSolve method.  Note in figure 3 that some of the field lines are quite rough, and some of the field lines cross.  In figure 4, which was produced using the simpler Euler method, the field lines are much smoother.

Field lines plotted using NDSolve

Figure 3 - Field lines plotted using NDSolve method - note the crossed field lines

Field lines plotted using simpler method

Figure 4 - Field lines plotted using simpler Euler method  - much smoother field lines

I would recommend using the alternative method a majority of the time for this problem, it seems to be much more reliable and doesn't take as long to produce the field lines.  However I would recommend the user experiment with both methods and decide for themself.