1
0

get back to full dimensions

This commit is contained in:
Thibault Barnouin
2022-01-11 16:20:05 +01:00
parent ae6898c605
commit 3259c0c7b5
8 changed files with 10 additions and 14 deletions

View File

@@ -26,10 +26,10 @@ class Body:
self.vp = np.zeros(3,dtype=np.longdouble)
def __repr__(self): # Called upon "print(body)"
return r"Body of mass: {0:.1e} $M_\odot$, position: {1}, velocity: {2}".format(self.m, self.q, self.v)
return r"Body of mass: {0:.1e} $M_\odot$, position: {1}, velocity: {2}".format(self.m/Ms, self.q, self.v)
def __str__(self): # Called upon "str(body)"
return r"Body of mass: {0:.1e} $M_\odot$".format(self.m)
return r"Body of mass: {0:.1e} $M_\odot$".format(self.m/Ms)
@property
def p(self):

View File

@@ -75,12 +75,12 @@ class DynamicUpdate():
def on_running(self, dyn_syst, step=None, label=None):
xdata, ydata, zdata = dyn_syst.get_positions()
values = np.sqrt(np.sum((np.array((xdata,ydata,zdata))**2).T,axis=1))
values = np.sqrt(np.sum((np.array((xdata,ydata,zdata))**2).T,axis=1))/au
self.min_x, self.max_x = -np.max([np.abs(values).max(),self.max_x]), np.max([np.abs(values).max(),self.max_x])
self.set_lims()
#Update data (with the new _and_ the old points)
for i,body in enumerate(dyn_syst.bodylist):
x, y, z = body.q
x, y, z = body.q/au
self.lines[i].set_data_3d([x], [y], [z])
if not label is None:
if self.blackstyle:

View File

@@ -8,4 +8,4 @@ globals()['G'] = 6.67e-11 #Gravitational constant in SI units
globals()['Ms'] = 2e30 #Solar mass in kg
globals()['au'] = 1.5e11 #Astronomical unit in m
globals()['yr'] = 3.15576e7 #year in seconds
globals()['Ga'] = G*Ms/au**3 #Gravitational constant dimensionless
globals()['Ga'] = G#*Ms/au**3 #Gravitational constant dimensionless