# Packing of smaller spheres onto a bigger one

I want to estimate the maximum number of smaller spheres (of known constant radius, r) that can closely pack around a bigger sphere (of radius R, providing R >= r). It would be much appreciated if someone shows me how to get the number (and a 3D plot) for few different radii to generalize (i.e. for both r and R values).

• This is not really a problem with Mathematica, but rather a math/geometry problem first. When you come up with a solution to the underlying problem, we can then help you implement it in Mathematica. See for instance: mathworld.wolfram.com/SphericalCode.html Dec 6, 2015 at 18:38
• Isn't it simply the ratio $\frac{4\pi R^2}{\pi r^2}$ Dec 6, 2015 at 18:40
• Hi Hubble07, Thanks for your quick response! However, I don't think this is that simple problem: My question is related to close-packing of spheres without overlapping. Please, check your equation, assuming r = R (for equal radii, the simplest case!), which would give 4 spheres around one (and that is not true; and rather it should accommodate 12 number of spheres in a close pack). At the same time, the general expression, i.e. if r<R, would be a great help for me. Dec 6, 2015 at 19:03
• @Hubble07 Your answer is simply incorrect. It would be correct only in the case that each sphere was infinitely deformable (i.e., equivalent to fluid volume) where you pour the volume of $n$ smaller spheres into the volume of the larger sphere. The proven answer are here: en.wikipedia.org/wiki/Sphere_packing_in_a_sphere. Dec 6, 2015 at 21:40
• note the question regards packing around a sphere, not inside. Dec 7, 2015 at 18:40

Your question seems similar to the problem of equispaced points on a sphere. The following code enables an estimate of radius r of n small surrounding spheres, assuming the equispaced points are the tangent points of the small spheres.

A number n of random initial points on a sphere of radius r, which is big R in your question.

InitialPoints[n_Integer, r_] :=
Map[r {Sin[#[[1]]] Cos[#[[2]]], Sin[#[[1]]] Sin[#[[2]]], Cos[#[[1]]]} &,
Map[{ArcCos[2.*#[[1]] - 1.], 2.0*Pi*#[[2]]} &, RandomReal[{0.,1.}, {n, 2}]]]


A perturbation of a point's position due to replusive "forces" from all other points.

PerturbPoint[p1_, p_List, r_, e_: 0.01] :=
(r*#/Norm[#])&[
p1 + e*Total[Map[If[p1 == #, 0, (p1 - #)/Norm[p1 - #]^3]&, p]]]


Perturb all points.

PerturbPoints[p_List, r_, e_: 0.01] := Map[PerturbPoint[#, p, r, e] &, p]


Find the final positions of all points.

PointRelax[p_List, r_, e_] := FixedPoint[PerturbPoints[#, r, e] &, p, 100000]


For example, the following approximate solution took about a minute for n=20 spheres.

AbsoluteTiming[p20 = PointRelax[InitialPoints[20, 1], 1, 0.01]]


Using this Manipulate suggests r=0.7 is approximately correct for n=20.

Manipulate[
Graphics3D[{
{Cyan, Opacity[0.6], Sphere[{0, 0, 0}, 1]},
{Darker[Red], Map[Sphere[#, r] &, (1 + r)*p20]}},
Boxed -> False, Background -> Black, SphericalRegion -> True],
{{r, 0.3}, 0.05, 1.5, Appearance -> "Labeled"}]


Another run showed that for n=10, the radius is approximately r=1.3.

• Many thanks, Kenny Colnago! This is perfect to visualize the densest close-pack for the given number of spheres (onto another sphere) as a function of their radii. However, as a beginner, I could not use your approximation to estimate the number of spheres (of given/smaller radius, r) that are required to form a close-pack (onto the given/bigger radius R, providing R> r). Any help to estimate (and demonstrate) the number of spheres (1 or 2 different radii, for e.g.) to form a close-pack (onto a bigger sphere of fixed R) would be great help for me. Thanks! Dec 7, 2015 at 2:03
• I have no analytic solution to your problem, but was suggesting that you run the code for many values of n, and use the manipulate to find an approximate r for each n. Then plot values of n on the vertical axis and r on the horizontal axis. Fit a line or function to give an empirical function which returns n, given r. Dec 8, 2015 at 0:52

@Hubble07 has been criticized for the estimate in the comment. However, I do believe it provides a valuable analytic insight that can be improved a little bit to provide the bounds.

The area of the $$R$$-sphere covered with one layer of $$r$$-spheres reads $$A=4\pi(R+r)^2.$$

The area per small sphere is within the areas of hexagon and triangle in which it is inscribed, i.e., $$2\sqrt{3}r^2 The ratio of them yields an estimate $$n_<=\frac{4\pi(R+r)^2}{2\sqrt{3}r^2}$$

For the case $$R=r$$ we have

 N[16 π/(2Sqrt[3])]
(*14.5104*)
N[16π/(3 Sqrt[3])]
(*9.6736*)


That is $$9.6736 as expected. I believe this is all what can be done analytically. Interestingly, the average of the two bounds is very close to the exact value 12.