(* Xe atom Kimball, Ne,Ar,Ni,Kr,Pd-centers, 4 5sp-spheres tetrahedral 26.12.2011 *)
Clear[k1,k2,k3,k4,k5,k6,k7,sig1,sig2,sig3,sig4,sig5,sig6,sig7,c,z,R1,R2,R3,R4,R5,R6,R7,S2,S3,S4,S5,S6,S7];
c = {k1 -> 1.0, k2 -> 1.0, k3 -> 1.0, k4 -> 1.0, k5 -> 1.0, k6 -> 1.0, k7 -> 1.0,sig1 -> 0.3, sig2 -> 0.3, sig3 -> 0.3, sig4 -> 0.3, sig5 -> 0.3, sig6 -> 0.3, sig7 -> 0.3}; z=54.;

(* He+Ne shell *)
T = 2.25*k1/R1^2+9.*k2/R2^2 /. c;
ad = Sqrt[3./8.]; 
Vee=3.0*sig1/R1+12.*sig2/R2+16/(R1+R2)+24*ad/(R1+R2) /. c;
Vne=-3.0*z/R1-8.*z/(R1+R2);
S2 = R2*4^(1/3);

(* Ar shell *)
T = T + 9.*k3/R3^2 /. c;
Vee = Vee+12.*sig3/R3+80./(S2+R3)+24.*ad/(S2+R3) /. c;
Vne = Vne-8.0*z/(S2+R3);
S3 = R3*4^(1/3);

(* Ni shell octahedron, d10 with 10/6 charges; 15*(10/6)^2 = 41.66667*)
T = T + (10.*9./8)*k4/R4^2 /. c;
Vee = Vee+5.*3.*sig4/R4+(180.+41.66666667/Sqrt[2])/(S3+R4) /. c;
Vne = Vne - 10.0*z/(S3+R4);
S4 = R4*6^(1/3);

(* Kr shell *)
T = T + 9.*k5/R5^2 /. c;
Vee = Vee+12.*sig5/R5+224./(S4+R5)+24.*ad/(S4+R5) /. c;
Vne = Vne-8.0*z/(S4+R5);
S5 = R5*4^(1/3);

(* Pd shell octahedron, d10 with 10/6 charges; 15*(10/6)^2 = 41.66667*)
T = T + (10.*9./8)*k6/R6^2 /. c;
Vee = Vee+5.*3.*sig6/R6+(360.+41.66666667/Sqrt[2])/(S5+R6) /. c;
Vne = Vne - 10.0*z/(S5+R6);
S6 = R6*6^(1/3);

(* Xe shell *)
T = T + 9.*k7/R7^2 /. c;
Vee = Vee+12.*sig7/R7+368./(S6+R7)+24.*ad/(S6+R7) /. c;
Vne = Vne-8.0*z/(S6+R7);
S7 = R7*4^(1/3);

func = T + Vee + Vne;

t = FindMinimum[func, {R1,0.0239355}, {R2,0.0685039}, {R3,0.1250502}, {R4,0.2024266},{R5,0.3092867},{R6,0.5409145},{R7,1.3711996},{Method -> Automatic}, {MaxIterations -> 500}]

N[Vne /. c /. t[[2]],10]
N[Vee /. c /. t[[2]],10]
N[-(Vee+Vne)/T /. c /. t[[2]],10]
N[(S2) /. c /. t[[2]],10]
N[(S3) /. c /. t[[2]],10]
N[(S4) /. c /. t[[2]],10]
N[(S5) /. c /. t[[2]],10]
N[(S6) /. c /. t[[2]],10]
N[(S7) /. c /. t[[2]],10]