LabelContour.m - Mathematica package required to label contour plots

- 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.

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.