# Electrostatic fields of point charges studied on the computer

by Dan Alin Muresan
May 1996
Presented at Politehnica University of Bucharest, Romania
Electrical Engineering Department
May 1996 Scientific Communications Session

# Abstract

An integrated software environment has been produced and used for the study of electrostatic fields created by point charges. The program allows modeling and visualizing arbitrarily complex systems of charges in a plane. Results include: geometric description and classification of field lines; methods that can be employed for arbitrary fields; sample field images, including all possible two-charge configurations. For all simple systems rigorous mathematical expressions are given. A correlation between electric flux and aspect of field lines is established.

## Purpose of this paper

Assuming that we have obtained an image of the field, one would want to know why field lines behave the way they do. Take the field generated by two charges of opposite signs and different magnitudes q1 and q2; we can see that:

• some lines of force run from one charge to another; others escape to infinity before reaching the second charge
• some equipotentials close around q1, some around q2, and some around both charges.

These aspects are discussed in section 2.

# 1. Computer modeling

Field expert is a Windows application that can shed light over complex systems of charges. All images in this paper have been created with Field expert. The program takes the form of a specialized integrated environment and is designed to provide maximum ease of use:

• To place an electric charge, click the right mouse button on the desired place on the screen; alternatively the menu Field | Add charge (^A) can be used if exact coordinates are desired.
• In the top-left corner of the window the program displays the current mouse position and the electric field strength E and potential V at that point. Multiples and submultiples are used if more appropriate: E may show up as 1.234 M, which means 1.234 * 106 V/m, or as 7.236 m, which is 7.236 * 10 -3 V/m.
• To draw field lines, click the left mouse button; depending on the current options, the program will compute and display the line of force and the equipotential passing through the specified point. You can toggle generation of lines of force or equipotentials with the corresponding items in the Options.
• To see a global map of the field, choose Draw | Field map (^M). Depending on the settings in the Options menu (as before) , the program will show elementary lines of force OR equipotentials (not both!) through the points of a grid.
• To clear the screen if it has become too cluttered, press ^R or select Draw | Clear screen.
• To remove or modify a charge, click the right mouse button on that charge.
• Use File | Save to save the configuration (not the image !) to a file; File | New will clear all charges, and File | Load will load a field configuration from a file.
• When you like the image, choose
• File | Save image to save it to a file, or
• Edit | Copy image to place it on the clipboard and paste it in other applications.
• The program currently supports the Windows DIB (Device Independent Bitmap) for disk files, and the BMP format for Clipboard selections. If another format is needed, the image can be easily filtered through Paintbrush or other specialized graphic tools.
• The Help menu is a quick reminder of the conventions and procedures used in this application.

• Options | Charge values: display charges as numbers (their value), rather than the usual circles with "+" and "-" inside. The is unpleasant if charges are close, so the default is off.
• Options | Time limit: sometimes it takes too long to generate a single field line; the maximum number of seconds in which the program tries to draw the field lines through a point is controlled by this option (by default 6) . The program can tell if a field line runs to infinity or gets stuck into an equilibrium point, but even "regular" field lines can be "too long".
• Options | Granularity: select granularity for the grid associated to Field map. A large value here results in coarse pictures; very small values obscure it completely; the default setting (10 pixels) works fine.

# 2 Description of field lines

## 2.1 Generalities

The electric field E and the potential V created by a system of point charges in any point is found by superposition:

where r is the position vector of the point and ri are the position vectors of the charges.

Lines of force satisfy the differential equation: , where Ex, Ey and Ez are the components of the vector E, of the form:

In the general case, there is no symbolic solution for this equation, so have to use numerical integration; however, as we will prove, symbolic solutions can be found for a system of point charges distributed on a straight line.

Equipotential surfaces satisfy the implicit equation

Field lines are normal to equipotential surfaces in any point; also, since field lines are solutions of a differential equation, they don't cross.

Electric field and electric potential are related by

For a point charge q, the electric flux through a surface S is

The negative sign is for surfaces where the flux is directed inwards

