diff --git a/lib/plots.py b/lib/plots.py index 9607a54..e1eb18a 100755 --- a/lib/plots.py +++ b/lib/plots.py @@ -45,7 +45,7 @@ class DynamicUpdate(): #We need to draw *and* flush self.fig.canvas.draw() self.fig.canvas.flush_events() - if not step is None and step%100==0: + if not step is None and step%10==0: self.fig.savefig("tmp/{0:05d}.png".format(step),bbox_inches="tight") #Example diff --git a/main.py b/main.py index 3e6eadb..b205110 100755 --- a/main.py +++ b/main.py @@ -13,8 +13,8 @@ globals()['au'] = 1.5e11 #Astronomical unit in m def main(): #initialisation m = np.array([1, 1, 0.1])*Ms # Masses in Solar mass - mu = m[0]*m[1]/(m[0]+m[1]) a = np.array([1., 1., 5.])*au # Semi-major axis in astronomical units + e = np.array([0., 0., 1./4.]) # Eccentricity psi = np.array([0., 0., 80.])*np.pi/180. # Inclination of the orbital plane in degrees x1 = np.array([-1., 0., 0.])*a[0] @@ -22,19 +22,19 @@ def main(): x3 = np.array([np.cos(psi[2]), 0., np.sin(psi[2])])*a[2] q = np.array([x1, x2, x3]) - v1 = np.array([0., -np.sqrt(G*mu/np.sqrt(np.sum(x1**2))), 0]) - v2 = np.array([0., np.sqrt(G*mu/np.sqrt(np.sum(x2**2))), 0.]) + v1 = np.array([0., -1./3*np.sqrt(G*(m[0]+m[1])*a[0]*(1-e[0]**2)*(1+e[0])**2/np.sum(q[0]**2)), 0.]) + v2 = np.array([0., 1./3*np.sqrt(G*(m[0]+m[1])*a[1]*(1-e[1]**2)*(1+e[1])**2/np.sum(q[1]**2)), 0.]) v3 = np.array([0., np.sqrt(G*(m[0]+m[1])*(2./np.sqrt(np.sum(x3**2))-1./a[2])), 0.]) v = np.array([v1, v2, v3]) bodylist = [] - for i in range(m.shape[0]): + for i in range(3): bodylist.append(Body(m[i], q[i], v[i])) dyn_syst = System(bodylist) dyn_syst.COMShift() - duration, step = 0.5*3e7, 1e1 - E, L = frogleap(duration, step, dyn_syst, recover_param=True)#, display=True) + duration, step = 10*3e7, 5e5 + E, L = frogleap(duration, step, dyn_syst, recover_param=True, display=True) fig1 = plt.figure(figsize=(30,15)) ax1 = fig1.add_subplot(111) diff --git a/plots/Em.png b/plots/Em.png index db9d12a..9461630 100644 Binary files a/plots/Em.png and b/plots/Em.png differ diff --git a/plots/L2.png b/plots/L2.png index 347d221..f2ea86e 100644 Binary files a/plots/L2.png and b/plots/L2.png differ diff --git a/plots/dynsyst.gif b/plots/dynsyst.gif index 882e0eb..93093df 100644 Binary files a/plots/dynsyst.gif and b/plots/dynsyst.gif differ