1
0

we did it !

This commit is contained in:
Thibault Barnouin
2022-01-14 17:52:46 +01:00
parent 22747db964
commit 6ec0eba13b
8 changed files with 13 additions and 9 deletions

View File

@@ -138,7 +138,8 @@ def display_parameters(E,L,sma,ecc,phi,parameters,savename="",display_param=True
list of integrated parameters value computed for each step length in list of integrated parameters value computed for each step length in
parameters[step] list. parameters[step] list.
parameters : list parameters : list
list of simulation parameters : duration, steps, system, integrator. list of simulation parameters : duration, steps, system, integrator,
and initialisation parameters.
savename : str savename : str
default savename that will be prepend to each saved file path. default savename that will be prepend to each saved file path.
Default to empty string. Default to empty string.
@@ -148,11 +149,14 @@ def display_parameters(E,L,sma,ecc,phi,parameters,savename="",display_param=True
""" """
if savename != "": if savename != "":
savename += "_" savename += "_"
duration, step, dyn_syst, integrator = parameters duration, step, dyn_syst, integrator, init = parameters
a, e, psi = init
bodies = "" bodies = ""
for body in dyn_syst.bodylist: init_str = ""
for i, body in enumerate(dyn_syst.bodylist):
bodies += str(body)+" ; " bodies += str(body)+" ; "
title1, title2 = "Relative difference of the {0:s} ","for a system composed of {0:s}\n integrated with {1:s} for a duration of {2:.2f} years ".format(bodies, integrator, duration/yr) init_str += r"a{0:d} = {1:.2f} au, e{0:d} = {2:.2f}, $\psi${0:d} = {3:.2f}° ; ".format(i+1,a[i]/au,e[i],psi[i]*180./np.pi)
title1, title2 = "Relative difference of the {0:s} ","for a system composed of {0:s}\n integrated with {1:s} for a duration of {2:.2f} years with initial parameters\n {3:s}".format(bodies, integrator, duration/yr, init_str)
fig1 = plt.figure(figsize=(15,7)) fig1 = plt.figure(figsize=(15,7))
ax1 = fig1.add_subplot(111) ax1 = fig1.add_subplot(111)

View File

@@ -12,8 +12,8 @@ from lib.units import *
def main(): def main():
#initialisation #initialisation
m = np.array([1., 1., 1e-1],dtype=np.longdouble)*Ms#/Ms # Masses in Solar mass m = np.array([1., 1., 1e-1],dtype=np.longdouble)*Ms#/Ms # Masses in Solar mass
a = np.array([.75, .75, 5.],dtype=np.longdouble)*au#/au # Semi-major axis in astronomical units a = np.array([1.0, 1.0, 7.0],dtype=np.longdouble)*au#/au # Semi-major axis in astronomical units
e = np.array([0., 0., 0.25],dtype=np.longdouble) # Eccentricity e = np.array([0., 0., 0.10],dtype=np.longdouble) # Eccentricity
psi = np.array([0., 0., 80.],dtype=np.longdouble)*np.pi/180. # Inclination of the orbital plane in degrees psi = np.array([0., 0., 80.],dtype=np.longdouble)*np.pi/180. # Inclination of the orbital plane in degrees
x1 = np.array([0., -1., 0.],dtype=np.longdouble)*a[0]*(1.+e[0]) x1 = np.array([0., -1., 0.],dtype=np.longdouble)*a[0]*(1.+e[0])
@@ -27,7 +27,7 @@ def main():
v = np.array([v1, v2, v3],dtype=np.longdouble) v = np.array([v1, v2, v3],dtype=np.longdouble)
#integration parameters #integration parameters
duration, step = 1000*yr, np.longdouble(1./2.*86400.) #integration time and step in seconds duration, step = 5000*yr, np.longdouble(5./1.*86400.) #integration time and step in seconds
integrator = "leapfrog" integrator = "leapfrog"
n_bodies = 3 n_bodies = 3
display = False display = False
@@ -47,7 +47,7 @@ def main():
elif integrator.lower() in ['hermite','herm']: elif integrator.lower() in ['hermite','herm']:
E, L, sma, ecc, phi = hermite(dyn_syst, bin_syst, duration, step, recover_param=True, display=display, savename=savename, gif=gif) E, L, sma, ecc, phi = hermite(dyn_syst, bin_syst, duration, step, recover_param=True, display=display, savename=savename, gif=gif)
parameters = [duration, [step], dyn_syst, integrator] parameters = [duration, [step], dyn_syst, integrator, [a, e, psi]]
display_parameters([E], [L], [sma], [ecc], [phi], parameters=parameters, savename=savename, display_param=display_param) display_parameters([E], [L], [sma], [ecc], [phi], parameters=parameters, savename=savename, display_param=display_param)
return 0 return 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 70 KiB