Esempio n. 1
0
from matplotlib import animation

from Orbits import ydot_orbit_3d, trapezium_orbit, trapstep

# Choose random starting points, uniformly distributed from -15 to 15
jupiter = {
    'xp': -3.5023653,
    'xv': 0.00565429,
    'yp': -3.8169847,
    'yv': -0.00412490,
    'zp': -1.5507963,
    'zv': -0.00190589,
    'm': 0.000954786104043
}
jupiter_traj = trapezium_orbit(ydot_orbit_3d, [
    jupiter['xp'], jupiter['xv'], jupiter['yp'], jupiter['yv'], jupiter['zp'],
    jupiter['zv']
], jupiter['m'], 0, 100000, 1000, 3)
saturn = {
    'xp': 9.0755314,
    'xv': 0.00168318,
    'yp': -3.0458353,
    'yv': 0.00483525,
    'zp': -1.6483708,
    'zv': 0.00192462,
    'm': 0.000285583733151
}
uranus = {
    'xp': 8.3101420,
    'xv': 0.00354178,
    'yp': -16.2901086,
    'yv': 0.00127102,
Esempio n. 2
0
from Orbits import trapezium_orbit, trapstep, ydot_orbit_3d

# PARAMETERS OF THE CURVE AND THE GIF

jupiter = {
    'xp': -3.5023653,
    'xv': 0.00565429,
    'yp': -3.8169847,
    'yv': -0.00412490,
    'zp': -1.5507963,
    'zv': -0.00190589,
    'm': 0.000954786104043
}

jupiter_traj, jupiter_quant = trapezium_orbit(ydot_orbit_3d, [
    jupiter['xp'], jupiter['xv'], jupiter['yp'], jupiter['yv'], jupiter['zp'],
    jupiter['zv']
], jupiter['m'], 0, 100000, 1000, 3)

curve_latex = (r"$\left(\,\, \cos(80t) - \cos(t^3),\,\,\," +
               r"\sin(t) -  \sin(80t)^3 \,\,\right)$")
### increase fps to increase number of steps
gif_name = "test.gif"
gif_duration = 5
gif_fps = 10

# PRECOMPUTE THE CURVE

t_min = 0
t_max = 1000
number_of_points = 1000