Nbody6
erel4.f
Go to the documentation of this file.
1  SUBROUTINE erel4(IM,EB,SEMI)
2 *
3 *
4 * Dominant two-body energy in four-body system.
5 * ---------------------------------------------
6 *
7  IMPLICIT REAL*8 (a-h,m,o-z)
8  common/creg/ m(4),x(12),xd(12),p(12),q(12),time4,energy,epsr2,
9  & xr(9),w(9),r(6),ta(6),mij(6),cm(10),rmax4,tmax,
10  & ds,tstep,eps,nstep4,name4(4),kz15,kz27,nreg,nfn
11  common/savep/ pi(12)
12  common/ksave/ k1,k2
13 *
14 *
15 * Obtain physical momenta of pericentre configuration.
16  CALL trans4
17 *
18 * Form kinetic energy terms of dominant c.m. (K1 + K2) and the rest.
19  zk = 0.0d0
20  p0 = 0.0d0
21  DO 10 k = 1,3
22  ps = 0.0
23  DO 8 i = 1,4
24 * Note PI is associated with the bodies (PI sequential in CHAIN code).
25  IF (i.NE.k1.AND.i.NE.k2) THEN
26  j = 3*(i - 1)
27  ps = ps + pi(j+k)
28  zk = zk + pi(j+k)**2/m(i)
29  END IF
30  8 CONTINUE
31  p0 = p0 + ps**2
32  10 CONTINUE
33 *
34 * Evaluate potential energy due to non-singular terms.
35  pot = 0.0d0
36  DO 20 i = 1,6
37  IF (i.EQ.im) go to 20
38  pot = pot + mij(i)/r(i)
39  20 CONTINUE
40 *
41 * Obtain binding energy from total energy and perturbing function.
42  mb = m(k1) + m(k2)
43  vp = 0.5d0*(p0/mb + zk) - pot
44  eb = energy - vp
45 *
46 * Set semi-major axis.
47  semi = -m(k1)*m(k2)/(2.0d0*eb)
48 *
49  RETURN
50 *
51  END