diff --git a/lib/objects.py b/lib/objects.py index 997f5cf..7179baf 100755 --- a/lib/objects.py +++ b/lib/objects.py @@ -186,6 +186,7 @@ class System(Body): def eccCOM(self): #exentricity of two body sub system if len(self.bodylist) == 2 : ecc = (2.*self.ECOM*(np.linalg.norm(self.LCOM)**2))/(Ga**2*self.M**2*self.mu**3) + 1. + else : ecc = np.nan return ecc @@ -215,13 +216,15 @@ class System(Body): return sma @property - def phi(self): #return angle in degree between plans formed by body1 and body2 (perurbator) trajectories + def phi(self): #return angle in degree between plans formed by perturbator plan and reference plan if len(self.bodylist) == 3 : body1 = self.bodylist[0] body2 = self.bodylist[2] - n1 = np.cross(body1.q, body1.v) - n2 = np.cross(body2.q, body2.v) + n1 = np.cross(body1.q-self.COM, body1.v-self.COMV) + n2 = np.cross(body2.q-self.COM, body2.v-self.COMV) + n1 = np.array([0., 0., 1.], dtype=np.longdouble) phi = np.arccos(np.dot(n1, n2) / (np.linalg.norm(n1) * np.linalg.norm(n2)))*180./np.pi else : phi = np.nan - return phi \ No newline at end of file + return phi + diff --git a/main.py b/main.py index 92d380c..6ad0d42 100755 --- a/main.py +++ b/main.py @@ -12,7 +12,7 @@ from lib.units import * def main(): #initialisation m = np.array([1., 1., 1e-1],dtype=np.longdouble)*Ms#/Ms # Masses in Solar mass - a = np.array([1., 1., 5.5],dtype=np.longdouble)*au#/au # Semi-major axis in astronomical units + a = np.array([.75, .75, 5.],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 @@ -27,7 +27,7 @@ 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 = 1000*yr, np.longdouble(1./2.*86400.) #integration time and step in seconds integrator = "leapfrog" n_bodies = 3 display = False diff --git a/plots/3bodies_leapfrog_E.png b/plots/3bodies_leapfrog_E.png index 7902e93..5555451 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 a8579ef..f3decfc 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 68f8f21..b118a38 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 0c24328..b0b3583 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 4f9e3eb..0cfaed5 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 77f423b..249a0e5 100644 Binary files a/plots/3bodies_leapfrog_phi.png and b/plots/3bodies_leapfrog_phi.png differ