1
0

tests for third object with mass

This commit is contained in:
Thibault Barnouin
2021-11-19 14:07:51 +01:00
parent 0f14383f00
commit 1169e5418b
9 changed files with 3 additions and 3 deletions

View File

@@ -17,10 +17,10 @@ class Body:
self.p = velocity*mass
def __repr__(self): # Called upon "print(body)"
return r"Body of mass: {0:.2f} $M_\odot$, position: {1}, velocity: {2}".format(self.m/Ms, 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:.2f} $M_\odot$".format(self.m/Ms)
return r"Body of mass: {0:.1e} $M_\odot$".format(self.m/Ms)
class System(Body):

View File

@@ -25,7 +25,7 @@ def main():
v = np.array([v1, v2, v3])
#integration parameters
duration, step = 100*yr, np.array([1./(365.25*2.), 1./365.25])*yr #integration time and step in years
duration, step = 100*yr, np.array([1./(365.25*4.), 1./(365.25*2.), 1./365.25])*yr #integration time and step in years
integrator = "leapfrog"
n_bodies = 2
display = False

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 KiB