0

I placed 250 evenly spaced identical positive charges Q=0.01 each (ignoring coulombs constant) around a hollow unit circle in mathematica and calculated the electric vector field:

m = CirclePoints[250];
f[p_] := 0.01*((x-p[[1]])/(((x-p[[1]])^2+(y-p[[2]])^2)^(3/2)));
g[p_] := 0.01*((y-p[[2]])/(((x-p[[1]])^2+(y-p[[2]])^2)^(3/2)));
VectorPlot[{Total[Map[f, m]], Total[Map[g, m]]} , {x, -2, 2}, {y, -2,2}, VectorColorFunction -> (ColorData["Rainbow"][#5]&) , PlotLegends -> BarLegend["Rainbow"], VectorColorFunctionScaling -> False, VectorRange -> All, VectorPoints -> 100]

enter image description here

There is clearly still a field inside the circle, what am I missing?

1 Answers1

0

By using inverse square with 3D as suggested, we get the following:

$$\sum_{p\in P} \left<\frac{x-p_x} {\sqrt{(x-p_x)^2 + (y-p_y)^2 + (z-p_z)^2} ^3} , \frac{y-p_y} {\sqrt{(x-p_x)^2 + (y-p_y)^2 + (z-p_z)^2} ^3}, \frac{z-p_z} {\sqrt{(x-p_x)^2 + (y-p_y)^2 + (z-p_z)^2}^3}\right>$$

m = SpherePoints[250];
f[p_] := 0.01*((x-p[[1]])/(((x-p[[1]])^2+(y-p[[2]])^2 + (z-p[[3]])^2)^(3/2)));
g[p_] := 0.01*((y-p[[2]])/(((x-p[[1]])^2+(y-p[[2]])^2 + (z-p[[3]])^2)^(3/2)));
h[p_] := 0.01*((z-p[[3]])/(((x-p[[1]])^2+(y-p[[2]])^2 + (z-p[[3]])^2)^(3/2)));
SliceVectorPlot3D[{Total[Map[f, m]], Total[Map[g, m]], Total[Map[h, m]]}, "CenterPlanes", {x, -2, 2}, {y, -2,2}, {z, - 2,2}, VectorColorFunction -> (ColorData["Rainbow"][#7]&) , PlotLegends -> BarLegend["Rainbow"], VectorColorFunctionScaling -> False, VectorRange -> All, VectorPoints -> 25, ImageSize -> {500,500}]

enter image description here

With 2D it requires reverse linear to get the expected result of no field inside the circle:

$$\sum_{p\in P} \left<\frac{x-p_x} {(x-p_x)^2 + (y-p_y)^2} , \frac{y-p_y} {(x-p_x)^2 + (y-p_y)^2}\right>$$

m = CirclePoints [125];
f[p_] := 0.01*((x-p[[1]])/(((x-p[[1]])^2+(y-p[[2]])^2)^(2/2)));
g[p_] := 0.01*((y-p[[2]])/(((x-p[[1]])^2+(y-p[[2]])^2)^(2/2)));
VectorPlot[{Total[Map[f, m]], Total[Map[g, m]]} , {x, -2, 2}, {y, -2,2}, VectorColorFunction -> (ColorData["Rainbow"][#5]&) , PlotLegends -> BarLegend["Rainbow"], VectorColorFunctionScaling -> False, VectorRange -> All, VectorPoints -> 50, ImageSize -> {500,500}]

enter image description here

Red in these plots means anything over 1. The first equation looks like inverse cube but it's actually inverse square because you need to normalise the vector first, which involves another division by r.

  • What conclusion do you draw from these data? – Andrew Sep 27 '22 at 11:38
  • @Andrew it's what I was expecting to see, no field inside the sphere and field of 1/r^2 outside of the sphere, and for the 2D case you have to use inverse linear and not inverse square in order to see no field inside the circle, which makes sense mathematically but I'd only ever seen 1/r^2 in 2d physics diagrams so it confused me – Lewis Kelsey Sep 27 '22 at 12:10
  • 1
    Great, I also agree. You may want to add this interpretation to your answer, though, to make it a more complete thought and potentially help future visitors to this question learn from it. – Andrew Sep 27 '22 at 15:49
  • @Andrew on closer inspection unlike the 2D example, the field in the sphere isn't zero. It's a field of small magnitude that points inwards, and this can be increased to a non-trivial amount by increasing the number of charges on the sphere – I can't seem to get exactly zero like I can with the 2D equation – Lewis Kelsey Oct 10 '22 at 12:15
  • Hm, the field inside (and outside) a spherical shell with uniform charge density is a problem that can be solved exactly with analytical methods, and the answer is that the field is exactly zero inside the shell. Therefore I would guess the residual field you are finding is an artifact of the approximations you are making by using a set of discrete charges. Maybe it matters how you are arranging the charges on the sphere, for example. In particular, as you increase the number of charges, you need to use a strategy that approaches a uniform charge density. – Andrew Oct 10 '22 at 13:06
  • @Andrew it does seem like it's because the points aren't uniformly spaced unlike on the circle because you can only get 20 points uniformly spaced (the maximum platonic solid). I'm not sure how to better approximate it with discrete charges. There must be some way to make the charges uniform to give uniform charge density given that's the physical reality that they are – Lewis Kelsey Oct 10 '22 at 23:21
  • I haven't thought about it very much, but I could imagine that finding a sequence of $N$ points on a sphere where as you increase $N$ the overall distribution of points is uniformly distributed, is a trickier problem than it sounds like. And your numerical results suggest to me that whatever Mathematica is doing is not necessarily a good choice. I think what you want to do is something like convert your grid into a tesselation on the sphere (something like https://en.wikipedia.org/wiki/Voronoi_diagram) and see if the area of each cell is approximately uniform. – Andrew Oct 11 '22 at 00:29
  • Potentially of interest as a way to tesselate the sphere: https://en.wikipedia.org/wiki/HEALPix. In particular, HEALPix has the property that "At a given level in the hierarchy the pixels are of equal area" – Andrew Oct 11 '22 at 00:30
  • @Andrew Using Mathematica's SpherePoints, the centre region indeed tends to zero if you have as many charges as electrons in a real metal sphere and as charge also approaches the charge of an electron, but it's still not exactly zero in that model, but it is tens of orders of magnitude less than the external field – perhaps the electrons themselves follow a better model like you said and definitely cancel this out or the field is never exactly zero but is to all intents and purposes and reaches a stable minimum – Lewis Kelsey Oct 11 '22 at 06:36
  • I think this is known as the Thomson problem. I used a fibonacci sphere method and it yielded 36x smaller magnitudes inside the sphere. I may ask a separate question probably on math overflow phrased in terms of zero field rather than minimal potential to see the lowest magnitude inside the sphere people can achieve in a discrete approximation in a tractable time – Lewis Kelsey Oct 11 '22 at 08:04