There are several non-overlapping spheres in 3D. How to find a cuboid Cuboid[{a,b,c}] containing these spheres with minimal a+b+c? Here are my trials with two and three concrete spheres.
(i) The spheres Sphere[{x,y,z},13] ang Sphere[{r,s,t},12] are done. Here is my code
res2 = NMinimize[{a + b + c, x + 13 <= c && x - 13 >= 0 && y + 13 <= c && y - 13 >= 0 && z + 13 <= c && z - 13 >= 0 && r + 12 <= c && r - 12 >= 0 && s + 12 <= c && s - 12 >= 0 && t + 12 <= c && t - 12 >= 0 && (x - r)^2 + (y - s)^2 + (z - t)^2 >= (13 + 12)^2 && a >= b && b >= c}, {a, b, c, x, y, z, r, s, t}, WorkingPrecision -> 20, MaxIterations -> 400]
118.30134496888302115, {a -> 39.433781777141207591, b -> 39.433781662216129186, c -> 39.433781529525684370, x -> 26.433781527577711100, y -> 26.433781527543169115, z -> 26.433781527524494303, r -> 12.000024797809696713, s -> 12.000024797806752675, t -> 12.000024797806996020}}
The verification is as follows.
x + 13 <= a && x - 13 >= 0 && y + 13 <= b && y - 13 >= 0 && z + 13 <= c && z - 13 >= 0 && r + 12 <= a && r - 12 >= 0 && s + 12 <= b && s - 12 >= 0 && t + 12 <= c && t - 12 >= 0 && a >= b && b >= c && (x - r)^2 + (y - s)^2 + (z - t)^2 >= (13 + 12)^2 /. res[[2]]
True
However, the above solution is not optimal Cuboid[{50,26,26}]. How to find the optimal solution with Mathematica?
(ii) The spheres Sphere[{x,y,z},13] ang Sphere[{r,s,t},12] and Sphere[{k,n,h},9/2] are done. The same question for
res3 = NMinimize[{a + b + c, x + 13 <= c && x - 13 >= 0 && y + 13 <= c && y - 13 >= 0 && z + 13 <= c && z - 13 >= 0 && r + 12 <= c && r - 12 >= 0 && s + 12 <= c && s - 12 >= 0 && t + 12 <= c && t - 12 >= 0 && (x - r)^2 + (y - s)^2 + (z - t)^2 >= (13 + 12)^2 && k - 9/2 >= 0 && k + 9/2 <= c && h - 9/2 >= 0 && h + 9/2 <= c && n - 9/2 >= 0 && n + 9/2 <= c && (x - k)^2 + (y - n)^2 + (z - h)^2 >= (13 + 9/2)^2 && (r - k)^2 + (s - n)^2 + (t - h)^2 >= (12 + 9/2)^2 && a >= b && b >= c}, {a, b, c, x, y, z, r, s, t, k, n, h}, WorkingPrecision -> 20, MaxIterations -> 400]
{118.30129311042972531, {a -> 39.433764379149049236, b -> 39.433764371039300303, c -> 39.433764360241375774, x -> 26.433763996833655112, y -> 13.000010247112034705, z -> 13.000010247112188711, r -> 12.000000035837539518, s -> 27.433764329963458967, t -> 27.433764358870261060, k -> 9.1229513952118878652, n -> 10.988012916666727197, h -> 15.679144217401481948}}
I may present two references
Stoyan,Y.G.,Scheithauer,G.& Yaskov,G.N.Packing Unequal Spheres into Various Containers.Cybern Syst Anal 52,419-426 (2016). https://doi.org/10.1007/s10559-016-9842-1
Labib Yousef,Contribution à la résolution des problèmes de placement en trois dimensions,Doctorate University de Picardie Jules Verne (France),2017,172 pages.Downloadable from:https://www.theses.fr/2017AMIE0020.pdf
Unfortunately, the linked article is not accessible to me and I don't read French.
Edit. x+13<=c instead of x+13<=a in res2. Sorry for the typo.


