diff --git a/lib/objects.py b/lib/objects.py index 7179baf..6f90f68 100755 --- a/lib/objects.py +++ b/lib/objects.py @@ -150,7 +150,7 @@ class System(Body): for otherbody in self.bodylist: if body != otherbody: rij = np.linalg.norm(body.q-otherbody.q) - W = W - Ga*otherbody.m/(body.m+otherbody.m)*body.m**2/rij + W = W - Ga*otherbody.m*body.m/(2.*rij) E = T + W return E @@ -171,7 +171,7 @@ class System(Body): for otherbody in self.bodylist: if body != otherbody: rij = np.linalg.norm(body.q-otherbody.q) - W = W - Ga*otherbody.m/(body.m+otherbody.m)*body.m**2/rij + W = W - Ga*otherbody.m*body.m/(2.*rij) E = T + W return E diff --git a/main.py b/main.py index 8683319..45f605c 100755 --- a/main.py +++ b/main.py @@ -12,7 +12,7 @@ from lib.units import * def main(): #initialisation - m = np.array([1., 1., 0.],dtype=np.longdouble)*Ms#/Ms # Masses in Solar mass + m = np.array([1., 1., 0.1],dtype=np.longdouble)*Ms#/Ms # Masses in Solar mass a = np.array([1.00, 1.00, 10.0],dtype=np.longdouble)*au#/au # Semi-major axis in astronomical units e = np.array([0., 0., 0.25],dtype=np.longdouble) # Eccentricity psi = np.array([0., 0., 80.],dtype=np.longdouble)*np.pi/180. # Inclination of the orbital plane in degrees @@ -28,12 +28,12 @@ def main(): v = np.array([v1, v2, v3],dtype=np.longdouble) #integration parameters - duration, step = 5000*yr, np.longdouble(1./2.*86400.) #integration time and step in seconds + duration, step = 10000*yr, np.longdouble(1.0/2.*86400.) #integration time and step in seconds integrator = "leapfrog" n_bodies = 3 display = False gif = False - savename = "{0:d}bodies_massless_{1:s}".format(n_bodies, integrator) + savename = "{0:d}bodies_1_{1:s}".format(n_bodies, integrator) display_param = True #simulation start diff --git a/plots/2bodies_hermite_E.png b/plots/2bodies_hermite_E.png index ffcc1b7..aa2080f 100644 Binary files a/plots/2bodies_hermite_E.png and b/plots/2bodies_hermite_E.png differ diff --git a/plots/2bodies_hermite_L.png b/plots/2bodies_hermite_L.png index c822de6..fcf577a 100644 Binary files a/plots/2bodies_hermite_L.png and b/plots/2bodies_hermite_L.png differ diff --git a/plots/2bodies_hermite_a_e.png b/plots/2bodies_hermite_a_e.png index fff27f8..8df4a68 100644 Binary files a/plots/2bodies_hermite_a_e.png and b/plots/2bodies_hermite_a_e.png differ diff --git a/plots/2bodies_hermite_dEm.png b/plots/2bodies_hermite_dEm.png index 4072690..dc1f889 100644 Binary files a/plots/2bodies_hermite_dEm.png and b/plots/2bodies_hermite_dEm.png differ diff --git a/plots/2bodies_hermite_dL2.png b/plots/2bodies_hermite_dL2.png index 90d61ac..b077d96 100644 Binary files a/plots/2bodies_hermite_dL2.png and b/plots/2bodies_hermite_dL2.png differ diff --git a/plots/2bodies_hermite_phi.png b/plots/2bodies_hermite_phi.png new file mode 100644 index 0000000..30410b7 Binary files /dev/null and b/plots/2bodies_hermite_phi.png differ diff --git a/plots/2bodies_leapfrog_E.png b/plots/2bodies_leapfrog_E.png index 477b7bd..cdd85af 100644 Binary files a/plots/2bodies_leapfrog_E.png and b/plots/2bodies_leapfrog_E.png differ diff --git a/plots/2bodies_leapfrog_L.png b/plots/2bodies_leapfrog_L.png index 7a82c52..e9cc67c 100644 Binary files a/plots/2bodies_leapfrog_L.png and b/plots/2bodies_leapfrog_L.png differ diff --git a/plots/2bodies_leapfrog_a_e.png b/plots/2bodies_leapfrog_a_e.png index 24d0fba..68da9cf 100644 Binary files a/plots/2bodies_leapfrog_a_e.png and b/plots/2bodies_leapfrog_a_e.png differ diff --git a/plots/2bodies_leapfrog_dEm.png b/plots/2bodies_leapfrog_dEm.png index ee87959..1b857ef 100644 Binary files a/plots/2bodies_leapfrog_dEm.png and b/plots/2bodies_leapfrog_dEm.png differ diff --git a/plots/2bodies_leapfrog_dL2.png b/plots/2bodies_leapfrog_dL2.png index b3fe80f..e5902d6 100644 Binary files a/plots/2bodies_leapfrog_dL2.png and b/plots/2bodies_leapfrog_dL2.png differ diff --git a/plots/2bodies_leapfrog_phi.png b/plots/2bodies_leapfrog_phi.png new file mode 100644 index 0000000..e004769 Binary files /dev/null and b/plots/2bodies_leapfrog_phi.png differ diff --git a/plots/3bodies_0_leapfrog_E.png b/plots/3bodies_0_leapfrog_E.png new file mode 100644 index 0000000..9410b03 Binary files /dev/null and b/plots/3bodies_0_leapfrog_E.png differ diff --git a/plots/3bodies_0_leapfrog_L.png b/plots/3bodies_0_leapfrog_L.png new file mode 100644 index 0000000..33baf71 Binary files /dev/null and b/plots/3bodies_0_leapfrog_L.png differ diff --git a/plots/3bodies_0_leapfrog_a_e.png b/plots/3bodies_0_leapfrog_a_e.png new file mode 100644 index 0000000..9b0cf13 Binary files /dev/null and b/plots/3bodies_0_leapfrog_a_e.png differ diff --git a/plots/3bodies_0_leapfrog_dEm.png b/plots/3bodies_0_leapfrog_dEm.png new file mode 100644 index 0000000..c5fe045 Binary files /dev/null and b/plots/3bodies_0_leapfrog_dEm.png differ diff --git a/plots/3bodies_0_leapfrog_dL2.png b/plots/3bodies_0_leapfrog_dL2.png new file mode 100644 index 0000000..3d5e40c Binary files /dev/null and b/plots/3bodies_0_leapfrog_dL2.png differ diff --git a/plots/3bodies_0_leapfrog_phi.png b/plots/3bodies_0_leapfrog_phi.png new file mode 100644 index 0000000..4d24bcd Binary files /dev/null and b/plots/3bodies_0_leapfrog_phi.png differ diff --git a/plots/3bodies_1_leapfrog_E.png b/plots/3bodies_1_leapfrog_E.png index 092afdc..48dcc01 100644 Binary files a/plots/3bodies_1_leapfrog_E.png and b/plots/3bodies_1_leapfrog_E.png differ diff --git a/plots/3bodies_1_leapfrog_L.png b/plots/3bodies_1_leapfrog_L.png index cae1a6b..3833637 100644 Binary files a/plots/3bodies_1_leapfrog_L.png and b/plots/3bodies_1_leapfrog_L.png differ diff --git a/plots/3bodies_1_leapfrog_a_e.png b/plots/3bodies_1_leapfrog_a_e.png index 793b580..ecc078f 100644 Binary files a/plots/3bodies_1_leapfrog_a_e.png and b/plots/3bodies_1_leapfrog_a_e.png differ diff --git a/plots/3bodies_1_leapfrog_dEm.png b/plots/3bodies_1_leapfrog_dEm.png index 1f2a156..b3ed7d0 100644 Binary files a/plots/3bodies_1_leapfrog_dEm.png and b/plots/3bodies_1_leapfrog_dEm.png differ diff --git a/plots/3bodies_1_leapfrog_dL2.png b/plots/3bodies_1_leapfrog_dL2.png index 13ea865..9747b83 100644 Binary files a/plots/3bodies_1_leapfrog_dL2.png and b/plots/3bodies_1_leapfrog_dL2.png differ diff --git a/plots/3bodies_1_leapfrog_phi.png b/plots/3bodies_1_leapfrog_phi.png index 003b266..31fe8c5 100644 Binary files a/plots/3bodies_1_leapfrog_phi.png and b/plots/3bodies_1_leapfrog_phi.png differ diff --git a/plots/3bodies_leapfrog_E.png b/plots/3bodies_leapfrog_E.png index e5b8cac..3ba4812 100644 Binary files a/plots/3bodies_leapfrog_E.png and b/plots/3bodies_leapfrog_E.png differ diff --git a/plots/3bodies_leapfrog_L.png b/plots/3bodies_leapfrog_L.png index 090ad55..2d8f365 100644 Binary files a/plots/3bodies_leapfrog_L.png and b/plots/3bodies_leapfrog_L.png differ diff --git a/plots/3bodies_leapfrog_a_e.png b/plots/3bodies_leapfrog_a_e.png index 5a6f21b..e92c022 100644 Binary files a/plots/3bodies_leapfrog_a_e.png and b/plots/3bodies_leapfrog_a_e.png differ diff --git a/plots/3bodies_leapfrog_dEm.png b/plots/3bodies_leapfrog_dEm.png index 1ffab0a..11bfbac 100644 Binary files a/plots/3bodies_leapfrog_dEm.png and b/plots/3bodies_leapfrog_dEm.png differ diff --git a/plots/3bodies_leapfrog_dL2.png b/plots/3bodies_leapfrog_dL2.png index e78e57f..8af48a0 100644 Binary files a/plots/3bodies_leapfrog_dL2.png and b/plots/3bodies_leapfrog_dL2.png differ diff --git a/plots/3bodies_leapfrog_phi.png b/plots/3bodies_leapfrog_phi.png index afc4b43..35d14eb 100644 Binary files a/plots/3bodies_leapfrog_phi.png and b/plots/3bodies_leapfrog_phi.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_E.png b/plots/3bodies_massles_coplans_leapfrog_E.png new file mode 100644 index 0000000..6e37b18 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_E.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_L.png b/plots/3bodies_massles_coplans_leapfrog_L.png new file mode 100644 index 0000000..3bf32e9 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_L.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_a_e.png b/plots/3bodies_massles_coplans_leapfrog_a_e.png new file mode 100644 index 0000000..ec73028 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_a_e.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_dEm.png b/plots/3bodies_massles_coplans_leapfrog_dEm.png new file mode 100644 index 0000000..dfc2581 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_dEm.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_dL2.png b/plots/3bodies_massles_coplans_leapfrog_dL2.png new file mode 100644 index 0000000..df74735 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_dL2.png differ diff --git a/plots/3bodies_massles_coplans_leapfrog_phi.png b/plots/3bodies_massles_coplans_leapfrog_phi.png new file mode 100644 index 0000000..0bcabe3 Binary files /dev/null and b/plots/3bodies_massles_coplans_leapfrog_phi.png differ diff --git a/plots/3bodies_massless_leapfrog_E.png b/plots/3bodies_massless_leapfrog_E.png index 00e602e..f525e6c 100644 Binary files a/plots/3bodies_massless_leapfrog_E.png and b/plots/3bodies_massless_leapfrog_E.png differ diff --git a/plots/3bodies_massless_leapfrog_L.png b/plots/3bodies_massless_leapfrog_L.png index 93192fa..f191fb4 100644 Binary files a/plots/3bodies_massless_leapfrog_L.png and b/plots/3bodies_massless_leapfrog_L.png differ diff --git a/plots/3bodies_massless_leapfrog_a_e.png b/plots/3bodies_massless_leapfrog_a_e.png index 6ba65aa..9d30fbc 100644 Binary files a/plots/3bodies_massless_leapfrog_a_e.png and b/plots/3bodies_massless_leapfrog_a_e.png differ diff --git a/plots/3bodies_massless_leapfrog_dEm.png b/plots/3bodies_massless_leapfrog_dEm.png index 2e4c0a4..a6112e6 100644 Binary files a/plots/3bodies_massless_leapfrog_dEm.png and b/plots/3bodies_massless_leapfrog_dEm.png differ diff --git a/plots/3bodies_massless_leapfrog_dL2.png b/plots/3bodies_massless_leapfrog_dL2.png index 956b8ba..5f18917 100644 Binary files a/plots/3bodies_massless_leapfrog_dL2.png and b/plots/3bodies_massless_leapfrog_dL2.png differ diff --git a/plots/3bodies_massless_leapfrog_phi.png b/plots/3bodies_massless_leapfrog_phi.png index 51d3fe7..c2887f2 100644 Binary files a/plots/3bodies_massless_leapfrog_phi.png and b/plots/3bodies_massless_leapfrog_phi.png differ