(* Fe+++ ion  + 6 F- in Oh 31.01.12 *)
Clear[k1,k2,k3,k4,k5,k6,sig1,sig2,sig3,sig4,sig5,c,z,R1,R2,R3,R4,R5,S2,S3,S4];
c = {k1 -> 0.98, k2 -> 0.98, k3 -> 0.97, k4 -> 1.05, k5 -> 0.98, k6 -> 2.146,sig1 -> 0.3, 
sig2 -> 0.302, sig3 -> 0.302, sig4 -> 0.302, sig5 -> 0.302}; z=26.; z1=9.0;

(* He+Ne shell *)
T = 2.25*k1/R1^2+9.*k2/R2^2 /. c;
ad = Sqrt[3./8.]; sq2=Sqrt[2];
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.45*z/(S2+R3);
S3 = R3*4^(1/3);

(* Fe+++ shell octahedron, full with 5/6 charge each*)
T = T + (5.*9./8)*k4/R4^2 /. c;
Vee = Vee+(90.+12*(5/6)^2/sq2+1.5*(5/6)^2)/(S3+R4);
Vne = Vne - 6.0*z/(S3+R4);
S4 = R4*6^(1/3);

(* F- He+Ne shell *)
Tf = 2.25*k5/R5^2+9.*k6/R6^2 /. c;
Veef=3.0*sig1/R5+12*sig2/R6+16/(R5+R6)+24*ad/(R5+R6) /. c;
Vnef=-3.0*z1/R5-7.5*z1/(R5+R6) /. c;
S5 = R6*4^(1/3);

T=T+6*Tf;
Vee=Vee+6*Veef;
Vne=Vne+6*Vnef;

(* Fe+++/6 F- *)
Vnn = (6*z*z1 + 12*z1^2/sq2+1.5*z1^2)/(S4+S5);
Vee = Vee+(6*23*10 + 12*10*10/sq2 + 1.5*10*10)/(S4+S5);
Vne = Vne -(6*z*10+6*z1*23+24*z1*10/sq2+3*z1*10)/(S4+S5);

func = T + Vnn + Vne + Vee;

t = FindMinimum[func, {R1,0.05042553}, {R2,0.1582254}, {R3,0.363452}, {R4,0.6711224},
    {R5,0.166514},{R6,1.4630045},{Method -> Automatic}, {MaxIterations -> 500}]
    
N[Vne /. c /. t[[2]],10]
N[Vnn /. c /. t[[2]],10]
N[Vee /. c /. t[[2]],10]
N[-(Vee+Vne+Vnn)/T /. c /. t[[2]],10]
N[(S2+R3) /. c /. t[[2]],10]
N[(S3+R4) /. c /. t[[2]],10]
N[(S4) /. c /. t[[2]],10]
N[0.529177*(S4+S5) /. c /. t[[2]],10]