Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: funny capacitor (URL)



I corrected obvious mistakes in the tutorial posted earlier. The
numbers in the narrative now match the numbers in the tables.
The corrected version is shown below. It has the HTML tags
because I am about to post it on my website. Feel free to
cut-and-paste it to your site for students.
********************************

<HTML><HEAD><TITLE>TUTORIAL </TITLE></HEAD>
<BODY>
<center><H1> ELECTROSTATICS WITHOUT CALCULUS
</H1><H3></center>
<P>
The most interesting problems of electrostatics used to be
inaccessible to students unfamiliar with advanced calculus.
Here are typical problems:
<P>
a) Given a charged conductor of a certain shape, for example,
a cylinder or cone, how are charges distributed over the
surface?
<P>
b) Find net charges (Q1, Q2, Q3, etc.) on three or more conductors
when their imposed potentials (V1, V2, V3, etc.) are given.
<P>
c) Find potentials (V1, V2, V3, etc.) of three or more conductors
when their net charges (Q1, Q2, Q3, etc.) are given.
<P>
The solutions of electrostatic problems are based on the idea of
equilibrium; charges and potentials are in the state of minimal
potential energy. Mathematically it means a certain distribution
of potential in the entire region. Each of the above problem can
be solved on the basis of rather simple laws of physics when
the distribution of potentials in the surrounding space is given.
Unfortunately, finding a distribution of potentials analytically
is not trivial, even for those who are familiar with advanced calculus.
The purpose of this tutorial is to describe a numerical method of
finding the distribution of potentials in empty space imposed by
fixed potentials on conducting objects.
<P>
1) The procedure will be illustrated on a specific example. Please
do exactly what is described below. It will be a description of
what one would have to do solve the problem by hand. Once
you know the algorithm you should be able to implement it by
writing a computer program, as I did, or by using the spreadsheet,
as JohnD and Leigh did. Take a page of a graph paper and draw
a large square. My unit of distance is one cell; your square
should be 20 cells wide and 20 cells tall. Please do this now.
There should be 400 cells inside of your square. You will be
asked to write and to erase numbers into these cells.
<P>
2) Write numbers 1 to 20 below the big square; each number
identifies one column in your little universe. Then write numbers
1 to 20 on the left of your big square; ; each number identifies
one row. Write zero into every cell of column 1 and column 20.
Also write zero into every cell of row 1 and row 20. What have
you done? You created a metallic enclosure of your universe and
fixed its potential to arbitrary value, zero. The enclosure is to be
a reference with respect to which all other potentials are defined.
Zeros written into cells become potentials assigned to them. You
have assigned zero potential to the entire enclosure.
<P>
3) Now construct the letter T and the letter L inside the box.
The trunk of T should be from cell (7,9) to (7,13); the vertical
bar of T should be from (5,14) to (9,14). Draw the boundary
around of T, it surrounds 10 cells. Write +5 into each of them.
You now have a conductor, in the shape of the letter T, whose
potential is +5 volts.
<P>
4) Your second conductor will have the shape of the letter L.
The trunk of that letter is from cell (12,14) to cell (12,10) while
its base is from (12,9) to (15,9). This conductor consists of
nine cells. Write -9 in each of them. Why -9? Because you want
the second conductor to be at a constant potential of -9 volts.
<P>
5) And finally the last conductor; it does not look like a letter.
It is a small rectangle. The lower left corner of that rectangle
is the call (7,4) while its upper right corner is cell (15,5). To
make the potential of this object -2 volts; write -2 into each
of its cells. You now have a set of three conductors plus the
fourth conductor called the enclosure. The potentials imposed
on them will determine potentials in cells belonging to the
empty space. All cells, in your little universe, except those
which belong to conductors, belong to empty space. What are
the values of potentials in the empty space cells? That is the
question we want to answer. The purely mathematical
approach would be very difficult but a numerical solution
can easily be found, as illustrated below.
<P>
6) Here are important statements about problems of that nature.
A mathematician would know how to justify them but we must
take them on faith.
<P>
<B>a)</B> The problem has a unique solution.
<P>
<B>b)</B> The solution is such that potentials change gradually from
one cell to another. For example, the potential in cell (8,9) is likely
to be close to +5, perhaps +4 or +3.5 while the potential in cell
(11,9) is likely to be close to -9, perhaps -8 or -6.85. Keep in
mind that potentials of cells occupied by conductors remain constant.
<P>
<B>c)</B> In the electrostatic equilibrium the potential of any empty
space cell is equal to the mean value of potentials in the four
surrounding cells. This is the most useful property of the solution.
The above statement can be illustrated with an example. The potential
of cell (6,13) is one quarter of potentials in cells (5,13), (7,13),
(6,12) and (6,14). Two of these four cells are inside the T object.
Likewise, the potential in (17,6) is one quarter of the sum of
potentials in cells (16,16), (16,18), (17,15) and (17,17). This
time all neighboring cells belong to the empty space.
<P>
7) Equipped with this knowledge we can begin solving the
problem. You must make a first guess about the solution.
We will make a highly unrealistic guess by assuming that all
potentials in empty space are zeros. Then we will show that
the guess is not acceptable because the statement <B>c</B>
is not satisfied by all empty cells. We will try to make the
statement valid by changing potentials in all cells. The
acceptable solution will emerge gradually. In principle, it
is possible that the initial guess corresponds to the exact
solution but we will not count on this.
<P>
At this point I should ask you to write zero in all empty space
cells. But that is too much work. Instead of doing this write
zeros in cells between the conductor T and conductor L.
Then add couple of more zeros above the third object as well.
The initial potentials in my square, printed by the computer,
are shown below. Do you recognize the three conductors
near the center?
<H5><PRE>
20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 5 5 5 5 5 0 0 -9 0 0 0 0 0 0 0 0
13 0 0 0 0 0 0 5 0 0 0 0 -9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 5 0 0 0 0 -9 0 0 0 0 0 0 0 0
11 0 0 0 0 0 0 5 0 0 0 0 -9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 5 0 0 0 0 -9 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 5 0 0 0 0 -9 -9 -9 -9 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 0 0 0
0 0 0 0 0 0 -2 -2 -2 -2 -2 -2 -2 -2 -2 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

1 3 5 7 9 11 13 15 17 20
</PRE></H5><H3>
8) Go to cell (8,9) and calculate what its content should be
according to the rule c above. My answer is +1.25. Do you
agree? If not read the rule c carefully and try again. Then go
to the cell (8,10) and calculate its content. My answer is
(1.25-5+0+0)/4=1.625. And what about the cell (8,11)?
My rounded answer is 1.656, etc. Now go back to the
cell (8,9). Does it satisfy rule c? No, it doesnít, the potential
should not be 1.25. But how can it be? Why was 1.25
acceptable before and not acceptable now? I hope you do
not need me to answer this question. The new content in
cell (8,9) must be (1.625+5+0+0)/4=1.656. Please erase
the previous content and write ?1.656 into cell (8,9). Now
go back to the cell (8,10) and recalculate its new content.
Again erase the old content and write the new content into
the C(8,10) cell.
<P>
9) You are expected to this over and over again for every empty
space cell. Tedious? Yes. Error-prone? Yes. Slow? Yes. Boring?
Certainly! That is why you need a computer. The computer begins
with your first guess and then starts finding averages for all
empty space cells, for example, starting at the upper left corner,
cell (2,18), and ending at the lower right corner, cell (19,2).
Only empty space cells are subject of changes, cells belonging
to conductors, including the enclosure, participate as neighbors
of changeable cells, but their own contents do not change. In
other words never try to change the content of a cell which
belongs to a conductor.
<P>
10) A single pass (one change in every empty space cell) does
not produce the desired solution. You already know why it is
so; by making a change in a cell you change the situation in the
neighboring cells, even those which have already been adjusted.
Many passes are required to reach a situation in which subsequent
passes produce negligibly small changes in adjustable cells. When
this happens we stop the process and record the contents of cells.
The technical term for one pass is one iteration. Nobody would
be crazy enough to perform hundreds or thousands of iterations
by hand, especially today, when computers are available.
<P>
The potentials my computer generated after 100 iterations
(in only three seconds) are shown below. Unable to display
all cells I cut the left and right margins (5 columns on each side).
As you can see, potentials of conductors, did not change but
potentials in empty space cells changed a lot.
<H5><PRE>
20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
0.45 0.41 0.31 0.14 -0.08 -0.29 -0.46 -0.56 -0.58 -0.54
0.97 0.90 0.68 0.32 -0.15 -0.63 -1.00 -1.19 -1.21 -1.11
1.61 1.52 1.20 0.62 -0.22 -1.07 -1.72 -1.99 -1.96 -1.76
2.45 2.37 1.98 1.16 -0.25 -1.73 -2.83 -3.07 -2.88 -2.50
15 3.57 3.54 3.20 2.28 -0.23 -2.75 -4.79 -4.60 -3.99 -3.33
5.00 5.00 5.00 5.00 -0.21 -4.24 -9.00 -6.52 -5.17 -4.16
4.56 5.00 3.76 2.04 -1.35 -5.02 -9.00 -7.32 -6.00 -4.87
4.28 5.00 3.02 0.73 -2.21 -5.50 -9.00 -7.77 -6.63 -5.51
4.06 5.00 2.59 0.07 -2.71 -5.76 -9.00 -8.13 -7.23 -6.18
10 3.77 5.00 2.27 -0.32 -2.96 -5.82 -9.00 -8.53 -7.97 -7.13
3.22 5.00 1.79 -0.64 -2.98 -5.58 -9.00 -9.00 -9.00 -9.00
1.82 1.93 0.55 -1.07 -2.76 -4.50 -6.13 -6.64 -6.66 -6.21
0.65 0.34 -0.45 -1.43 -2.48 -3.52 -4.38 -4.78 -4.80 -4.44
-0.24 -0.79 -1.24 -1.73 -2.23 -2.71 -3.10 -3.29 -3.30 -3.11
5 -0.91 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00
-1.05 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00 -2.00
-0.75 -1.14 -1.26 -1.31 -1.32 -1.33 -1.33 -1.32 -1.29 -1.22
-0.38 -0.53 -0.61 -0.64 -0.66 -0.66 -0.66 -0.65 -0.63 -0.59
1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00

6 8 10 12 14
</PRE></H5><H3>
11) The above set of numbers is a desired solution. I know
this because I asked the computer to perform additional 100
iterations and verified that the contents of cell did not change
significantly. The number crunching process would be
considerably longer if the number of cells was much larger,
for example, 100 by 100, or more.
<P>
12) What comes next? It depends what you want. To draw the
equipotential lines, for example, you would use a much finer
grid of tiny cells, for example, 2000 by 2000, proceed as above,
and connect cells whose potentials are nearly the same. To find
the electric field at any location you calculate gradients, that is
rates at which potentials change along the" downhill or uphill"
directions. Electric fields calculated in that way, at the surfaces
of conductors, would allow you to calculate sigmas, the surface
charge densities. And by adding sigmas you would be able to
determine electric charges on all conductors. In other words you
would calculate Qs from Vs and determine the distribution of Qs
on individual conductors.
<P>
I did not intend to cover these topics in this tutorial. I am referring
to them to emphasize that complex problems of electrostatics can
now be solved without calculus. The problem discussed in our
Funny Capacitor thread (find potentials of electrically floating
conductors from their net charges), or the problem of the charge
distribution over a cylinder (discussed in an earlier thread) are
among the most complex in electrostatics. And yet we were able
to solve them without calculus. Is this is good or bad?
<P>
13) Next comes an important realization. What did we mean
by saying that the left object, for example, has the shape of the
letter T? The silent assumption about its third dimensions was
that T is simply the cross section and that the third dimension is
perpendicular to the page. Each object is supposed to be a very
long bar. The surface facing us is presumably negigibly small in
comparison with surfaces we can not see. In other words, the
boundaries of letters are projections of large unseen surfaces.
Thus by calculating, for example, that sigma=0.5 nC/m^2 we
are referring to a surface we can not see. To calculate Q from
sigmas we must know how large these surfaces are.
<P>
14) Representing three-dimensional objects in two-dimensional
space is not always valid. A more universal algorithm would
involve cubical cells in three dimensional space. The process
of averaging for three-dimensional cells would consist of
adding six neighboring cells and dividing by six (instead of
four cells and dividing by four). Otherwise the approach would
be identical.
<P>
15) What follows is the listing on my True Basic program for
the above problem. Hopefully, it may help you in writing a similar
program in a language with which you are familiar. As you can see,
the subroutine ASSIGN is used to formulate the initial conditions
(initial potentials in all cells, as in my first table above). All iterations
are performed in the subroutine ITERATE. The IF structure of this
subroutine is used to make sure that only cells belonging to empty
space are processed. Cells belonging to conductors are used as
neighbors, when necessary, but their potentials remain constant.
<H4><PRE>
PROGRAM LAPLACE
!******************
let xmin=1
let xmax=20
let ymin=xmin
let ymax=xmax ! SMALL UNIVERSE
DIM V(20,20)
LET iter_max=100 ! HOW MANY ITERATIONS
let VL=-9
let VT=+5 ! POTENTIAL ON 3 CONDUCTORS
let V3=-2
CALL ASSIGN(V(,),VL,VT,V3,xmin,xmax,ymin,ymax)
CALL ITERATE(V(,),VL,VT,V3,xmin,xmax,ymin,ymax,iter_max)
for y=20 to 0 step -1
for x=5 to 16
print using "##.## ":V(x,y); ! DISPLAY THE RESULTS
next x
print
next y
END

SUB ASSIGN(V(,),VL,VT,V3,xmin,xmax,ymin,ymax)
!***********************
for x=xmin to xmax
for y=ymin to ymax
let V(x,y)=0 ! start with zeros
next y
next x
let x=7
for y=9 to 14 ! the trunk of T
let V(x,y)=VT
next y
let y=14
for x=5 to 9
let V(x,y)=VT ! the top of T
next x
let x=12
for y=9 to 14
let V(x,y)=VL ! the trunk of L
next y
let y=9
for x=12 to 15
let V(x,y)=VL ! the base of L
next x
for x=7 to 15
for y=4 to 5
let V(x,y)=V3 ! the third conductor
next y
next x
END SUB

SUB ITERATE(V(,),VL,VT,V3,xmin,xmax,ymin,ymax,iter_max)
!****************************************************
DO
for x=xmin+1 to xmax-1 ! START NEXT ITERATION
for y=ymin+1 to ymax-1
if (V(x,y)<>VL and V(x,y)<>VT and V(x,y)<>V3) then
let b=V(x,y+1) ! above
let c=V(x+1,y) ! right
let d=V(x,y-1) ! below
let e=V(x-1,y) ! left
let V(x,y)=(b+c+d+e)/4 ! ONE CELL UPDATED
end if
next y
next x ! END THE ITERATION
LET iter = iter + 1
LOOP until iter>iter_max ! NEXT ITERATION OR STOP
print" Last iteration # was";iter-1
END SUB
</PRE></H4>
</BODY></HTML>