## 2.2 Two charges in a plane

### 2.2.2 Lines of force

#### Deducing the equations

In this case it is possible to choose a simple coordinate frame:

• place the origin at the midpoint of the segment AB, where A is the location of q1 and B is the location of q2
• choose AB as the horizontal axis Ox
• denote by 2a the length of AB
We make no sign assumptions yet.

The electric field is given by and the electric potential by . Because we are in a bidimensional world, we will have equipotential lines instead of surfaces.

The equation of lines of force contains now a single equality (because the third coordinate z is not of concern) and can be re-arranged as: . This equations turns out to have the solution

For different values of the parameter C the equation describes all the field lines. The physical meaning of this expression will be given later.

For y=0,

#### Analysis

##### Range of parameter C for all lines of force

The two factors that multiply q1 and q2 are precisely

Here a1 and a2 are the angles that describe the polar position of the target point relative to q1 and q2. Consequently, the two factors should be between -1 and +1, so that the parameter C must satisfy the inequation:
.
For other C's, the equation has no solution (the parameter does not describe any line of force).

Inequation (2) is necessary, but not sufficient. The angles a1 and a2 must satisfy , because APB is a triangle (a degenerated one maybe). It can be shown that extremal values for C are obtained for points of AB; therefore the two limits of C are the minimum and maximum value in the set { - q1 - q2 , q1 - q2, q1 + q2 }

a) If the two charges have like signs, the two extremal values for C are obtained

• one on the line that runs from q1 to infinity, along AB, not passing through B
• one on the line that runs from q2 to infinity, along AB, not passing through A

b) If the two charges have opposite signs, one limit will be on segment AB.

##### Lines of force passing through a given charge

Looking at the images in the first paragraph one can see that

• some lines of force pass through both charges,
• others pass through only one of the charges and run to infinity at the other end.

The question answered here is: what are the lines of force that pass through a given charge ? Refer to equation (1) again: since lines of force are controlled by the parameter C, we have to find a range for C.

For a line of force that passes through charge qk , the restriction of function f to that path is continuous in the neighborhood of the point (xk, 0), where qk lies; consequently, on that path the limit.

or, substituting

Take k=1 (for the other charge the results will be similar). Then xk = -a; the second term poses no problem and can be taken out of the limit, replacing x by -a and y by 0:

Remembering that the expression under the limit is a cosine, we get the inequality , which can be broken into . At least one of these conditions will be satisfied automatically (it will be equivalent to one of the inequalities in the validity inequation (2)).

The conditions for lines of force to pass through q2 are analogous:

The inequalities may or may not be strict: taking the equal sign, some of them yield to reunions of singular paths.

To study the field lines further, we have to examine each case separately.

##### Case study

a) charges of same sign and different magnitudes: q1 > 0, q2 > 0, |q1| < |q2|.

The conditions become:

• lines passing through q1:
• lines passing through q2:
• value of C for separation: Cs = q2 - q1

The separation between the two families is . For y=0,

So segment AB is part of the limit curve; the other part is a curve which passes between q1 and q2. Since it only crosses line AB once (within segment AB) and since field lines are infinite, the separation is an infinite curve, bending to the side of q1 (the smallest charge in terms of magnitude).

The two parts of the separation cross where the differential equation has a singular point, that is at the point where E=0. From the equation E=0 we can compute the position of this singular point: (closer to the smallest charge)

b) charges of opposite signs and different magnitudes: q1 > 0, q2 < 0, |q1| < |q2|

• validity condition for C:
• lines passing through q1: (C must be "large enough")
• lines passing through q2: (all field lines pass through the charge of greatest magnitude)
• value of C for separation: Cs = |q2| - |q1|

The separation is given by ; for y = 0,
which is the ray starting at B and running away from A. The other part of the separation is a bounded curve enclosing both charges (because all field lines passing through q1 are bounded). The two parts cross at a point where E=0
(outside segment AB, closer to A, where the smallest charge lies)

c) charges of same sign and same magnitudes, q1 = q2 = q > 0

