Skip to content
Snippets Groups Projects
Commit ed4ed61c authored by nguyed99's avatar nguyed99
Browse files

report, update general README, minor changes

parent 02fed034
No related branches found
No related tags found
No related merge requests found
Pipeline #59686 passed
File added
......@@ -11,7 +11,7 @@ from jobs.src.system import GravitationalSystem
from jobs.src.integrator import verlet
from tasks.src.utils import plot_orbits
INPUT_PATH = "tasks/inputs"
INPUT_PATH = "tasks/inputs/"
input_file = csv.DictReader(open(INPUT_PATH + "initial.csv", encoding="utf8"))
r0 = []
......
"""
This code contains a class to simulate the collision of a Galaoxy with a given
This code contains a class to simulate the collision of a Galaxy with a given
number of particles/planets. To choose the initial conditions regadring initial
positions, velocities and sometimes the number of particles, please check the
function "initialize_particles". To choose initial state of the system,
......
......@@ -163,10 +163,10 @@ class IntegratorJPLTest(unittest.TestCase):
plot_orbits(q, body_names)
q_comp = q.reshape(len(t), 11, 3)
## checking overlap of orbits
logger.info("Checking overlap of orbits... ")
self.assertTrue(np.max(np.linalg.norm(q_comp, axis=2) - np.linalg.norm(trajs, axis=2)) < 35)
## checking total energy conservation
logger.info("Checking total energy conservation... ")
E_tot_sys = E_tot(p, q, body_GMs)
self.assertTrue(np.greater(1e-8 + np.zeros(E_tot_sys.shape[0]), E_tot_sys - E_tot_sys[0]).all())
plt.figure()
......@@ -177,7 +177,7 @@ class IntegratorJPLTest(unittest.TestCase):
plt.tight_layout()
plt.show()
## checking total linear momentum conservation
logger.info("Checking total linear momentum conservation... ")
lin_mom_sys = lin_mom_tot(p, body_GMs)
self.assertTrue(np.greater(1e-8 + np.zeros(lin_mom_sys.shape[0]), lin_mom_sys - lin_mom_sys[0]).all())
plt.figure()
......@@ -188,7 +188,7 @@ class IntegratorJPLTest(unittest.TestCase):
plt.tight_layout()
plt.show()
## checking total angular momentum conservation
logger.info("Checking total angular momentum conservation... ")
am_mom_sys = am_tot(p, q, body_GMs)
self.assertTrue(np.greater(1e-20 + np.zeros(am_mom_sys.shape[0]), am_mom_sys - am_mom_sys[0]).all())
plt.figure()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment