Suggestions from the CUPS project

(Consortium for Upper Level Physics Software, published by John Wiley).

Fields of Symmetric Charge Distributions (Short Exercise using CUPS)

In the CUPS Electricity and Magnetism materials there is a program "Gauss' Law in Symmetric Cases" which allows the user to explore the charge distributions of high symmetry and their associated fields and potentials. Many short exercises may be constructed which use this program for the purpose of giving the student a feel for these charge distributions, fields, and potentials.


1. Call up the cupsem.exe program, and select the "Gauss' Law in Symmetric Cases" option. This will place you in the program. From the "Symmetry" menu you have the option of specifying a symmetry case. The choices are planar, cylindrical, of spherical. Having selected the symmetry case, you may specify a charge distribution, a potential function, or an electric field. Once you specify one of these things, the program will calculate the other two. Results may be displayed in either two or three dimensional plots. You may toggle between the two types of plots using the F2 key.

2. The program does not allow the specification of surface charge densities, but they can be approximated by slabs and shells of volume charge density using step functions. Let's start with an infinite (in the yz directions) flat slab of uniform charge density. What would you expect the field and potential to look like for such a slab? To create one, select the case of "Planar" symmetry. Next select "Charge Density Function" from the "Input" menu. For the charge density function enter the unit step function, h(1-x). this will give you a planar slab of constant volume charge density from x = 0 to x = 1. The program will give you a plot of the charge distribution, potential, and electric field. Hit F2 to toggle between two and three dimensional plots.

3. What would you expect the field and potential to look like if you replaced the uniform slab of charge with a charge density proportional to 1/x? Try it and see. What if you replaced if with exp(-x) ? What do the fields of theses three charge distributions have in common?

4. The cases of spherical and cylindrical symmetry can also be investigated. Thin shells of charge may be created by using two unit step functions. For example, to create a hollow spherical shell of charge, one might specify a charge distribution of h(2-r)*h(r-1). The picture below shows the CUPS screen for potential function entry.

Potential Function Input

This yields a spherical shell of charge extending from r = 1 to r = 2. CUPS displays the field. potential, and charge distribution in either two dimensions:

2-D Image

or three dimensions:

3-D Image

Negative charge may be specified by simple adding a negative sign to this step function product. The instructor or student can find many Gauss' Law problems where analytical solutions may be compared with the results of the program. Play around with it and have fun.

5. One last feature under the "Input" menu bears mentioning. This is the "Comparison Function". This feature allows one to input a guess for the functional dependence of the field or potential associated with the specified charge distribution. The guess is then displayed on the screen with the plots of charge distribution, potential, and electric field. This feature allows the student to exercise their ability to recognize various types of functional behavior. The feature is spotty in it's operation, however. The user of the program has no control over the scale of the plot. For example, the field outside a uniform cylinder of charge drops off as 1/r. If one enters the comparison function 1/r, one finds that it does not lie on top of the electric field plot even though they are both of the form 1/r. There appears to be a scaling factor which is different for the two plots that the user has no control over.

Back to Electromagnetics Page

Back to the Physics Packets Home Page