def new_lunar_system_in_time(time_JD=2457099.5|units.day): """ Initial conditions of Solar system -- particle set with the sun + eight moons, at the center-of-mass reference frame. Defined attributes: name, mass, radius, x, y, z, vx, vy, vz """ time_0 = 2457099.5 | units.day delta_JD = time_JD-time_0 solar_system = solar_system_in_time(time_JD) solar_system[0].type = "star" solar_system[0].name = "sun" solar_system[1:].type = "planet" for pi in solar_system: moons = get_moons_for_planet(pi, delta_JD=delta_JD) solar_system.add_particles(moons) solar_system.move_to_center() ### to compare with JPL, relative positions and velocities need to be corrected for the # Sun's vectors with respect to the barycenter #r_s = (3.123390770608490E-03, -4.370830943817017E-04, -1.443425433116342E-04) | units.AU #v_s = (3.421633816761503E-06, 5.767414405893875E-06, -8.878039607570240E-08) | (units.AU / units.day) #print sun #print moons.position.in_(units.AU) + r_s #print moons.velocity.in_(units.AU/units.day) + v_s return solar_system
def new_lunar_system_in_time(time_JD=2457099.5 | units.day): """ Initial conditions of Solar system -- particle set with the sun + eight moons, at the center-of-mass reference frame. Defined attributes: name, mass, radius, x, y, z, vx, vy, vz """ time_0 = 2457099.5 | units.day delta_JD = time_JD - time_0 solar_system = solar_system_in_time(time_JD) solar_system[0].type = "star" solar_system[0].name = "sun" solar_system[1:].type = "planet" for pi in solar_system: moons = get_moons_for_planet(pi, delta_JD=delta_JD) solar_system.add_particles(moons) solar_system.move_to_center() ### to compare with JPL, relative positions and velocities need to be corrected for the # Sun's vectors with respect to the barycenter #r_s = (3.123390770608490E-03, -4.370830943817017E-04, -1.443425433116342E-04) | units.AU #v_s = (3.421633816761503E-06, 5.767414405893875E-06, -8.878039607570240E-08) | (units.AU / units.day) #print sun #print moons.position.in_(units.AU) + r_s #print moons.velocity.in_(units.AU/units.day) + v_s return solar_system
def get_nice_model_conditions(): converter = nbody_system.nbody_to_si(1 | units.MSun, 1 | units.AU) time_0 = 2457099.5 | units.day time_JD = 2457099.5 | units.day delta_JD = time_JD - time_0 solar_system = solar_system_in_time(time_JD) solar_system.hosttype = "star" solar_system[0].type = "star" solar_system[0].name = "sun" solar_system[1:].type = "planet" solar_system[1:].hostname = "sun" sun = solar_system[solar_system.name == "sun"] solar_system.position -= sun.position solar_system.velocity -= sun.velocity nice_system = Particles() nice_system.add_particle(sun) nice_system.name = "Sun" nice_system.type = "star" sma = 15 | units.AU for name in names: planet = rescale_planetary_orbit(sun, solar_system, name, sma) nice_system.add_particles(planet) porb = 1. / 2. * orbital_period(sun.mass, sma) sma = semimajor_axis(sun.mass, porb) nice_system.move_to_center() return nice_system
pyplot.text(0.0031, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(45000|units.yr): pyplot.text(0.0028, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(55000|units.yr): pyplot.text(0.0021, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(65000|units.yr): pyplot.text(0.0017, e+0.002, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(75000|units.yr): pyplot.text(0.0014, e-0.002, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(85000|units.yr): pyplot.text(0.0014, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") else: pyplot.text((a-a0).value_in(units.AU), e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") gravity.evolve_model(gravity.model_time + dt) channel_from_to_SunEarth.copy() gravity.stop() pyplot.xlabel(x_label) pyplot.ylabel(y_label) # pyplot.show() pyplot.savefig("EarthOrbitVariation") return if __name__ in ('__main__','__plot__'): particles = solar_system_in_time(time_JD=2474649.5|units.day) integrate_solar_system(particles, 84000 | units.yr)
pyplot.text(0.0028, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(55000|units.yr): pyplot.text(0.0021, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(65000|units.yr): pyplot.text(0.0017, e+0.002, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") elif gravity.model_time<=(75000|units.yr): pyplot.text(0.0014, e-0.002, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") #elif gravity.model_time<=(85000|units.yr): # pyplot.text(0.0014, e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") else: pass # pyplot.text((a-a0).value_in(units.AU), e, "{0:.0f}".format(0.001*gravity.model_time.value_in(units.yr))+"kyr") gravity.evolve_model(gravity.model_time + dt) channel_from_to_SunEarth.copy() gravity.stop() pyplot.xlabel(x_label) pyplot.ylabel(y_label) pyplot.xlim(-0.001, 0.004) # pyplot.show() pyplot.savefig("EarthOrbitVariation") return if __name__ in ('__main__','__plot__'): particles = solar_system_in_time(time_JD=2474649.5|units.day) integrate_solar_system(particles, 84000 | units.yr)