Homework  Assignment I, Phy711. Due Sept. 18

(1)  Consider the following scalar  function ϕ(x,y,z) = - x (y^2)+ 3 y + x y z

(a) Find its gradient

The gradient is given by the vector field

(OverVector[A])(x,y,z) = (-(y^2)+ y z) (OverHat[i])  +  (-2 x y +3 + xz)(OverHat[ j ])  + x y (OverHat[k])

(b) Find the divergence of that gradient

∇·(OverVector[A]) = -2 x 

(c) Give a contour plot of ϕ in the xy plane. Plot the gradient vector field in the xy plane.

ϕ[x_,y_]= x y^2 +3y
grad[x_,y_,z_]={-(y^2),-2 x y +3, x y}

(* the projection of this vector field onto the xy plane (i.e. we ignore the k component ) is *)
gradprojection[x_,y_]={-(y^2),-2 x y}

g1=ContourPlot[ϕ[x,y],{x,-10,10},{y,-6,6},ContourShading->Off,Contours->30]
g2=VectorPlot[gradprojection[x,y],{x,-10,10},{y,-6,6},VectorPoints->10,VectorStyle->Red]

(2)  Consider the volume enclosed by a box of length L whose center is located at the origin
x=0,y=0,z=0.  

(a) Evaluate the following volume integral

(∫_V)  (∇^2)ϕ  dV

where V represents the volume enclosed by the box.

Since (∇^2)ϕ= -2 x
we need to evaluate

∫ dx∫dy∫dz  (-2 x) = (∫_(-L/2)^(L/2))2xdx (∫_(-L/2)^(L/2))dy (∫_(-L/2)^(L/2))dz = 0


(b) Evaluate (explicitly) the surface integral 

(∫_S)  ∇ϕ · (OverHat[n ])dS

where S is the surface enclosing V.  Use the divergence theorem to justify the fact that the result
for parts (a) and (b) are the same.

We need to evaluate the integral on all six surfaces that enclose this volume. The first surface
is a z=L/2 and  (OverHat[n ])= (OverHat[k]) so (OverVector[A])(x,y,L/2).(OverHat[k]) = x y  and

(∫_(-L/2)^(L/2))2xdx (∫_(-L/2)^(L/2))y dy =0 
like wise for the surface at z=-L/2 the surface integral will also be this null value.

Consider now the surface at x=L/2 with  (OverHat[n ])=(OverHat[ i ]) we get (OverVector[A])(L/2,y,z).(OverHat[ i ])= (-(y^2)+ y z)

(∫_(-L/2)^(L/2))dz (∫_(-L/2)^(L/2))dy (-(y^2)+ y z) = -((L^4)/12)

now for the surface at x=-L/2  (OverHat[n ])=(OverHat[ -i ]) we get (OverVector[A])(L/2,y,z).(OverHat[ i ])= -(-(y^2)+ y z)

so when we integrate over this surface we get ((L^4)/12) which cancels the above value

Finally we consider the surface at y=L/2   (OverHat[n ])= (OverHat[j])  we get (OverVector[A])(x,L/2,z). (OverHat[j]) = (-2 x L/2 +3 + x z) 
(∫_(-L/2)^(L/2))dz (∫_(-L/2)^(L/2))dx  (-2 x L/2 +3 + x z) =3 (L^2)/4
for the opposite surface  (OverHat[n ])= - (OverHat[j])  we get   (OverVector[A])(x,L/2,z). (OverHat[n ])   = (2 x L/2 -3 - x z) 
and the surface integral becomes  -3 (L^2)/4.

Therefore the total surface integral vanishes, and is in harmony with the results obtained using the divergence theorem.

(3) In a hydrogen atom the electron is, on the average, one Bohr radius from the location of the proton.

(a) What is the magnitude of the Coulomb force between the electron and proton?

F =k q^2/r^2  /. {k->8.9876 10^9 N m^2/C^2,q->1.602 10^(-19)C,r->5.2918 10^(-11) m }

(b) What is the magnitude of the electric field, due to the proton, at the electron.

Efield=F/q /. q->1.602 10^(-19)C

(* or in units of Volts/m *)

(c) What is the magnitude of the electric potential, due to the proton, at the electron.

V= k q/r /. {k->8.9876 10^9 N m^2/C^2,q->1.602 10^(-19)C,r->5.2918 10^(-11) m }

(* or Volts *)

Give your numerical answers in standard (SI) units. In atomic units the unit of length
is given by the Bohr radius and energy can be expressed in terms of electron
volts. There is no named atomic unit for force, so lets define one and call it the QNewton. Express the answer of (a) in QNewtons.

