Debian Codegraph @

07p/demos/r3b/compute_lps.py

raw symbols SCIP
1 # This script computes the initial circle of solutions for mu=0
2 # as well as the bifurcating branches which give us the
3 # Lagrange points.
4
5 from AUTOclui import *
6
7 def write_lagrange(r):
8 # Print all Lagrange points
9 import math
10 ltouz = {1: 7, 2: 8, 3: 6, 4: 2, 5: 4}
11 for lnumber in (1, 2, 3, 4, 5):
12 print("L"+str(lnumber)+":")
13 uzlabel = 'UZ'+str(ltouz[lnumber])
14 x = r(uzlabel)
15 label = x["LAB"]
16 for parnumber in (5, 6, 7):
17 period = x.PAR(parnumber)
18 if period != 0:
19 print("Label: %2d (%s, TY='HB%s'); imaginary part: %.11f; "
20 "period: %.11f"%
21 (label, uzlabel, parnumber, 2*math.pi/period, period))
22
23 def compute(m=0.063):
24 # m is the desired mass ratio
25 r1 = run('r3b', UZR={2:m})
26 write_lagrange(r1)
27
28 # This is the Python syntax for making a script runable
29 if __name__ == '__main__':
30 if len(sys.argv) > 1:
31 compute(float(sys.argv[1]))
32 else:
33 compute()