Python package for calculation and simulation of n-bodies interaction under the influence of Gravity force.Written in NumPy and Numba.
pip install gravity-simulation==2.0.1
#random example together with one body bigger mass than others
from gravity_simulation.gravity import *
field.generate_random(15, mass=[20, 500], r=[-5, 5], velocity=[-5, 5], alpha=[0, 360])
field.add_body(Body(x0=0, y0=0,v_x=0, v_y=0, mass = 3000))
field.run(1300, C=0.01)
field.save_animation(frames=50,name='my_example',reduce_size_body=50,frames=150)