Debian Codegraph @

07p/demos/python/n-body/compute_lagrange_points_0.5.auto

raw
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 # Load 3d.c and c.3d into the AUTO CLUI
6
7 # Add a stopping condition so we only compute the loop once
8 # We tell AUTO to stop when parameter 16 is 0.991, parameter 1 is -0.1,
9 # or parameter 1 is 1.1. If parameter1 is 0.5 we just report
10 # a point.
11
12 # We also want to compute branches for the first 3 bifurcation
13 # points.
14
15 # IPS=0 tells AUTO to compute a family of equilibria.
16 # Compute the circle.
17 circle = run('3d',UZR={-16:0.991, -1:[-0.1,1.1], 1:0.5}, MXBF=-3, IPS=0)
18
19 # Extract the 5 Lagrange points for each of the branches
20 # which we will use in later calculations.
21
22 # This command parses the solution file fort.8 and returns
23 # a Python object which contains all of the data in the
24 # file in an easy to use format.
25 i=0
26
27 # For every solution in the fort.8 file...
28 # If the solution is a user defined point...
29 for u in circle('UZ'):
30 # We look at the value of one of the components
31 # to determine which Lagrange point it is.
32
33 # The solution is a Pointset. In this case there is only
34 # one point, at t=0, accessible via u(0), u[0], or via the
35 # u['U(1)'] and u['U(2)'] arrays.
36 [x]=u['U(1)']
37 [y]=u['U(2)']
38 if y > 0.01:
39 # When we determine which Lagrange point we have we save it.
40 u.writeFilename("s.l4")
41 elif y < -0.01:
42 u.writeFilename("s.l5")
43 elif x > 0.01:
44 u.writeFilename("s.l2")
45 elif x < -0.01:
46 u.writeFilename("s.l3")
47 else:
48 u.writeFilename("s.l1")
49
50
51
52
53
54
55
56
57
58