Skip to content

The N-bodies problem is well known in the literature. One of its principal features is the lack of an analytical solution for every instant of time. Nevertheless,it is possible to coumpute the following configurations in time, knowing an inicial configuration (the mass, inicial position and inicial velocity of each body).

License

Andresfgomez970/N-body-simulation-in-Vpython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N-body-simulation-in-Vpython

The N-bodies problem is well known in the literature. One of its principal features is the lack of an analytical solution for every instant of time. Nevertheless,it is possible to coumpute the following configurations in time, knowing an inicial configuration (the mass, inicial position and inicial velocity of each body).

Getting Started

The program takes a file with the following form:
m px py pz vx vy vz
----------------------------------------(here begins the file)
m1 x11 x12 x13 v11 v12 v13
.
.
.
mi xi1 xi2 xi3 vi1 vi2 vi3
.
.
.
mN xN1 xN2 xN3 vN1 vN2 vN3
-----------------------------------------(here finishes)

where pi is position in the i-axis, vi is the velocity on the i-axis, and m the mass (mi the one of the ith-body). So, xi2 is for example the intial position on y of the body i.

Several sonfigurations can be found in the files with termination ".ap"

Prerequisites

To run this program you need to have installed the folowing libaries of python: visual (there are some lines that can be only executed in version 6 but they are commented), and numpy.

Running the program

It is only necessary to change the input in the "generate" funtion in the file "Nbodies.py". For example to run the configurations in the 'SSthrid.ap', the line could go as follows:

obj,M = generate('SSthrid.ap')

Built With

Authors

  • Andrés Felipe Gómez
  • Luis Abelardo Papiernik

License

This project is licensed under the MIT License - see the LICENSE.md file for details

References

Acknowledgments

  • Thanks Luis for helping me and explain me how to manage classes to write this code as it is right know.

About

The N-bodies problem is well known in the literature. One of its principal features is the lack of an analytical solution for every instant of time. Nevertheless,it is possible to coumpute the following configurations in time, knowing an inicial configuration (the mass, inicial position and inicial velocity of each body).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages