(* C9H20 molecule after Kimball, parametrized with G2//6-311g(Propane) *)

Clear[k1,k2,k3,s1,s2,s3]; n = 9.;  z = 6.; z2 = z*z;

(* Terms automatic with ChemEdu/Kimball/Alkan.sys *)

p = X;        p2 = p*p;      q = P+Q;      r = P+R;    q2 = q*q;
r2 = r*r;     r2p2 = r2*p2;  r2p = r2*p;   qr = q*r;   qrp = qr*p;
ad = 8./3.;   cd = 19./3.;   dd = 32./3.;  fd = 512./3.;
gd = 64./3.;  hd = 128./3.;  jd = 10./3.;  kd = 20./3.;
md = 76./3.;  sd = 16./3.;   vd = 4./3.;   zd = 2./3.;

T = 2.25*n*k1/P^2+2.25*(n-1.0)*k2/Q^2+4.5*(n+1.0)*k3/R^2;

Vee = 3.0*n*s1/P+3.0*(n-1.0)*s2/Q+6.0*(n+1.0)*s3/R+80/r+32/(2*q)+
      136/Sqrt[vd*qr+4*q2+r2]+64/q+108/Sqrt[dd*q2]+112/Sqrt[dd*q2+r2]+
      56/Sqrt[cd*q2]+24/Sqrt[md*q2]+96/Sqrt[vd*qr+md*q2+r2]+48/Sqrt[17*q2]+
      76/Sqrt[hd*q2]+80/Sqrt[hd*q2+r2]+40/Sqrt[33*q2]+8/Sqrt[dd*qr+hd*q2+r2]+
      52/Sqrt[ad*r2]+80/Sqrt[ad*qr+4*q2+vd*r2]+64/Sqrt[ad*qr+4*q2+4*r2]+
      136/Sqrt[zd*qr+q2+r2]+56/Sqrt[dd*q2+ad*r2]+112/Sqrt[zd*qr+cd*q2+r2]+
      48/Sqrt[ad*qr+md*q2+vd*r2]+48/Sqrt[ad*qr+md*q2+4*r2]+96/Sqrt[zd*qr+17*q2+r2]+
      40/Sqrt[hd*q2+ad*r2]+80/Sqrt[zd*qr+33*q2+r2]+16/Sqrt[dd*qr+hd*q2+ad*r2]+
      16/Sqrt[68*q2]+64/Sqrt[vd*qr+68*q2+r2]+32/Sqrt[163/3*q2]+
      8/Sqrt[kd*qr+md*q2+r2]+8/Sqrt[12*qr+68*q2+r2]+32/Sqrt[ad*qr+68*q2+4*r2]+
      32/Sqrt[ad*qr+68*q2+vd*r2]+64/Sqrt[zd*qr+163/3*q2+r2]+16/Sqrt[8*qr+md*q2+vd*r2]+
      16/Sqrt[40/3*qr+68*q2+vd*r2]+28/Sqrt[ad*q2]+20/Sqrt[24*q2]+8/Sqrt[26/3*qr+33*q2+r2]+
      8/Sqrt[34/3*qr+163/3*q2+r2]+44/Sqrt[96*q2]+48/Sqrt[96*q2+r2]+24/Sqrt[81*q2]+
      8/Sqrt[sd*qr+dd*q2+r2]+8/Sqrt[16*qr+96*q2+r2]+24/Sqrt[96*q2+ad*r2]+
      48/Sqrt[zd*qr+81*q2+r2]+16/Sqrt[sd*qr+dd*q2+ad*r2]+16/Sqrt[16*qr+96*q2+ad*r2]+
      12/Sqrt[200/3*q2]+8/Sqrt[6*qr+17*q2+r2]+8/Sqrt[14*qr+81*q2+r2]+8/Sqrt[132*q2]+
      32/Sqrt[vd*qr+132*q2+r2]+16/Sqrt[113*q2]+8/Sqrt[52/3*qr+132*q2+r2]+
      16/Sqrt[ad*qr+132*q2+4*r2]+16/Sqrt[ad*qr+132*q2+vd*r2]+32/Sqrt[zd*qr+113*q2+r2]+
      16/Sqrt[56/3*qr+132*q2+vd*r2]+8/Sqrt[jd*qr+cd*q2+r2]+8/Sqrt[50/3*qr+113*q2+r2]+
      12/Sqrt[fd*q2]+16/Sqrt[fd*q2+r2]+8/Sqrt[451/3*q2]+8/Sqrt[gd*qr+fd*q2+r2]+
      8/Sqrt[fd*q2+ad*r2]+16/Sqrt[zd*qr+451/3*q2+r2]+16/Sqrt[gd*qr+fd*q2+ad*r2]+
      4/Sqrt[392/3*q2]+8/Sqrt[58/3*qr+451/3*q2+r2]+4/Sqrt[hd*qr+fd*q2+ad*r2];

Vne = -3.0*n*z/P-2.0*(n+1.0)*(3.0-((p-1.0)*(1.0+P/R))^2)/R-40*z/r-40/(r*p)-32*z/(2*q)-
      68*z/Sqrt[vd*qr+4*q2+r2]-
      68/Sqrt[vd*qrp+r2p2+4*q2]-
      32*z/q-
      28*z/Sqrt[dd*q2]-
      56*z/Sqrt[dd*q2+r2]-
      56/Sqrt[r2p2+dd*q2]-
      28*z/Sqrt[cd*q2]-
      24*z/Sqrt[md*q2]-
      48*z/Sqrt[vd*qr+md*q2+r2]-
      48/Sqrt[vd*qrp+r2p2+md*q2]-
      24*z/Sqrt[17*q2]-
      20*z/Sqrt[hd*q2]-
      40*z/Sqrt[hd*q2+r2]-
      40/Sqrt[r2p2+hd*q2]-
      20*z/Sqrt[33*q2]-
      4*z/Sqrt[dd*qr+hd*q2+r2]-
      4/Sqrt[dd*qrp+r2p2+hd*q2]-
      52/Sqrt[zd*r2p+r2p2+r2]-
      80/Sqrt[vd*qr+vd*qrp-zd*r2p+r2p2+4*q2+r2]-
      64/Sqrt[vd*qr+vd*qrp+2*r2p+r2p2+4*q2+r2]-
      56/Sqrt[-2*r2p+r2p2+dd*q2+r2]-
      56/Sqrt[zd*r2p+r2p2+dd*q2+r2]-
      48/Sqrt[vd*qr+vd*qrp-zd*r2p+r2p2+md*q2+r2]-
      48/Sqrt[vd*qr+vd*qrp+2*r2p+r2p2+md*q2+r2]-
      40/Sqrt[-2*r2p+r2p2+hd*q2+r2]-
      40/Sqrt[zd*r2p+r2p2+hd*q2+r2]-
      8/Sqrt[dd*qrp+zd*r2p+r2p2+hd*q2+r2]-
      68/Sqrt[zd*qrp+r2p2+q2]-
      56/Sqrt[zd*qrp+r2p2+cd*q2]-
      48/Sqrt[zd*qrp+r2p2+17*q2]-
      40/Sqrt[zd*qrp+r2p2+33*q2]-
      8/Sqrt[dd*qr+zd*r2p+r2p2+hd*q2+r2]-
      16*z/Sqrt[68*q2]-
      32*z/Sqrt[vd*qr+68*q2+r2]-
      32/Sqrt[vd*qrp+r2p2+68*q2]-
      16*z/Sqrt[163/3*q2]-
      4*z/Sqrt[kd*qr+md*q2+r2]-
      4/Sqrt[kd*qrp+r2p2+md*q2]-
      4*z/Sqrt[12*qr+68*q2+r2]-
      4/Sqrt[12*qrp+r2p2+68*q2]-
      32/Sqrt[vd*qr+vd*qrp+2*r2p+r2p2+68*q2+r2]-
      32/Sqrt[vd*qr+vd*qrp-zd*r2p+r2p2+68*q2+r2]-
      8/Sqrt[vd*qr+kd*qrp-zd*r2p+r2p2+md*q2+r2]-
      8/Sqrt[vd*qr+12*qrp-zd*r2p+r2p2+68*q2+r2]-
      32/Sqrt[zd*qrp+r2p2+163/3*q2]-
      8/Sqrt[kd*qr+vd*qrp-zd*r2p+r2p2+md*q2+r2]-
      8/Sqrt[12*qr+vd*qrp-zd*r2p+r2p2+68*q2+r2]-
      4/Sqrt[26/3*qrp+r2p2+33*q2]-
      4/Sqrt[34/3*qrp+r2p2+163/3*q2]-
      12*z/Sqrt[96*q2]-
      24*z/Sqrt[96*q2+r2]-
      24/Sqrt[r2p2+96*q2]-
      12*z/Sqrt[81*q2]-
      4*z/Sqrt[sd*qr+dd*q2+r2]-
      4/Sqrt[sd*qrp+r2p2+dd*q2]-
      4*z/Sqrt[16*qr+96*q2+r2]-
      4/Sqrt[16*qrp+r2p2+96*q2]-
      24/Sqrt[zd*r2p+r2p2+96*q2+r2]-
      24/Sqrt[-2*r2p+r2p2+96*q2+r2]-
      8/Sqrt[sd*qrp+zd*r2p+r2p2+dd*q2+r2]-
      8/Sqrt[16*qrp+zd*r2p+r2p2+96*q2+r2]-
      24/Sqrt[zd*qrp+r2p2+81*q2]-
      8/Sqrt[sd*qr+zd*r2p+r2p2+dd*q2+r2]-
      8/Sqrt[16*qr+zd*r2p+r2p2+96*q2+r2]-
      4/Sqrt[6*qrp+r2p2+17*q2]-
      4/Sqrt[14*qrp+r2p2+81*q2]-
      8*z/Sqrt[132*q2]-
      16*z/Sqrt[vd*qr+132*q2+r2]-
      16/Sqrt[vd*qrp+r2p2+132*q2]-
      8*z/Sqrt[113*q2]-
      4*z/Sqrt[52/3*qr+132*q2+r2]-
      4/Sqrt[52/3*qrp+r2p2+132*q2]-
      16/Sqrt[vd*qr+vd*qrp+2*r2p+r2p2+132*q2+r2]-
      16/Sqrt[vd*qr+vd*qrp-zd*r2p+r2p2+132*q2+r2]-
      8/Sqrt[vd*qr+52/3*qrp-zd*r2p+r2p2+132*q2+r2]-
      16/Sqrt[zd*qrp+r2p2+113*q2]-
      8/Sqrt[52/3*qr+vd*qrp-zd*r2p+r2p2+132*q2+r2]-
      4/Sqrt[jd*qrp+r2p2+cd*q2]-
      4/Sqrt[50/3*qrp+r2p2+113*q2]-
      4*z/Sqrt[fd*q2]-
      8*z/Sqrt[fd*q2+r2]-
      8/Sqrt[r2p2+fd*q2]-
      4*z/Sqrt[451/3*q2]-
      4*z/Sqrt[gd*qr+fd*q2+r2]-
      4/Sqrt[gd*qrp+r2p2+fd*q2]-
      8/Sqrt[zd*r2p+r2p2+fd*q2+r2]-
      8/Sqrt[-2*r2p+r2p2+fd*q2+r2]-
      8/Sqrt[gd*qrp+zd*r2p+r2p2+fd*q2+r2]-
      8/Sqrt[zd*qrp+r2p2+451/3*q2]-
      8/Sqrt[gd*qr+zd*r2p+r2p2+fd*q2+r2]-
      4/Sqrt[58/3*qrp+r2p2+451/3*q2]-
      4/Sqrt[gd*qr+gd*qrp+zd*r2p+r2p2+fd*q2+r2];

Vnn = 20*z/(r*p)+
      8*z2/(2*q)+
      34*z/Sqrt[vd*qrp+r2p2+4*q2]+
      14/Sqrt[dd*q2]+
      7*z2/Sqrt[dd*q2]+
      28*z/Sqrt[r2p2+dd*q2]+
      6*z2/Sqrt[md*q2]+
      24*z/Sqrt[vd*qrp+r2p2+md*q2]+
      10/Sqrt[hd*q2]+
      5*z2/Sqrt[hd*q2]+
      20*z/Sqrt[r2p2+hd*q2]+
      2*z/Sqrt[dd*qrp+r2p2+hd*q2]+
      13/Sqrt[ad*r2p2]+
      20/Sqrt[ad*qrp+vd*r2p2+4*q2]+
      16/Sqrt[ad*qrp+4*r2p2+4*q2]+
      14/Sqrt[ad*r2p2+dd*q2]+
      12/Sqrt[ad*qrp+vd*r2p2+md*q2]+
      12/Sqrt[ad*qrp+4*r2p2+md*q2]+
      10/Sqrt[ad*r2p2+hd*q2]+
      4/Sqrt[dd*qrp+ad*r2p2+hd*q2]+
      4*z2/Sqrt[68*q2]+
      16*z/Sqrt[vd*qrp+r2p2+68*q2]+
      2*z/Sqrt[kd*qrp+r2p2+md*q2]+
      2*z/Sqrt[12*qrp+r2p2+68*q2]+
      8/Sqrt[ad*qrp+4*r2p2+68*q2]+
      8/Sqrt[ad*qrp+vd*r2p2+68*q2]+
      4/Sqrt[8*qrp+vd*r2p2+md*q2]+
      4/Sqrt[40/3*qrp+vd*r2p2+68*q2]+
      6/Sqrt[96*q2]+
      3*z2/Sqrt[96*q2]+
      12*z/Sqrt[r2p2+96*q2]+
      2*z/Sqrt[sd*qrp+r2p2+dd*q2]+
      2*z/Sqrt[16*qrp+r2p2+96*q2]+
      6/Sqrt[ad*r2p2+96*q2]+
      4/Sqrt[sd*qrp+ad*r2p2+dd*q2]+
      4/Sqrt[16*qrp+ad*r2p2+96*q2]+
      2*z2/Sqrt[132*q2]+
      8*z/Sqrt[vd*qrp+r2p2+132*q2]+
      2*z/Sqrt[52/3*qrp+r2p2+132*q2]+
      4/Sqrt[ad*qrp+4*r2p2+132*q2]+
      4/Sqrt[ad*qrp+vd*r2p2+132*q2]+
      4/Sqrt[56/3*qrp+vd*r2p2+132*q2]+
      2/Sqrt[fd*q2]+
      z2/Sqrt[fd*q2]+
      4*z/Sqrt[r2p2+fd*q2]+
      2*z/Sqrt[gd*qrp+r2p2+fd*q2]+
      2/Sqrt[ad*r2p2+fd*q2]+
      4/Sqrt[gd*qrp+ad*r2p2+fd*q2]+
      1/Sqrt[hd*qrp+ad*r2p2+fd*q2];

func = T + Vee + Vne + Vnn;

(* Parameterliste c, angepasst für Propan an G2//6-311g *)

c = {k1 -> 1.02246687, k2 -> 1.37426345, k3 -> 1.20537762,
     s1 -> 0.30582536, s2 -> 0.30677632, s3 -> 0.35441063};

func = func /. c;

t = FindMinimum[func, {P, 0.26112}, {Q, 1.187}, {R, 1.2769},
                        {X, 1.3559},{Method->"Newton", MaxIterations-> 500}]

u = t[[2]];

N[Vne /. u,10]
N[Vee /. u /. c, 10]
N[Vnn /. u, 10]
dch = 0.529177*X*(P+R) /. u          (* C-H Abstand *)
dcc = 0.529177*2.*(P+Q) /. u         (* C-C Abstand *)
N[-(Vne+Vee+Vnn)/T /. u /. c, 8]     (* Virial Theorem *)
(-t[[1]] - n*37.784301 - n - 1.)*627.50956
(* Atomisierungsenergie bei 0 K in kcal/mol *)