Several Examples of Multipole Fields

Dipole and quadrupole fields

Dipole field

Clear["`*"]

ϵ := 10^(-6)

Needs["Graphics`PlotField`"]

Vd =  
      Normal[Series[
          1/Sqrt[x^2 + (z - a/2)^2]  -  
            1/Sqrt[x^2 + (z + a/2)^2], {a, 0, 1}]]

cd  =  
      ContourPlot[
        Vd /.  a ->  1, {x, -2, 2 + ϵ}, {z, -2, 
          2}, 
PlotPoints -> 100, 
        ColorFunction -> Hue, 
        DisplayFunction -> Identity]

ce  =  
      PlotGradientField[-Vd /.  a ->  1, {x, -2, 
          2 + ϵ}, {z, -2, 
          2}, 
ScaleFunction ->  (1 &),  
        DisplayFunction ->  Identity]

Show[{cd, ce}, DisplayFunction ->  $DisplayFunction]

Quadrupole Field

Clear["`*"]

ϵ  :=  1/100000

Needs["Graphics`PlotField`"]

A quadrupole is made up of two equal and opposite dipoles aligned along the z axis

Vq  =  
      Normal[Series[
          1/Sqrt[x^2 + (z - a/2)^2]  +  
            1/Sqrt[x^2 + (z + a/2)^2]
 - 
            2/Sqrt[x^2 + z^2] , {a, 0, 2}]]

cq  =  
      ContourPlot[
        Vq /.  a ->  1, {x, -2, 2 + ϵ}, {z, -2, 
          2}, 
PlotPoints -> 100, 
        ColorFunction -> Hue, 
        DisplayFunction -> Identity]

cf  =  
      PlotGradientField[-Vq /.  a ->  1, {x, -2, 
          2 + ϵ}, {z, -2, 
          2}, 
ScaleFunction ->  (1 &),  
        DisplayFunction ->  Identity]

Show[{cq, cf}, DisplayFunction ->  $DisplayFunction]

Alternate Quadrupole Field

Clear["`*"]

ϵ :=  1/1000000

Needs["Graphics`PlotField`"]

A quadrupole is made up of two positive charges at (x,z) = (a/2,a/2), (-a/2,-a/2) and two negative charges at (a/2,-a/2), (-a/2,1/2).

Va  =  
      Normal[Series[
          1/Sqrt[(x - a/2)^2 + y^2 + (z - a/2)^2] + 
            1/Sqrt[(x + a/2)^2 + y^2 + (z + a/2)^2]  - 
            1/Sqrt[(x + a/2)^2 + y^2 + (z - a/2)^2] - 
            1/Sqrt[(x - a/2)^2 + y^2 + (z + a/2)^2], {a, 0, 
            2}]]

ca  =  
      ContourPlot[
        Va /. {y ->  0,  a ->  1}, {x, -2, 
          2 + ϵ}, {z, -2, 
          2}, 
PlotPoints -> 100, 
        ColorFunction -> Hue, 
        DisplayFunction ->  Identity]

cb  =  
      PlotGradientField[-Va /. {y ->  1,  
            a ->  1}, {x, -2, 2 + ϵ}, {z, -2, 
          2}, 
ScaleFunction ->  (1 &),  
        DisplayFunction ->  Identity]

Show[{ca, cb}, DisplayFunction ->  $DisplayFunction]

Vaa  =  
      Simplify[Va /.  {x ->   r Sin[θ] Cos[ϕ], 
            y  ->  r Sin[θ] Sin[ϕ], 
            z ->  r Cos[θ]}]

Vaa  =  Vaa /.  {a -> 1,  r ->  1}

<< Graphics`

Plot the strength of the potential at r=1 as a function of angle!

SphericalPlot3D[Vp, {θ, 0, π}, {ϕ, 0, 2 π}, 
      AxesLabel ->  {"x", "y", "z"}]