sSystem1.addBodyFromFile("EARTH") sSystem1.addBodyFromFile("JUPITER") sSystem1.planets[1].mass = 10 * sSystem1.planets[1].mass sSystem1.exportValues("kojr_e1.npy") sSystem1.simulate("kojr_e1.npy", "ut_e1.txt", time = 30, dt = 1e-5, acc_func=2) sSystem2 = solarsystem.solsys() sSystem2.addBodyFromFile("EARTH") sSystem2.addBodyFromFile("JUPITER") sSystem2.planets[1].mass = 1000 * sSystem2.planets[1].mass sSystem2.exportValues("kojr_e2.npy") sSystem2.simulate("kojr_e2.npy", "ut_e2.txt", time = 30, dt = 1e-5, acc_func=2) sSystem3 = solarsystem.solsys() sSystem3.addBodyFromFile("EARTH") sSystem3.addBodyFromFile("JUPITER") sSystem3.addSun("SUN", 1) sSystem3.exportValues("kojr_e3.npy") sSystem3.simulate("kojr_e3.npy", "ut_e3.txt", time = 20, dt = 1e-5, acc_func=3) """ sSystem4 = solarsystem.solsys() sSystem4.addAllPlanets() sSystem4.addSun("SUN", 1) sSystem4.exportValues("kojr_e4.npy") sSystem4.simulate("kojr_e4.npy", "ut_e4.txt", time = 500, dt = 1e-3, acc_func=3)
from solarsystem import solsys import numpy as np solarsystem = solsys() solarsystem.addBodyFromFile("EARTH") solarsystem.exportInitialValues("startValues.npy") solarsystem.simulate("startValues.npy", "orbitsTest.txt", time=10000, acc_func=1, int_func=1, dt=1e-2) solarsystem.simulate("startValues.npy", "orbitsTest.txt", time=10000, acc_func=1, int_func=2, dt=1e-2)
from solarsystem import solsys import numpy as np ss = solsys() ### g = 4 * np.pi**2 v = np.sqrt(g) pos = [1, 0, 0] vel = [0, 0.99 * np.sqrt(2) * v / 365.2242, 0] time = 2000 ### ss.addBody("EARTH", vel, pos, 1e-6) ss.exportInitialValues("startValues.npy") ss.simulate("startValues.npy", "orbits.txt", time=time, dt=1e-4)
# -*- coding: utf-8 -*- """ Created on Wed Oct 24 21:56:29 2018 @author: Bendik """ import numpy as np import solarsystem sSystem3 = solarsystem.solsys() sSystem3.addBodyFromFile("MERCURY") sSystem3.planets[0].pos0 = [0.3075, 0, 0] sSystem3.planets[0].vel0 = [0, -12.44, 0] sSystem3.exportValues("kojr_g.npy") sSystem3.simulate("kojr_g.npy", "ut_e3.txt", time=100, dt=1e-4, acc_func=5)