The configuration is symmetric about the vertical axis.

• lines passing through q1:
• lines passing through q2:
• separation: , which is segment AB and the perpendicular through its midpoint O. In , E becomes zero.d) charges of opposite signs and same magnitudes q1 = q > 0, q2 = -q < 0
• validity condition for C:
• all field lines pass through both charges
• there is only one family of curves; no separation and no singular points exist (|E| > 0 everywhere).

### 2.2.3 Equipotentials

#### Deducing the equations

The equation V(x,y) = is already in non-local form and will have as solution a curve in the xy plane (the intersection of a surface with the xy plane). The corresponding differential equations is:
or, remembering that the partial derivatives of potential V are the components of vector E:

and simply means that the normal to equipotentials in any point is the electric field in that point.

#### Analysis

Equipotentials are closed paths; some equipotentials close around one charge, some around more charges, and some enclose no charge at all (e.g.: four equal charges in the corners of a square). This can be a criterion for distinguishing families of equipotentials.

Given a point in the plane or a value of the potential V, it is difficult to predict the behavior of the corresponding equipotentials. However, the separation line between different families can be found using differential geometry considerations. Equipotentials are plane curves; the separation lines are given by those curves that have singular points (if an equipotential has no singular point, it is a "regular" one, not a limiting curve). The singular points of a curve are those for which all partial derivatives become zero simultaneously; but, since the partial derivatives of the potential V are the components of the electric field E, singular points are those for which E=0:

All we have to do is

• find the singular points of the field
• compute the potential V of those points
• trace the equipotentials corresponding to the computed V
##### Case study

a) charges of same sign and different magnitudes: q1 > 0, q2 > 0, |q1| < |q2|.

The singular point has been found to line on the horizontal axis at

The potential at that point (the separation potential) is

The equipotential corresponding to Vs consists of two curves intersecting at (xs , y). For lower potentials, the equipotentials enclose both charges; for higher potentials, the equipotentials consist of isolated curves. Equipotentials that encircle Vs tend to a round shape, as if the system of charges were acting as a single charge. Thus, Vs can be used as a threshold when approximating the system with a single charge.

b) charges of opposite signs and different magnitudes: q1 > 0, q2 < 0, |q1| < |q2|

The singular point has

The potential at that point (the separation potential) is

The image differs from the previous case; one has to consider the "zero" equipotential V=0, which turns out to be a circle. Then

• Positive values correspond to equipotentials that enclose the positive charge and are inside the "zero" equipotential.
• Negative potentials higher than Vs give birth to
• equipotentials that enclose both charges and decay progressively to circles and
• equipotentials that surround the positive charge and are larger than the "zero" equipotential
• Negative potentials lower than Vs are only matched by equipotentials that surround the negative charge

c) charges of same sign and same magnitudes, q1 = q2 = q > 0

This is just a particular case of (a). The separation potential is

d) charges of opposite signs and same magnitudes q1 = q > 0, q2 = -q < 0

This is the electric dipole case. There is a fundamental difference from case (b) : there is no singular point and no separation potential. The dipole can not be approximated by a point charge, no matter how far we are, because no equipotential surrounds both charges.

The "zero" equipotential (the vertical axis) is an axis of (geometric) symmetry for the equipotentials. On the left, equipotentials correspond to positive values; on the right, to negative potentials.

## 2.3 Collinear charges

Consider n charges on the horizontal axis, with their coordinates xk and their charges qk. The equation of the lines of force is similar to (1):

