Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/daodavid/gravity-simulation
Python package for calculation and simulation of n-bodies interaction.
https://github.com/daodavid/gravity-simulation
gravity gravity-simulator guvectorize leap-frog-optimizer leapfrog mechanics n-body-simulator numba numpy nutonmotions python quadtree
Last synced: about 9 hours ago
JSON representation
Python package for calculation and simulation of n-bodies interaction.
- Host: GitHub
- URL: https://github.com/daodavid/gravity-simulation
- Owner: daodavid
- License: mit
- Created: 2019-05-29T08:46:16.000Z (over 5 years ago)
- Default Branch: gh-pages
- Last Pushed: 2023-04-20T19:36:22.000Z (over 1 year ago)
- Last Synced: 2024-12-15T12:38:27.575Z (about 1 month ago)
- Topics: gravity, gravity-simulator, guvectorize, leap-frog-optimizer, leapfrog, mechanics, n-body-simulator, numba, numpy, nutonmotions, python, quadtree
- Language: HTML
- Homepage:
- Size: 196 MB
- Stars: 28
- Watchers: 2
- Forks: 5
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Gravity simulation
### Python package for calculation and simulation of n-bodies interaction under the influence of Gravity force.Written in NumPy and Numba.
### Installing :
```
pip install gravity-simulation==2.0.1```
### Example :```
#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)```
[more ... ](https://github.com/daodavid/gravity-simulation/tree/gh-pages/examples)
[Documentation](https://github.com/daodavid/gravity-simulation/tree/gh-pages/ddocs)
##### Nympy is an incredible library and without it, The Python is nothing (just an easy programming language and so on), but with the Numpy, The Python is able to solve serious processes involved a huge number of iterations. When the application was written in common Python then the results were quite bad, for example, when the number of bodies is 2000 and number of the iterations is 10000 the duration of the process takes about 2 days because of the app was useless now when the processes are vectorized with NumPy and Numba the execution time takes about 2 hours.