Exemplo n.º 1
0
def new_system():
    '''
    Define the bodies here:
    '''
    particles = Particles(3)
    planet_1 = particles[0]
    planet_1.mass = 1.0 | units.MSun
    planet_1.radius = 1.0 | units.RSun
    planet_1.position = (855251, -804836, -3186) | units.km
    planet_1.velocity = (7.893, 11.894, 0.20642) | (units.m / units.s)

    planet_2 = particles[1]
    planet_2.mass = 0.0025642 | units.MJupiter
    planet_2.radius = 3026.0 | units.km
    planet_2.position = (-0.3767, 0.60159, 0.03930) | units.AU
    planet_2.velocity = (-29.7725, -18.849, 0.795) | units.kms

    planet_3 = particles[2]
    planet_3.mass = 1.0 | units.MEarth
    planet_3.radius = 1.0 | units.REarth
    planet_3.position = (-0.98561, 0.0762, -7.847e-5) | units.AU
    planet_3.velocity = (-2.927, -29.803, -0.0005327) | units.kms

    particles.move_to_center()
    return particles
Exemplo n.º 2
0
def bbh_hvgc(bbh_mass, mass_ratio, bbh_separation, bbh_phase, gc_closest,
             gc_vinf):
    """Creates particle list, defines circular-planar BBH orbit, places GC. """
    bh1_mass = bbh_mass / (1 + mass_ratio)
    bh2_mass = mass_ratio * bh1_mass
    r1, r2, v1, v2 = bbh_orbit(bbh_mass, mass_ratio, bbh_separation)

    particles = Particles(3)
    bh1 = particles[0]
    bh1.mass = bh1_mass
    bh1.position = (r1 * math.cos(bbh_phase), r1 * math.sin(bbh_phase),
                    0 | units.km)
    bh1.velocity = (-v1 * math.sin(bbh_phase), v1 * math.cos(bbh_phase),
                    0 | units.kms)
    #bh1.position = (0,r1,0)
    #bh1.velocity = (-v1,0,0)

    bh2 = particles[1]
    bh2.mass = bh2_mass
    bh2.position = (-r2 * math.cos(bbh_phase), -r2 * math.sin(bbh_phase),
                    0 | units.km)
    bh2.velocity = (v2 * math.sin(bbh_phase), -v2 * math.cos(bbh_phase),
                    0 | units.kms)
    #    bh2.position = (0,-r2,0)
    #    bh2.velocity = (v1,0,0)

    b = impact_parameter(bbh_mass, gc_closest, gc_vinf)
    hvgc = particles[2]
    hvgc.mass = 1.0e7 | units.MSun
    hvgc.position = (b, -100, 0) | units.parsec
    hvgc.velocity = (0 | units.kms, gc_vinf, 0 | units.kms)

    particles.move_to_center()

    return particles
def body_init_sun_jupiter():
    particles = Particles(2)

    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.radius = 1.0 | units.RSun
    sun.position = (855251, -804836, -3186) | units.km
    sun.velocity = (7.893, 11.894, 0.20642) | (units.m / units.s)

    jupiter = particles[1]
    jupiter.mass = 1.0 | units.MJupiter
    jupiter.radius = 1.0 | units.RJupiter
    jupiter.position = (-4.9829, 2.062, -0.10990) | units.AU
    jupiter.velocity = (-5.158, -11.454, 0.13558) | units.kms

    particles.move_to_center()

    return particles
Exemplo n.º 4
0
def body_init(v1, v2, m3):  # Initial condition (mass, coordinates, velocities)
    particles = Particles(3)
    body0 = particles[0]
    body0.mass = 1.0 | nbody_system.mass
    body0.position = (-1, 0., 0.) | nbody_system.length
    body0.velocity = (v1, v2, 0) | nbody_system.speed

    body1 = particles[1]
    body1.mass = 1.0 | nbody_system.mass
    body1.position = (1., 0., 0.) | nbody_system.length
    body1.velocity = (v1, v2, 0.) | nbody_system.speed

    body2 = particles[2]
    body2.mass = m3 | nbody_system.mass
    body2.position = (0., 0., 0.) | nbody_system.length
    body2.velocity = (-2 * v1 / m3, -2 * v2 / m3, 0.) | nbody_system.speed

    particles.move_to_center()
    return particles
def body_init():
    particles = Particles(3)
    body0 = particles[0]
    body0.mass = 1.0 | nbody_system.mass
    body0.position = (-1., 0., 0.) | nbody_system.length
    body0.velocity = (v1, v2, 0.) | nbody_system.speed

    body1 = particles[1]
    body1.mass = 1.0 | nbody_system.mass
    body1.position = (1., 0., 0.) | nbody_system.length
    body1.velocity = (v1, v2, 0.) | nbody_system.speed

    body2 = particles[2]
    body2.mass = m3 | nbody_system.mass
    body2.position = (0., 0., 0.) | nbody_system.length
    body2.velocity = (-2 / m3 * v1, -2 / m3 * v2, 0.) | nbody_system.speed

    particles.move_to_center()
    return particles
