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.Features
- Allows you to specify your own distribution of point charges -
this is very easy to do, charges and coordinates are given as a list.
- Allows you to specify the dielectric constants of the media on
either side of the dielectric interface (located at x=0).
- Calculates the electric potential using a variation on the method of images - details are given in the notebook.
- Plots the electric potential using the standard ContourPlot tool in Mathematica. Labels are added to the contour plot using commands found in the LabelContour package.
- Plots the electric field lines throughout the plane, adding arrows to show the direction of force on a positive charge.
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.

Figure 1 - Equipotentials for a random charge distribution near air-water interface
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.

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

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.

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.

Figure
2 - Field lines for charges near air-water interface
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.

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

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.
