1 SUBROUTINE himax(I,IM,ECC,SEMI,EMAX,EMIN,ZI,TG,EDAV)
8 common/binary/ cm(4,mmax),yrel(3,mmax),zrel(3,mmax),
9 & hm(mmax),um(4,mmax),umdot(4,mmax),tmdis(mmax),
10 & namem(mmax),nameg(mmax),kstarm(mmax),iflag(mmax)
11 REAL*8 a1(3),a2(3),xrel(3),vrel(3),ei(3),hi(3),ho(3),bhat(3),
22 CALL
ksphys(ui,v,xrel,vrel)
32 IF (list(1,2*ipair-1).EQ.0.OR.x(1,jcomp).EQ.x(1,i))
THEN
48 a1(k) = xrel(k1)*vrel(k2) - xrel(k2)*vrel(k1)
49 a2(k) = (x(k1,jcomp) - x(k1,i))*(xdot(k2,jcomp) - xdot(k2,i))
50 & - (x(k2,jcomp) - x(k2,i))*(xdot(k1,jcomp) - xdot(k1,i))
53 a1a2 = a1a2 + a1(k)*a2(k)
54 ri2 = ri2 + xrel(k)**2
55 vi2 = vi2 + vrel(k)**2
56 rvi = rvi + xrel(k)*vrel(k)
60 zmb = body(i) + body(jcomp)
61 semi1 = -0.5*zmb/h(ipair)
62 ecc2 = (1.0 - r(ipair)/semi1)**2 + tdot2(ipair)**2/(semi1*zmb)
65 fac = a1a2/sqrt(a12*a22)
71 ei(k) = (vi2*xrel(k) - rvi*vrel(k))/body(i) -
80 ei(k) = ei(k)/sqrt(ei2)
81 hi(k) = a1(k)/sqrt(a12)
82 ho(k) = a2(k)/sqrt(a22)
83 cosj = cosj + hi(k)*ho(k)
84 sjsg = sjsg + ei(k)*ho(k)
95 bhat(k) = hi(k1)*ei(k2) - hi(k2)*ei(k1)
97 bh = bh + bhat(k)*ho(k)
101 a = cosj*sqrt(1.0 - ei2)
102 z = (1.0 - ei2)*(2.0 - cosj**2) + 5.0*ei2*sjsg**2
105 z2 = z**2 + 25.0 + 16.0*a**4 - 10.0*z - 20.0*a**2 - 8.0*a**2*z
106 emax = one6*(z + 1.0 - 4.0*a**2 + sqrt(z2))
112 az1 = 1.0 + z - 4.0*a**2
113 emin2 = one6*(az1 - sqrt(az1**2 - 12.0*az))
115 emin2 = 1.0 - 0.5*(a**2 + z)
117 emin2 = max(emin2,0.0d0)
121 tk = twopi*semi*sqrt(semi/body(i))
122 tk1 = twopi*abs(semi1)*sqrt(abs(semi1)/zmb)
123 tg = tk1**2*zmb*(1.0 - ecc1**2)**1.5/(body(jcomp)*tk)
133 yfac = 15.0*body(jcomp)/(4.0*zmb)*twopi*tk/tk1**2
134 yfac = yfac*ecc*sqrt(1.0 - ecc**2)/(1.0 - ecc1**2)**(1.5)