def simulation(par):
    saturn_a, saturn_e = par
    rebound.reset()
    rebound.integrator = "whfast-nocor"
    rebound.min_dt = 5.
    rebound.dt = 1.

    # These parameters are only approximately those of Jupiter and Saturn.
    sun = rebound.Particle(m=1.)
    rebound.add(sun)
    jupiter = rebound.add(primary=sun,
                          m=0.000954,
                          a=5.204,
                          anom=0.600,
                          omega=0.257,
                          e=0.048)
    saturn = rebound.add(primary=sun,
                         m=0.000285,
                         a=saturn_a,
                         anom=0.871,
                         omega=1.616,
                         e=saturn_e)

    rebound.move_to_com()
    rebound.init_megno(1e-16)
    rebound.integrate(1e3 * 2. * np.pi)

    return [
        rebound.calculate_megno(),
        1. / (rebound.calculate_lyapunov() * 2. * np.pi)
    ]  # returns MEGNO and Lypunov timescale in years
def simulation(par):
    saturn_a, saturn_e = par
    rebound.reset()
    rebound.integrator = "whfast-nocor"
    rebound.dt = 5.
    
    # These parameters are only approximately those of Jupiter and Saturn.
    rebound.add(m=1.)
    rebound.add(m=0.000954, a=5.204, anom=0.600, omega=0.257, e=0.048)
    rebound.add(m=0.000285, a=saturn_a, anom=0.871, omega=1.616, e=saturn_e)

    rebound.move_to_com()
    rebound.init_megno(1e-16)
    rebound.integrate(5e2*2.*np.pi) # integrator for 500 years

    return [rebound.calculate_megno(),1./(rebound.calculat_lyapunov()*2.*np.pi)] # returns MEGNO and Lypunov timescale in years
Example #3
0
def simulation(integrator):
    print("Running "+integrator)
    with open(integrator+".txt","w") as f:
        rebound.reset()
        rebound.integrator = integrator
        rebound.dt = 0.2
            
        rebound.add(m=1.)
        rebound.add(m=0.01, a=1,e=0.1)
        rebound.add(m=0.01, a=2.)

        rebound.move_to_com()
        rebound.init_megno(1e-10)
        particles = rebound.particles
        times = np.logspace(2,5,num=1000)
        for t in times:
            rebound.integrate(t,0)
            print("%e %e %e %e %e %e %e %e\n" %(rebound.t, rebound.calculate_megno(), particles[0].x, particles[1].x, particles[2].x, particles[3].x, particles[4].x, particles[5].x),file=f)
def simulation(par):
    saturn_a, saturn_e = par
    rebound.reset()
    rebound.integrator = "whfast-nocor"
    rebound.min_dt = 5.
    rebound.dt = 1.
    
    # These parameters are only approximately those of Jupiter and Saturn.
    sun     = rebound.Particle(m=1.)
    rebound.add(sun)
    jupiter = rebound.add(primary=sun,m=0.000954, a=5.204, anom=0.600, omega=0.257, e=0.048)
    saturn  = rebound.add(primary=sun,m=0.000285, a=saturn_a, anom=0.871, omega=1.616, e=saturn_e)

    rebound.move_to_com()
    rebound.init_megno(1e-16)
    rebound.integrate(1e3*2.*np.pi)

    return [rebound.calculate_megno(),1./(rebound.calculate_lyapunov()*2.*np.pi)] # returns MEGNO and Lypunov timescale in years
Example #5
0
def simulation(par):
    saturn_a, saturn_e = par
    rebound.reset()
    rebound.integrator = "whfast-nocor"
    rebound.dt = 5.

    # These parameters are only approximately those of Jupiter and Saturn.
    rebound.add(m=1.)
    rebound.add(m=0.000954, a=5.204, anom=0.600, omega=0.257, e=0.048)
    rebound.add(m=0.000285, a=saturn_a, anom=0.871, omega=1.616, e=saturn_e)

    rebound.move_to_com()
    rebound.init_megno(1e-16)
    rebound.integrate(5e2 * 2. * np.pi)  # integrator for 500 years

    return [
        rebound.calculate_megno(),
        1. / (rebound.calculat_lyapunov() * 2. * np.pi)
    ]  # returns MEGNO and Lypunov timescale in years
Example #6
0
def simulation(integrator):
    print("Running " + integrator)
    with open(integrator + ".txt", "w") as f:
        rebound.reset()
        rebound.integrator = integrator
        rebound.dt = 0.2

        rebound.add(m=1.)
        rebound.add(m=0.01, a=1, e=0.1)
        rebound.add(m=0.01, a=2.)

        rebound.move_to_com()
        rebound.init_megno(1e-10)
        particles = rebound.particles
        times = np.logspace(2, 5, num=1000)
        for t in times:
            rebound.integrate(t, 0)
            print("%e %e %e %e %e %e %e %e\n" %
                  (rebound.t, rebound.calculate_megno(), particles[0].x,
                   particles[1].x, particles[2].x, particles[3].x,
                   particles[4].x, particles[5].x),
                  file=f)