Since the units of force are the same as Work (potential energy)/distance, we could define the atomic
unit of force as the potential energy of the electron in a hydrogen atom (13.6 eV=1/2 atomic unit of energy (the Hartree) ) divided by the Bohr radius ( 1 unit of atomic unit distance ) thus an atomic unit of force QNewton could have the value

1 QNewton= 1/2 4.3597 10^(-18) J/5.2918 10^(-11) m = 4.12 (10^(-8)) J/m or  4.12 (10^(-8)) N

(4)  The potential of a point charge q located on the origin of a coordinate system x,y,z is

ϕ(x,y,z) =  k q / (Sqrt[((x^2)+ (y^2) + (z^2)]))

where k is a constant.

(a) Find the value of the potential at point, in the x, y plane,  given by  

(OverVector[r]) = a ( Cosθ  (OverHat[i])  + Sinθ (OverHat[ j])  )?

Find the electric field at that point.

ϕ(x,y,z) =  k q / (Sqrt[(a^2 Cosθ ^2+a^2 Sinθ ^2)]) =  (kq/a)

E = -k q  (x (OverHat[i ])+ y (OverHat[j ])+ z (OverHat[k]))/(((x^2 + y^2 + z^2))^(3/2)) = -k q ( Cosθ  (OverHat[i])  +  Sinθ (OverHat[ j])  )/(a^2)

(b) Suppose now that the charge is located at (OverVector[r]), what is the potential at the point (x,y) ?,
what is the electric field at that point  ?

ϕ(x,y,z) =  k q / (Sqrt[(((x-aCosθ))^2)+ (((y-aSinθ))^2) + (z^2)])
ϕ(x,y,0) =  k q / (Sqrt[(((x-aCosθ))^2)+ (((y-aSinθ))^2) ])

E = -k q  ((x -aCosθ)  (OverHat[i ])+ (y-aSinθ)  (OverHat[j ])+ z (OverHat[k]))/((((((x-aCosθ))^2)+ (((y-aSinθ))^2) + (z^2)))^(3/2)) 

E(x,y,0) = -k q  ((x -aCosθ)  (OverHat[i ])+ (y-aSinθ)  (OverHat[j ]))/((((((x-aCosθ))^2)+ (((y-aSinθ))^2)))^(3/2)) 


(c) Consider two equal charges, one given by (OverVector[r]) where θ=0, and the other where θ=π. Find the electric
field at the origin.
E(x,y) = (Subscript[E, 1])(x,y)+ (Subscript[E, 2])(x,y)
(Subscript[E, 1])(x,y) = -k q  ((x -a)  (OverHat[i ])+ y  (OverHat[j ]))/((((((x-a))^2)+ (y^2) ))^(3/2))
(Subscript[E, 2])(x,y) = -k q  ((x +a)  (OverHat[i ])+ y (OverHat[j ]))/((((((x+a))^2)+ (y^2)))^(3/2))
E(0,0) =  -k q  (-a)  (OverHat[i ])/((((a^2) ))^(3/2)) + -k q  a  (OverHat[i ])/((((a^2)))^(3/2)) = 0

(5)  Consider a ring of six charges, all of equal magnitude |q|=1,  but alternating signs. i.e. the first
is a positive the second a negative and so on. The charges are all equidistant from the origin and
are located at

(OverVector[(Subscript[r, i])]) = a ( Cos(Subscript[θ, i])  (OverHat[i])  + Sin(Subscript[θ , i])(OverHat[ j])  )

where (Subscript[θ, i]) = i π/3    i=1,2,.. 6

(a) Use Mathematica to give a contour plot of  the potential ϕ(x,y,0).  You may use a,q=1. Make sure your plot has a sufficient number of contours

(b) Plot the electric field in the x,y plane.  Superimpose the vector plot on the contour plot in order to demonstrate that the latter is always perpendicular to the potential contours.

(6) In the problem above a box encloses the configuration of charges, what is the value
of  (∫_S)  ∇ϕ · (OverHat[n ])dS ?

phi[x_,y_,θ_,q_]= k q/(Sqrt[(x-a Cos[θ])^2 + (y-a Sin[θ])^2])    /. {a->1,k->1}

totalphi[x_,y_]=phi[x,y,Pi/3,1]+phi[x,y,2Pi/3,-1]+phi[x,y,3Pi/3,1]+phi[x,y,4Pi/3,-1]+phi[x,y,5Pi/3,1]+phi[x,y,6Pi/3,-1]

g1=ContourPlot[totalphi[x,y],{x,-3,3},{y,-3,3},ContourShading->Off,Contours->20]

electricfield[x_,y_]={-D[totalphi[x,y],x],-D[totalphi[x,y],y]}

g2=StreamPlot[electricfield[x,y],{x,-3,3},{y,-3,3},PlotRange->{{-3,3},{-3,3}},StreamStyle->Red]

Show[g1,g2]