Merge remote-tracking branch 'origin/main' into main
# Conflicts: # lib/objects.py # plots/2bodies_leapfrog_dEm.png # plots/2bodies_leapfrog_dL2.png
@@ -8,7 +8,6 @@ import numpy as np
|
|||||||
from lib.plots import DynamicUpdate
|
from lib.plots import DynamicUpdate
|
||||||
from lib.units import *
|
from lib.units import *
|
||||||
|
|
||||||
|
|
||||||
class Body:
|
class Body:
|
||||||
|
|
||||||
def __init__(self, mass, position, velocity):
|
def __init__(self, mass, position, velocity):
|
||||||
@@ -29,7 +28,6 @@ class Body:
|
|||||||
def __str__(self): # Called upon "str(body)"
|
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:.2f} $M_\odot$".format(self.m/Ms)
|
||||||
|
|
||||||
|
|
||||||
class System(Body):
|
class System(Body):
|
||||||
|
|
||||||
def __init__(self, bodylist, blackstyle=True):
|
def __init__(self, bodylist, blackstyle=True):
|
||||||
|
|||||||
2
main.py
@@ -27,7 +27,7 @@ def main():
|
|||||||
v = np.array([v1, v2, v3])
|
v = np.array([v1, v2, v3])
|
||||||
|
|
||||||
#integration parameters
|
#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"
|
integrator = "leapfrog"
|
||||||
n_bodies = 2
|
n_bodies = 2
|
||||||
display = False
|
display = False
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 144 KiB |
|
Before Width: | Height: | Size: 78 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 |