Nbody6
 All Files Functions Variables
expand2.f
Go to the documentation of this file.
1  SUBROUTINE expand2(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  semi = -0.5d0*body(i)/h(ipair)
19  c2 = sqrt(semi/semi0)
20  v2 = 0.5*(body(i) + h(ipair)*r(ipair)*(semi/semi0))
21  c1 = sqrt(v2/v20)
22 *
23 * Re-scale KS variables to new energy (H < 0: constant eccentricity).
24  r(ipair) = 0.0d0
25  DO 20 k = 1,4
26  u(k,ipair) = c2*u(k,ipair)
27  udot(k,ipair) = c1*udot(k,ipair)
28  u0(k,ipair) = u(k,ipair)
29  r(ipair) = r(ipair) + u(k,ipair)**2
30  20 CONTINUE
31 *
32  RETURN
33 *
34  END