Trouvez la distribution de charge sur une sphère
Trouvez les positions qui minimisent le potentiel de Coulomb pour que des particules de même charge puissent se déplacer librement sur une sphère. Voici la répartition des charges à l'équilibre.
Appelez n le nombre de particules.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_52.png)
n = 50;
Soit , les coordonnées cartésiennes de la
ème particule.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_53.png)
vars = Join[Array[x, n], Array[y, n], Array[z, n]];
L'objectif est de minimiser le potentiel de Coulomb.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_54.png)
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}];
Les particules se trouvant sur une sphère, leurs coordonnées doivent satisfaire à des contraintes de magnitude unitaire.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_55.png)
sphereconstr = Table[x[i]^2 + y[i]^2 + z[i]^2 == 1, {i, 1, n}];
Choisissez des points initiaux sur la sphère à l'aide de coordonnées sphériques aléatoires.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_56.png)
rpts = ConstantArray[1, n];
thetapts = RandomReal[{0, Pi}, n];
phipts = RandomReal[{-Pi, Pi}, n];
spherpts = Transpose[{rpts, thetapts, phipts}];
Transformez les points initiaux en coordonnées cartésiennes.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_57.png)
cartpts = CoordinateTransform["Spherical" -> "Cartesian", spherpts];
Réorganisez les points initiaux pour correspondre à la commande de variables.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_58.png)
initpts = Flatten[Transpose[cartpts]];
Minimisez le potentiel de Coulomb soumis à la contrainte de la sphère.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_59.png)
sol = FindMinimum[{potential, sphereconstr}, Thread[{vars, initpts}]];
Extrayez les positions d'équilibre des particules de la solution.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_60.png)
solpts = Table[{x[i], y[i], z[i]}, {i, 1, n}] /. sol[[2]];
Tracez le résultat.
![Click for copyable input](assets.fr/find-the-charge-distribution-on-a-sphere/In_61.png)
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[]}]]
![](assets.fr/find-the-charge-distribution-on-a-sphere/O_37.png)