tests for third object with mass
@@ -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):
|
||||
|
||||
|
||||
2
main.py
@@ -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
|
||||
|
||||
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 222 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 181 KiB |
|
Before Width: | Height: | Size: 180 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 390 KiB |