Nbody6
expand.f
Go to the documentation of this file.
1  SUBROUTINE expand(IPAIR,SEMI0)
2 *
3 *
4 * Expansion (contraction) of KS orbit.
5 * ------------------------------------
6 *
7  include 'common6.h'
8 *
9 *
10 * Evaluate square regularized velocity.
11  v20 = 0.0
12  DO 10 k = 1,4
13  v20 = v20 + udot(k,ipair)**2
14  10 CONTINUE
15 *
16 * Form KS coordinate & velocity scaling factors (general point is OK).
17  i = n + ipair
18  IF (semi0.GE.0.0d0) THEN
19  semi = -0.5d0*body(i)/h(ipair)
20  ELSE
21  semi = semi0
22  END IF
23  c2 = sqrt(semi/semi0)
24  v2 = 0.5*(body(i) + h(ipair)*r(ipair)*(semi/semi0))
25  c1 = sqrt(v2/v20)
26 *
27 * Re-scale KS variables to new energy (H < 0: constant eccentricity).
28  r(ipair) = 0.0d0
29 * Retain sign of radial velocity for unperturbed KS (apo or peri).
30 * TDOT2(IPAIR) = 0.0D0
31  DO 20 k = 1,4
32  u(k,ipair) = c2*u(k,ipair)
33  udot(k,ipair) = c1*udot(k,ipair)
34  u0(k,ipair) = u(k,ipair)
35  r(ipair) = r(ipair) + u(k,ipair)**2
36 * TDOT2(IPAIR) = TDOT2(IPAIR) + 2.0*U(K,IPAIR)*UDOT(K,IPAIR)
37  20 CONTINUE
38 *
39 * Re-initialize KS polynomials for perturbed or hyperbolic motion.
40  t0(2*ipair-1) = time
41  IF (list(1,2*ipair-1).GT.0.OR.h(ipair).GT.0.0) THEN
42  CALL resolv(ipair,1)
43  CALL kspoly(ipair,1)
44  ELSE
45 * Determine new interval for unperturbed motion (>= TK).
46  tk = twopi*semi*sqrt(abs(semi)/body(i))
47  CALL tpert(ipair,gmin,dt)