def test_beeman(self): """Test used to check that Beeman's method works appropiatley. """ planetA = CelestialBody("B",1,1,1,"Planet",1,10000,"blue") star = CelestialBody("A",1,1,1,"Star",0,10000,"blue") planetB = CelestialBody("B",1,2,1,"Planet",1,10000,"blue") planetB.position = np.array([-1.0,0.0]) planetB.velocity = np.array([0.0,-planetA.velocity[1]]) system = SolarSystem(3600,1000,Options.NORMAL_RUN,"CelestialObjects") system.celestial_bodies = [star,planetA,planetB] system.update_initial_acceleration() for i in range(100): system.update_beeman() self.assertEqual(0.0,star.acceleration[0]) self.assertEqual(0.0,star.acceleration[1])
def test_period_graph_plot(self, plot, show): system = SolarSystem(1000000, 10.175 * 10**3, Options.NORMAL_RUN, "CelestialObjects") system.celestial_bodies = system.celestial_bodies[0:2] Animation.periods_graph(10, system) show.assert_called_once()