Exercise 6: Lecture 6

Objective/Overview:

In class this week we discussed the Div, Grad, and Curl operations, and how these apply to electrostatic fields.  Right now, we have a good understanding of how charge distributions, electric fields, and electrostatic potentials are linked.
We know that Gauss’s Law describes the relationship between field and charge
∇·(OverVector[D])(x,y,z)=ρ(x,y,z) and ∫(OverVector[D])·d(OverVector[S])=∫ρdV, with (OverVector[D])=(Subscript[ϵ, o])(OverVector[E])
We know that the relationship between the (vector) Electric Field and the (scalar) Electrostatic Potential is:
-∇V=(OverVector[E]), or alternatively, ΔV=-∫(OverVector[E])·d(OverVector[ℓ])
We know that any electric field obtained by taking the gradient of a scalar, will have ∇×(OverVector[E])=0.
And finally, we discussed Stoke’s Theorem, which tells us that the circulation of (OverVector[E]) around any closed loop is equal to the surface integral of ∇×(OverVector[E])·d(OverVector[S]).
In today’s exercise, we are going to look at Boundary Conditions using Mathematica.  This means we are going to learn about what happens to the Electric field at the boundary of charged geometries.  Boundary conditions are an important part of E&M.  While we can spend some time looking at E fields in homogeneous media, most real world applications of E&M require us to understand what happens when fields and waves interact with actual materials and charges.

ClearAll[e1,eslab,fe1,W]

Continuity of the Electric Field

All Electric Fields are continuous in space...except when you have a surface charge density.  Let’s think about this knowing what we already know from Gauss’s Law. We know that the Divergence of the electric field gives us charge density.  This is because electric field lines start and stop on positive and negative charges, respectively.  A uniform charge distribution will give a uniform divergence...which means no discontinuity in the electric field.  Let’s look more closely though, at what happens at interfaces.  Let’s start with a slab of charge.  We know the electric field from a slab of charge:

ezslab=Piecewise[{{z*rho/(eps0),Abs[z]<W/2},{Sign[z]*W*rho/(2*eps0),Abs[z]≥W/2}}]

How do we determine continuity of the electric field?  We can take the limits of our Electric Field as we approach a boundary from either side:

Limit[ezslab,z->W/2,Direction->1,Assumptions->W>0](*Here we are approaching the interface in the positive direction, or from the side with z<W/2*)

Limit[ezslab,z->W/2,Direction->-1,Assumptions->W>0](*Here we are approaching the interface in the negative direction, or from the side with z>W/2*)

We can see that the function is continuous at z=W/2, since the value for the z-component of the Electric Field, approaching from both sides, is the same.  Show that this is the case for z=-W/2:

This makes sense.  If we plot the z-component of the electric field, we see that the function is continuous:

fezslab[z_,W_,eps0_,rho_]:=Piecewise[{{z*rho/(eps0),Abs[z]<W/2},{Sign[z]*W*rho/(2*eps0),Abs[z]≥W/2}}]

Plot[fezslab[z,1,8.85*10^-12,2*8.85*10^-12],{z,-1,1}]

But what about a sheet of charge?

ezsheet=Sign[z]*rhos/(2*eps0)

Clearly our sheet of charge is discontinuous at z=0, with a ΔE=(Subscript[ρ, s])/(Subscript[ϵ, o])

fezsheet[rhos_,eps0_,z_]:=((rhos Sign[z])/(2 eps0))

Plot[fezsheet[8.85*10^-12,2*8.85*10^-12,z],{z,-1,1}]

We see that the discontinuity in the electric field across the sheet of charge is equal to sheet charge density divided by the permittivity of free space!!
This is not a coincidence.

Sheet of Charge with an External Field

Let’s see what happens when we add an arbitrary (static) external electric field to the field from our sheet of charge .

e1=-Grad[x^2*y+6*x*z-Cos[z],{x,y,z}]

What is the charge density ρ(x,y,z) that supports the field e1 assuming eps0?

ρ=

Let’s look at the total field graphically

etotal={0,0,ezsheet}+e1

Let’s plot the Vector Field in the xz plane from -1<z<1 first, and then zoom in...

fetotal[rhos_,eps0_]={-2 x y-6 z,-(x^2),-6 x+((rhos Sign[z])/(2 eps0))-Sin[z]}

fextotal=fetotal[2*8.85*10^-12,8.85*10^-12][[1]] /. y->0

feztotal=fetotal[2*8.85*10^-12,8.85*10^-12][[3]]/. y->0

VectorPlot[{fextotal,feztotal},{x,-1,1},{z,-1,1}]

It’s hard to tell what’s going on at z=0, so let’s zoom in:

VectorPlot[{fextotal,feztotal},{x,-.01,.01},{z,-.01,.01},VectorScale->Small]

What you see here is important!!  At z=0, where we have our sheet of charge, there is a discontinuity in the NORMAL component of the electric field, but there is no change in the Tangential component!!
We can write this mathematically as:

(OverHat[n])·((SubPlus[(OverVector[D])])-(SubMinus[(OverVector[D])]))=(Subscript[ρ, s])  and (OverHat[n])×((SubPlus[(OverVector[D])])-(SubMinus[(OverVector[D])]))=0

Where (OverHat[n])  is the surface normal from the charged surface, (Subscript[ρ, s]) is a surface charge density, and (SubPlus[(OverVector[D])]) and (SubMinus[(OverVector[D])]) are the displacement fields above and below the charged surface, respectively.

Boundary Conditions

For the remainder of the exercise, let’s make things a little more complicated.  

Create an expression that gives the electric field for a spherical shell of radius r0=1, centered at the origin, with a charge of Q=-4(Subscript[ϵ, o]) spread uniformly over the surface of the shell.

The field is zero inside the shell (you can argue this by integral form Gauss’ law appled to a spherical “pillbox” with a radius r smaller than r0) and the field is the radial Coulomb field of a point charge Q=-4(Subscript[ϵ, o])sitting at the origin for r>r0 (again the justification can be provided by Gauss’ law).
  
Plot the cross-section of the vector field on the xz plane.  Show that the boundary conditions for electric field that we derived above for a infinite plane of surface charge hold for a spherical shell.  If you want to get crazy, try doing it with two shells of opposite charge, with the second shell at x=3.