GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - daodavid/gravity-simulation: Python package for calculation and simulation of n-bodies interaction.

BranchesTags
Open more actions menu

Latest commit

 

History

175 Commits
175 Commits

Folders and files

NameName
Last commit message
Last commit date
New folder
New folder
 
 
docs
docs
 
 
examples
examples
 
 
gravity_simulation
gravity_simulation
 
 
notebooks
notebooks
 
 
resources
resources
 
 
.gitignore
.gitignore
 
 
LICENSE.txt
LICENSE.txt
 
 
README.md
README.md
 
 
local_deploy.py
local_deploy.py
 
 
setup.py
setup.py
 
 

Repository files navigation

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 ...
Documentation










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.

About

Python package for calculation and simulation of n-bodies interaction.

Topics

gravitygravity-simulatorguvectorizeleap-frog-optimizerleapfrogmechanicsn-body-simulatornumbanumpynutonmotionspythonquadtree

Resources

Readme
MIT license
Activity

Stars

30 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.