Skip to content

Simple python script that simulates gravity through direct sum.

License

Notifications You must be signed in to change notification settings

elvismello/particleSim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

particleSim

Simple python script that simulates gravity through direct sum.

This version uses natural units where the gravitational constant is .

Example dataPlanets.txt uses real data (that can be verified in ICexamples/data) and normalizes positions, velocities and mass to make a solar system simulation.

Usage

Currently, the code needs to have configured manually all plot parameters, which means that most customization is done in the code itself rather than using argparser or other tool.

It should work out-of-the-box just by executing python3 simulation.py.

This code also makes use of Numpy, which can be installed with python3 -m pip install numpy.

Initial Conditions

Initial conditions are read by numpy.loadtxt() as a text file written as a matrix, where each line corresponds to a particle and the columns must be in the order m x y z vx vy vz, where m stands for mass, x y z correlates to cartesian coordinates and vx vy vz are the cartesian velocities.

About

Simple python script that simulates gravity through direct sum.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages