17 Electrostatics: 17.1 Potential and Field
17 Electrostatics: 17.1 Potential and Field
17 Electrostatics: 17.1 Potential and Field
Electrostatics
= ^
^TTJ
[ [ [ ,
P(^^y^^O
J J 7 ( x - x^y + {y- y'Y + (z - z'Y
^dx'dy'dz',
E(x,2/,z) = -VF(x,2/,2:),
'dV{x,y,z)
dx
dV{x,y,z)
dy
dV{x,y,z)
dz
328
17 Electrostatics
As usual, we can obtain the list of all commands provided by these packages
entering
?Graphics'PlotField'*
and
?Calculus'VectorAnalysis'*
17.1.2 Point C h a r g e
The electric potential at point {x,y,z)
(^o,2/o,^o) is given by
4 Pi Sqrt[x'^ + x'^+x'^]
>!
4 Pi (x^+y^+z^)^/^^
The potential and the field in the plane z = 0 are represented below. We
take zo 7^ 0 to avoid having an infinite expression at the origin (see below:
electricField).
imitMonopoleV[x_, y_] := monopolePotential[l, {O, 0, 0 } ,
{x, y, 0.01}]
329
unitMonopoleVEx, y]
2 +
_^ y^]
2i
4 Pi Sqrt [0.0001 -f x^
equiPotentials = ContourPlot[unitMonopoleVEx, y ] ,
{x, - 2, 2}, {y, - 2, 2}, PlotPoints -^ 60,
ColorFunction -^ Hue, ContourSmoothing True];
Fig. 17.1. Equipotentials, in the plane z = 0.01, of a unit electric charge located
at the origin.
The option Contour Smoothing specifies what smoothing to use for contour
lines.
imitCharge = {{RGBColor [1, 1, 0 ] , AbsolutePointSize [ 2 0 ] ,
Point [ {0, 0 } ] } , { T e x t [ ^ ' + 1 ' \ {0, 0}]}};
In the following command, using the option ScaleFunction -^ (1&), all arrows have the same unit length.
e l e c t r i c F i e l d = PlotGradientField[- imitMonopoleV[x, y] ,
{x, - 1, 1}, {y, - 1, 1}, ScaleFunction -^ (1&),
Epilog -^ unitCharge];
330
17 Electrostatics
V
>
>
^
'
'
'
^
/
'
/
^
^
/
/
^
<
^
/ ^
/ <
^^ <
< <
^ ^
+1
- ^ > > ^
^ ^ ^ ^ ^
\ ^
A
*^
^ ^ ^ ^ ^
Fig. 17.2. Electric field created by a unit electric charge located at the origin.
17.1.3 Dipole
The following function gives the electric potential of a dipole (p, 0,0) localized
at the origin and directed along the x-axis.
dipolePotential[p_, {x_, y_, 2 -}] : =
Limit[(monopolePotential[p / a, {a / 2, 0, 0}. {x. y. z}]
- monopolePotential[p / a, {- a / 2 ,0, 0}. {x. y. z}]).
a -> 0]
unitDipoleV[x_, y_] := d i p o l e P o t e n t i a l [ l , {x, y, 0.01}]
We load the package Graphics'Arrow' to be able to use the command Arrow
to draw arrows.
Graphics' Arrow'
unitDipole = Arrow[{0. 1, 0}, {- 0.1, 0},
HeadScaling -> Absolute];
PlotGradientField[unitDipoleV[x,y], {x, - 1, 1}, {y,
ScaleFunction -> (1&), Epilog -> unitDipole];
1, 1},
^
V
>
>^
*" ^
*" ^
^ 1
^T
. w
'
'
'
^
331
'
'
'
'
< ^
^
>* ^ ^
1
^
>
^ ^ i
Fig. 17.3. Electric field created by a unit dipole, represented by a bigger arrow,
located at the origin.
The option HeadScaling -^ Absolute makes the head of the arrow, representing the dipole, slightly bigger (see Figure 17.3).
17.1.4 Quadrupoles
We consider different functions that give the electric potential of three or four
electric charges whose sum is equal to zero. In the next section we define a
function to plot the corresponding equipotentials and field lines.
We first define the command q u a d r u p o l e P o t e n t i a l l generating the electric
potential created by three charges 2q,q,q localized, respectively, at
(0,0,0), ( | , 0 , 0 ) , and
(-f,0,o).
quadrupolePotentiall =
monopolePotential[2 q, {0, 0, 0}. {x. y. z}] monopolePotentialCq, {aL / 2 . 0, 0 } . {K. y , z}] monopolePotentialEq, {- a / 2 . 0. 0}. {x, y .z}]
2 Pi Sqrt[x2 + y^ + z^]
332
17 Electrostatics
q
4 Pi S q r t [ ( | + x ) 2 + y ^ + z^]
Here is another command giving the electric potential created by four charges
Q^ -Q^ Q^ -Q localized, respectively, at (a/2, a/2,0), (a/2, - a / 2 , 0 ) , (-a/2, - a / 2 , 0 ) ,
and (a/2,a/2,0).
quadrupolePotential2 =
monopolePotential[q, {a / 2, a
monopolePotential[q, {a / 2, monopolePotential[q, {- a / 2,
monopolePotential[q, {- a / 2,
""
q
4 P i S q r t [ ( ^ + x ) 2 + ( ^ + y ) 2 + z2]
2 Pi Sqrt[x2 + y2 + z2]
333
4 Pi S q r t [ ( - + x ) ^ + ( - + y ) 2 + z2]
17.1.5 Plots
W e define the function equipotentialFieldPlot that plots (in the xOyplane) the equipotentials and thefield,and we use it to plot the equipotentials
and the electricfieldlines of the quadrupoles defined above. optionList
stands for zero or more options.
equipotentialFieldPlot[potential-, xRange_, yRange_,
optionList
] :=
Module[{equiPotentials, fieldLines},
equiPotentials = CentourPlot[potential, xRange, yRange,
ContourShading -^ False, ContourSmoothing True,
PlotPoints -^ 60, DisplayFunction -^ Identity];
fieldLines = PlotGradientField[- potential, xRange, yRange,
ScaleFunction -^ (1 & ) , DisplayFimction -> Identity];
Show[{equiPotentials, fieldLines}, optionList,
DisplayFunction -^ $DisplayFunction]];
equipotentialFieldPlot[quadrupolePotentiall /.
{q ^
l,a -> 1, z ^
334
17 Electrostatics
Fig. 17.4. Equipotentials and electric field lines created by three charges respectively
equal to +2 localized at the origin and 1 localized on the Ox-axis at a distance 1/2
and 1/2 from the origin.
equipotentialFieldPlot[quadrupolePotential2
{q ^
l,a -^ 1, z ^
/.
-2
335
-1
Fig. 17.5. Equipotentials and electric field lines created by four charges respectively
equal to 1, + 1 , 1 and + 1 localized at the vertices of a unit square centered at the
origin.
equipotentialFieldPlot[quadrupolePotentialS /.
{q -> l,a -> 1, z ^ 0.001}, {x, - 2, 2}, {y, - 2, 2},
Epilog -^ {{RGBColorEl, 1, 0 ] , AbsolutePointSize[20],
Point[{0, 0}]}, {RGBColorEl,1,0], AbsolutePointSize[20],
Point[{0.5, - 0.5}]}, {RGBColor[l, 1, 0 ] ,
AbsolutePointSize[20], Point[{- 0.5, - 0.5}]},
{Text[''+2'', {0, 0}], Text[''-1", {0.5, - 0.5}],
Text[''-r', {- 0.5, - 0.5}]}}];
Output represented in Figure 17.6.
336
17 Electrostatics
2
--.XN ^ '
/ ^''x
X' - j-.-_
If/
+2
"M
1
M
T^
1
^
1
k
Fig. 17.6. Equipotentials and electric field lines created by three charges respectively equal to +2 localized at the origin and two negative unit charges localized at
(-1/2,-1/2,0) anc? (1/2,-1/2,0).
{internalElectricField
r rho
externalElectricField
R^ rho^
Clear[electricField]
e l e c t r i c F i e l d [ r _ ] := If [r < R, r rho / 3 , R'^3 rho / (3 r'^2)]
plE = P l o t [ e l e c t r i c F i e l d [ r ] / . {R -^ l , r h o -^ 1}, {r, 0, 5 } ,
P l o t S t y l e -^ {RGBColor[0,0,l]}, DisplayFunction -> I d e n t i t y ] ;
337
0,35
0,25
E(r)
0,15
0,05
Fig. 17.7. Electric field created by a uniformly charged sphere as a function of the
distance r from the sphere center.
338
17 Electrostatics
R^ rho
3 r
internalElectricPotential[r_] = externalElectricPotential[R]
Integrate[r rho / 3, {r, R, r}] // Simplify
- ( r 2 - 3 R^) rho
Clear[electricPotential]
electricPotential[r_] := If [r < R, - (r^2 - 3 R'^2) rho / 6,
R'^3 rho / (3 r)]
5},
PlotStyle -^ {RGBColor[0,0,1]}, DisplayFunction -^ Identity]
tl = Graphics[Text[''inside'\ {0.5, 0.3}]];
t2 = Graphics[Text[''outside'^ {3, 0.3}]];
rl = Graphics[{RGBColor[0.4, 0.4, 0 ] ,
Rectangle[{0, 0}, {1, 0. 5}]}];
r2 = Graphics[{RGBColor[0.8, 0.8, 0 ] ,
Rectangle[{1, 0}, {5, 0.5}]}];
Show[{rl, r2, plV, tl, t2}. Axes -^ False, Frame -> True,
TextStyle -^ {FontSlant -^ ''Italic'', FontSize -^ 12},
FrameLabel -^ {''r", " V ( r ) " } , RotateLabel -> False,
DisplayFunction -^ $DisplayFunction];
339
0.5
0.4
0.3
V{r)
0.2
0.1
3
r