1
0

add description to display, coplanar 3 bodies with test mass

This commit is contained in:
Thibault Barnouin
2021-11-13 19:27:15 +01:00
parent 27844f5cb8
commit d5feffb0fe
14 changed files with 6 additions and 6 deletions

View File

@@ -92,7 +92,7 @@ class DynamicUpdate():
self.fig.savefig("tmp/{0:06d}.png".format(step),bbox_inches="tight")
def close(self):
self.fig.close()
plt.close()
#Example
def __call__(self):
@@ -117,7 +117,7 @@ def display_parameters(E,L,parameters,savename=""):
bodies = ""
for body in dyn_syst.bodylist:
bodies += str(body)+" ; "
title = "Relative difference of the {} "+"for a system composed of {0:s} \nintegrated with {1:s} for a duration of {2:.2f} years with a step of {3:.2e} years.".format(bodies, integrator, duration/yr, step/yr)
title = "Relative difference of the {} "+"for a system composed of {0:s}\n integrated with {1:s} for a duration of {2:.2f} years with a step of {3:.2e} years.".format(bodies, integrator, duration/yr, step/yr)
fig1 = plt.figure(figsize=(15,7))
ax1 = fig1.add_subplot(111)
ax1.plot(np.arange(E.shape[0])*step/yr, np.abs((E-E[0])/E[0]), label=r"$\left|\frac{\delta E_m}{E_m(t=0)}\right|$")

View File

@@ -25,16 +25,16 @@ def main():
v = np.array([v1, v2, v3])
bodylist = []
for i in range(2):
for i in range(3):
bodylist.append(Body(m[i], q[i], v[i]))
dyn_syst = System(bodylist)
dyn_syst.COMShift()
duration, step = 100*yr, 1e4
#E, L = dyn_syst.leapfrog(duration, step, recover_param=True)#, display=True)
E, L = dyn_syst.hermite(duration,step, recover_param=True)#, display=True)
#E, L = dyn_syst.leapfrog(duration, step, recover_param=True, display=True)
E, L = dyn_syst.hermite(duration,step, recover_param=True, display=True)
parameters = [duration, step, dyn_syst, "hermite"]
display_parameters(E, L, parameters=parameters, savename="2bodies_hermite")
display_parameters(E, L, parameters=parameters, savename="3bodies_hermite")
return 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 319 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 KiB

After

Width:  |  Height:  |  Size: 549 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 KiB

After

Width:  |  Height:  |  Size: 362 KiB