Exemple #1
0
    def test3(self):
        instance = AarsethZare(
            nbody_system.nbody_to_si(1.0 | units.yr, 1.0 | units.MSun))

        particles = self.new_system_of_sun_and_earth_and_moon()
        instance.particles.add_particles(particles)

        earth = instance.particles[1]

        position_at_start = earth.position[0]

        instance.evolve_model(365.0 | units.day)

        position_after_full_rotation = earth.position[0]

        self.assertAlmostRelativeEquals(position_at_start,
                                        position_after_full_rotation, 4)

        instance.evolve_model(1.5 | units.yr)

        position_after_half_a_rotation = earth.position[0]

        self.assertAlmostRelativeEquals(-position_at_start,
                                        position_after_half_a_rotation, 2)

        instance.evolve_model(1.75 | units.yr)

        position_after_quarter_a_rotation = earth.position[1]

        self.assertAlmostRelativeEquals(position_at_start,
                                        position_after_quarter_a_rotation, 2)

        instance.stop()
Exemple #2
0
    def test3(self):
        instance = AarsethZare(nbody_system.nbody_to_si(1.0 | units.yr, 1.0 | units.MSun))
        
        particles = self.new_system_of_sun_and_earth_and_moon()
        instance.particles.add_particles(particles)
        
        earth = instance.particles[1]
        
        position_at_start = earth.position[0]
        
        instance.evolve_model(365.0 | units.day)
        
        position_after_full_rotation = earth.position[0]
        
        self.assertAlmostRelativeEquals(position_at_start, position_after_full_rotation, 4)

        instance.evolve_model(1.5 | units.yr)
        
        position_after_half_a_rotation = earth.position[0]
        
        self.assertAlmostRelativeEquals(-position_at_start, position_after_half_a_rotation, 2)
        
        instance.evolve_model(1.75 | units.yr)
        
        position_after_quarter_a_rotation = earth.position[1]
        
        self.assertAlmostRelativeEquals(position_at_start, position_after_quarter_a_rotation, 2)
    
        instance.stop()
Exemple #3
0
 def test0(self):
     instance = AarsethZare()
     instance.stop()
Exemple #4
0
 def test0(self):
     instance = AarsethZare()
     instance.stop()