Wolfram Language™

Find the Charge Distribution on a Sphere

Find the positions that minimize the Coulomb potential for equally charged particles free to move on a sphere. This is the equilibrium charge distribution.

Denote by n the number of particles.

In:= `n = 50;`

Let be the Cartesian coordinates of the  particle.

In:= `vars = Join[Array[x, n], Array[y, n], Array[z, n]];`

The goal is to minimize the Coulomb potential.

In:= ```potential = Sum[((x[i] - x[j])^2 + (y[i] - y[j])^2 + (z[i] - z[j])^2)^-(1/ 2), {i, 1, n - 1}, {j, i + 1, n}];```

Since the particles are on a sphere, their coordinates must satisfy unit-magnitude constraints.

In:= `sphereconstr = Table[x[i]^2 + y[i]^2 + z[i]^2 == 1, {i, 1, n}];`

Choose initial points on the sphere at random using spherical coordinates.

In:= ```rpts = ConstantArray[1, n]; thetapts = RandomReal[{0, Pi}, n]; phipts = RandomReal[{-Pi, Pi}, n]; spherpts = Transpose[{rpts, thetapts, phipts}];```

Transform the initial points to Cartesian coordinates.

In:= `cartpts = CoordinateTransform["Spherical" -> "Cartesian", spherpts];`

Rearrange the initial points to match the variables' ordering.

In:= `initpts = Flatten[Transpose[cartpts]];`

Minimize the Coulomb potential subject to the sphere constraint.

In:= `sol = FindMinimum[{potential, sphereconstr}, Thread[{vars, initpts}]];`

Extract from the solution the equilibrium positions of the particles.

In:= `solpts = Table[{x[i], y[i], z[i]}, {i, 1, n}] /. sol[];`

Plot the result.

In:= ```Show[ListPointPlot3D[solpts, PlotRange -> {{-1.1, 1.1}, {-1.1, 1.1}, {-1.1, 1.1}}, PlotStyle -> {{PointSize[.03], Blue}}, AspectRatio -> 1, BoxRatios -> 1, PlotLabel -> "Particle Distribution"], Graphics3D[{Opacity[.5], Sphere[]}]]```
Out= 