1
0

tests with 2 and 3 bodies

This commit is contained in:
Thibault Barnouin
2021-11-05 19:44:26 +01:00
parent 24e544c43a
commit 88606891ab
9 changed files with 6 additions and 6 deletions

12
main.py
View File

@@ -22,19 +22,19 @@ def main():
x3 = np.array([np.cos(psi[2]), 0., np.sin(psi[2])])*a[2] x3 = np.array([np.cos(psi[2]), 0., np.sin(psi[2])])*a[2]
q = np.array([x1, x2, x3]) q = np.array([x1, x2, x3])
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.]) v1 = np.array([0., -np.sqrt(G*m[1]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-q[1])**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.]) v2 = np.array([0., np.sqrt(G*m[0]**2/((m[0]+m[1])*np.sqrt(np.sum((q[0]-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.]) v3 = np.array([0., np.sqrt(G*(m[0]+m[1])*(2./np.sqrt(np.sum(q[2]**2))-1./a[2])), 0.])
v = np.array([v1, v2, v3]) v = np.array([v1, v2, v3])
bodylist = [] bodylist = []
for i in range(3): for i in range(2):
bodylist.append(Body(m[i], q[i], v[i])) bodylist.append(Body(m[i], q[i], v[i]))
dyn_syst = System(bodylist) dyn_syst = System(bodylist)
dyn_syst.COMShift() dyn_syst.COMShift()
duration, step = 10*3e7, 5e5 duration, step = 100*3e7, 1e5
E, L = frogleap(duration, step, dyn_syst, recover_param=True, display=True) E, L = frogleap(duration, step, dyn_syst, recover_param=True)#, display=True)
fig1 = plt.figure(figsize=(30,15)) fig1 = plt.figure(figsize=(30,15))
ax1 = fig1.add_subplot(111) ax1 = fig1.add_subplot(111)

BIN
plots/2bodies_Em.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

BIN
plots/2bodies_L2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
plots/2bodies_dynsyst.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

BIN
plots/3bodies_Em.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
plots/3bodies_L2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 277 KiB