Nbody6
rpmax2.f
Go to the documentation of this file.
1  REAL*8 FUNCTION rpmax2(R1,R2,M1,M2,KS1,KS2,VINF)
2 *
3 *
4 * Maximum periastron factor for capture.
5 * --------------------------------------
6 *
7 * Developed by Rosemary Mardling (March 1996).
8 * @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
9 *
10  REAL*8 r1,r2,m1,m2,vinf,m21,a(8),b(2),p(2)
11  INTEGER ks1,ks2,ks(2)
12  DATA a /-600.2227,3538.748,1703.075,77.31540,
13  & 191.8260,-2.203482,1202.116,70.80281/
14  DATA b /0.54,1.08/
15 *
16 *
17 * Define mass and radius ratios and swap stellar type if necessary.
18  IF (r1.GE.r2) THEN
19  m21 = m2/m1
20  r21 = r2/r1
21  ks(1) = ks1
22  ks(2) = ks2
23  ELSE
24  m21 = m1/m2
25  r21 = r1/r2
26  ks(1) = ks2
27  ks(2) = ks1
28  END IF
29 *
30 * Choose polytropic index for each star (adopt n=1.5 for giants).
31  DO 1 i = 1,2
32  IF(ks(i).EQ.0.OR.ks(i).EQ.3.OR.ks(i).EQ.5.OR.
33  & ks(i).EQ.6.OR.ks(i).EQ.9)THEN
34  ip = 1
35  pp = b(1)
36  ELSE
37  ip = 5
38  pp = b(2)
39  ENDIF
40  p(i) = (((a(ip+3)*m21 + a(ip+2))*m21 + a(ip+1))*m21
41  & + a(ip))/vinf**pp
42  1 CONTINUE
43 *
44 * Calculate maximum periastron separation for capture (note arg < 0).
45  z = p(1) + (r21**5/m21**2)*p(2)
46  IF (z.LE.0.0) THEN
47 * Adopt factor 2 for collision test in case of small mass ratio.
48  rpmax2 = 2.0
49  ELSE
50  rpmax2 = z**(1.0/6.0)
51 * RPMAX2 = (P(1) + (R21**5/M21**2)*P(2))**(1.0/6.0)
52  END IF
53 *
54  RETURN
55 *
56  END