This equation can be deduced delimiting a "tube of force" by revolving a portion of a line of force around the horizontal axis. Obviously there is no flux through the "walls" of the tube. Then equation (1') is really conservation of flux through any vertical section of the "tube": flux is proportional to solid angle for point charges, and the solid angle through a transverse section is .

Thus the methods designed above to study lines of force and equipotentials created by two charges can be applied to this situation as well.

## 2.4 Arbitrary systems of charges -- conclusions

For arbitrary systems of charges it is not possible to integrate the differential equations of a line of force. Equipotentials always have non-local equations (from definition), but then it is difficult to say anything about their shape in the general case; the conclusion that points where E = 0 lead are centers of separation between families of equipotentials holds, of course. One can easily get an overall picture of the field with the aid of Field Expert, write a qualitative description, and then focus on "hot points" to compute potential and field strength rigorously. Section 2.1 proves the effectiveness of this method.

The general behavior of the field is the following:

• equipotentials and lines of force are perpendicular to each other; two equipotentials don't cross; two lines of force don't cross; a line of force doesn't cross itself; an equipotential generally doesn't cross itself, except for "separation" equipotentials"
• very close to a given charge, equipotentials are circles and lines of force are radial; as we go farther, the equipotentials start to enclose more and more charges. The system of charges can be divided into pairs, then larger and larger groups, and then the entire system that eventually "fall" inside an equipotential and start acting as a single charge.

Exceptions:

• in symmetrical configurations (this refers to charge as well as geometry), there is only one "big" group comprising all the charges (there are no smaller groups).
• if the total charge in the system is zero, the system as a whole never behaves as a single charge, but rather as a dipole (or multipole) formed of two (or more) groups of charges.

NOTE: multipole configurations are rather hard to obtain, requiring very precise geometry; the quadripole may be the easiest -- four charges of equal magnitude and alternating signs in the corners of a square.

Another aspect from which I have shied away up to now is that the images produced by Field Expert are intriguing and, well, beautiful. I take the freedom to include some examples.

### 2.4.1 Four equal charges as a square

• there are five equilibrium points (the green circles); only the one in the center of the square is stable. A test charge placed near this point would invariably end up in the equilibrium position, which is a local minimum for the potential. The other four points are local maxima of the potentials.
• this example shows that there doesn't have to be a charge inside every equipotential (look in the center)

### 2.4.2 "Uniform" field

This simulates the field inside a plane capacitor; as expected, the field is almost uniform. The system acts as a dipole. Note: the "plates" would be much closer to one another normally.

### 2.4.3 A random configuration

Many singular points, separation curves and families of lines

### 2.4.4 Composite dipole -- three charges

The total charge of the system is zero. The system as a whole acts as a dipole.

# Author

I would like to thank Prof. MIHAI IORDACHE and Prof. ANCA IONESCU from "Politehnica" University for their guidance and help and for the excellent materials provided. Without them this paper would not be quite so complete.

The author of the Field Expert pogrom and of this paper is Dan Alin Muresan, first year student in the same university. Contact the author at his e-mail address

``` danm@morris.pcnet.ro
danm@lbi.sfos.ro
```

# References

• 1. S. Grant, W. R. Phillips -- Electromagnetism; John Wiley & Sons Ltd., West Sussex; second edition, 1990
• 2. Durand, Electrostatique et magnetostatique; Masson & Cie, Paris 1953
• 3. Mocanu, Teoria campului electromagnetic; Editura Didactica si Pedagogica, Bucuresti 1981

# Appendix A -- Program implementation

## Algorithm

The program uses the Euler numerical integration method to generate lines of force; starting from a given point, the line of force is followed pixel by pixel in both directions until a charge is "hit" or it runs away to infinity. Equipotential surfaces are traced using their definition, because they are closed curves and errors in the Euler lines method, which tend to cumulate, would make them open ! The equipotential is assumed to be smooth (with no sharp turns). See source code for more details.

## Platform and language

The program is written in C++. The Windows interface is based on the Borland C++ 4.0 Object Windows Library. Electrostatic field computations are implemented in separate C++ classes, so the code is reusable for other applications. The program has been tested extensively under Windows 3.1 and Windows '95.

# Appendix B -- Open topics

• Combining theoretical results with numerical methods would increase efficiency, quality of images and degree of automation; the program could find "hot points" of the field without help from the operator.
• A 3D version of the program would be spectacular. I haven't had the time to test my ideas on 3D field surface metrics; I would be glad to find someone who has shares this interest.
• Multipoles and multipolar moments deserve a more careful analysis.