Exemplo n.º 6
0
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | nbody_system.mass
    #sun.radius = 1.0 | units.RSun
    sun.position = (-1, 0., 0.) | nbody_system.length
    sun.velocity = (v1, v2, 0) | nbody_system.speed

    venus = particles[1]
    venus.mass = 1.0 | nbody_system.mass
    #venus.radius = 1.0 | units.RSun
    venus.position = (1., 0., 0.) | nbody_system.length
    venus.velocity = (v1, v2, 0.) | nbody_system.speed

    earth = particles[2]
    earth.mass = 0.5 | nbody_system.mass
    #earth.radius = 1.0 | units.RSun
    earth.position = (0., 0., 0.) | nbody_system.length
    earth.velocity = (-4 * v1, -4 * v2, 0.) | nbody_system.speed

    particles.move_to_center()
    return particles
Exemplo n.º 7
0
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.radius = 1.0 | units.RSun
    sun.position = (855251, -804836, -3186) | units.km
    sun.velocity = (7.893, 11.894, 0.20642) | (units.m / units.s)

    venus = particles[1]
    venus.mass = 0.0025642 | units.MJupiter
    venus.radius = 3026.0 | units.km
    venus.position = (-0.3767, 0.60159, 0.03930) | units.AU
    venus.velocity = (-29.7725, -18.849, 0.795) | units.kms

    earth = particles[2]
    earth.mass = 1.0 | units.MEarth
    earth.radius = 1.0 | units.REarth
    earth.position = (-0.98561, 0.0762, -7.847e-5) | units.AU
    earth.velocity = (-2.927, -29.803, -0.0005327) | units.kms

    particles.move_to_center()
    return particles
Exemplo n.º 8
0
def new_system():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.radius = 1.0 | units.REarth
    sun.position = (1, 0, 0) | units.AU
    sun.velocity = (0, 0, 20) | units.kms

    venus = particles[1]
    venus.mass = 1.0 | units.MSun
    venus.radius = 1.0 | units.REarth
    venus.position = (0, -1, 0) | units.AU
    venus.velocity = (20, 0, 0) | units.kms

    earth = particles[2]
    earth.mass = 1.0 | units.MSun
    earth.radius = 1.0 | units.REarth
    earth.position = (0, 0, -1) | units.AU
    earth.velocity = (0, 20, 0) | units.kms

    particles.move_to_center()
    return particles
Exemplo n.º 9
0
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.position = (0.0,0.0,0.0) | units.m
    sun.velocity = (0.0,0.0,0.0) | (units.m/units.s)
    sun.radius = 1.0 | units.RSun

    venus = particles[1]
    venus.mass = 0.0025642 | units.MJupiter
    venus.radius = 3026.0 | units.km
    venus.position = (0.6335, 0.3499, -0.03179) | units.AU
    venus.velocity = (-17.0420, 30.5055, 1.4004) | units.kms

    earth = particles[2]
    earth.mass = 5.9736e24 | units.kg
    earth.radius = 6371.0 | units.km
    earth.position = (0.2421, -0.9875, -0.00004) | units.AU
    earth.velocity = (28.4468, 6.98125, 0.0002) | units.kms

    particles.move_to_center()
    return particles
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.kg
    #sun.radius = 1e-2 | units.m
    sun.position = (-1, 0, 0) | units.m
    sun.velocity = (v1, v2, 0) | (units.m / units.s)

    venus = particles[1]
    venus.mass = 1.0 | units.kg
    #venus.radius = 1e-2 | units.m
    venus.position = (1, 0, 0) | units.m
    venus.velocity = (v1, v2, 0) | (units.m / units.s)

    earth = particles[2]
    earth.mass = 0.5 | units.kg
    #earth.radius = 1e-2 | units.m
    earth.position = (0, 0, 0) | units.m
    earth.velocity = (-4 * v1, -4 * v2, 0) | (units.m / units.s)

    particles.move_to_center()
    return particles
Exemplo n.º 11
0
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.position = (0.0, 0.0, 0.0) | units.m
    sun.velocity = (0.0, 0.0, 0.0) | (units.m / units.s)
    sun.radius = 1.0 | units.RSun

    venus = particles[1]
    venus.mass = 0.0025642 | units.MJupiter
    venus.radius = 3026.0 | units.km
    venus.position = (0.6335, 0.3499, -0.03179) | units.AU
    venus.velocity = (-17.0420, 30.5055, 1.4004) | units.kms

    earth = particles[2]
    earth.mass = 5.9736e24 | units.kg
    earth.radius = 6371.0 | units.km
    earth.position = (0.2421, -0.9875, -0.00004) | units.AU
    earth.velocity = (28.4468, 6.98125, 0.0002) | units.kms

    particles.move_to_center()
    return particles
Exemplo n.º 12
0
def sun_venus_and_earth():
    particles = Particles(3)
    sun = particles[0]
    sun.mass = 1.0 | units.MSun
    sun.radius = 1.0 | units.RSun
    sun.position = (855251, -804836, -3186) |units.km
    sun.velocity = (7.893, 11.894, 0.20642) | (units.m/units.s)

    venus = particles[1]
    venus.mass = 0.0025642 | units.MJupiter
    venus.radius = 3026.0 | units.km
    venus.position = (-0.3767, 0.60159, 0.03930) | units.AU
    venus.velocity = (-29.7725, -18.849, 0.795) | units.kms

    earth = particles[2]
    earth.mass = 1.0 | units.MEarth
    earth.radius = 1.0 | units.REarth
    earth.position = (-0.98561, 0.0762, -7.847e-5) | units.AU  
    earth.velocity = (-2.927, -29.803, -0.0005327) | units.kms

    particles.move_to_center()
    return particles