Worksheet 7

PHY201, 2000
Donev Aleksandar

Electrostatic potential of a system of charges

This problem is quite interesting and can be solved in many ways, some efficient and well-structured, others quick and sloppy. I will follow the recommendations given in the assignment, which make this look similar to the corresponding Fortran 90 code.

First we choose positions for the 4 charges and their magnitudes, and enter them as matrices (nested lists in Mathematica):

[Graphics:Images/index_gr_1.gif]

The electrostatic potential at a given point with position R is simply the sum of the potentials from the four individual charges. Each of the individual forces is given with U(R)=[Graphics:Images/index_gr_2.gif]. I define the potential as a function of the position R where the potential is measured, using the standard Mathematica constructor:
Function[x_]:=Expression with x
Just to make sure there are no numerical singularities, we add a small number to the denominator:

[Graphics:Images/index_gr_3.gif]

Now we can plot this function by setting R={x,y}:

[Graphics:Images/index_gr_4.gif]

[Graphics:Images/index_gr_5.gif]

[Graphics:Images/index_gr_6.gif]


Notice that the potential becomes singular near the four charges, but is otherwise fairly smooth in-between. So it is probably better to plot the coutours of the potential surface:

[Graphics:Images/index_gr_7.gif]

[Graphics:Images/index_gr_8.gif]

[Graphics:Images/index_gr_9.gif]

And here is the electric field:

[Graphics:Images/index_gr_10.gif]

[Graphics:Images/index_gr_11.gif]

[Graphics:Images/index_gr_12.gif]


Converted by Mathematica      December 12, 2000