Skip to main content

a little simulation for the gravitational two body problem

Project description

Two Body Problem

a small simulation

Welcome!

I wrote a small program to simulate the two body problem. You can either choose from presets (like Sun, Earth, Moon etc.) or type in your own masses and volumes. The program will show you a visualization of the simulation.

Table of Contents

Installation Instructions

Usage

Installation Instructions

via PyPi

The Python package manager pip will install the last uploaded version from the Python Package Index PyPi. This will not always be the latest version, so if you want to install all the latest features, install it from git (see below).

  1. Make sure Python and pip are installed correctly.
  2. Run pip3 install --upgrade pip setuptools wheel twobodyproblem from a command line.
  3. Now, the program is runnable with python -m twobodyproblem or python3 -m twobodyproblem.

(You may need Microsoft Visual C++ to be able to run the program, so install it from here if needed.)

via GitHub

  1. Make sure Python and pip are installed correctly.
  2. Make sure Git SCM is installed correctly.
  3. Run these commands from a command line:
    1. mkdir TwoBody and cd TwoBody
    2. git clone https://github.com/Two-Body-Problem/twobodyproblem-simulation-python.git
    3. pip3 install --upgrade pip setuptools wheel
    4. pip3 install twobodyproblem-simulation-python
  4. Now, the program is runnable with python -m twobodyproblem or python3 -m twobodyproblem.

(You may need Microsoft Visual C++ to be able to run the program, so install it from here if needed.)

Usage

To learn more about how to run the program with different options, run python -m twbodyproblem -h or python3 -m twbodyproblem -h respectively.

The program (better: the input section) can be run either with a graphical user interface (GUI) or with a command line interface (CLI).

No matter if you run the program in GUI or CLI mode, you will have to input options and values. The options define the particular behavior of the simulation, the values define the dimensions (i.e. mass, radius, distance, velocity) of the bodies.

Saving options and values is currently only supported in GUI mode. To save values, press Ctrl+S. The values will then be saved into a file. If you do this action repeatedly, the former contents of the file (i.e. the saved values) will be overwritten! To load saved values from this file, press Ctrl+L. To save or load values through a file dialog, press Ctrl+Shift+S or Ctrl+Shift+L. It works the same way for saving and loading settings from the settings window (open it with Ctrl+I). These files will be saved in the YAML format (*.yml).

In GUI mode, you can select from a few presets (e.g. Sun, Moon, Earth) to fill in some values. To do so, press Ctrl+E, select from the drop-down menu and press one of the two buttons in the lower right corner.

In CLI mode, the simulation will start automatically after the last input. To start the simulation from GUI mode, press the button in the lower right corner.

During the simulation, you are able to pause, un-pause and stop the simulation with the accordingly named buttons below the black rectangle. The restart button restarts the whole program, not just the simulation.

The sliders below the buttons can be used to magnify the bodies in the simulation. This magnification does not affect the physics, it is only a visual help.


Participation in this README is always welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twobodyproblem-1.2.0.post1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twobodyproblem-1.2.0.post1-py3-none-any.whl (223.9 kB view details)

Uploaded Python 3

File details

Details for the file twobodyproblem-1.2.0.post1.tar.gz.

File metadata

  • Download URL: twobodyproblem-1.2.0.post1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for twobodyproblem-1.2.0.post1.tar.gz
Algorithm Hash digest
SHA256 b0cea4d120f70275cb45659f68358d23dc9e4f16b919614529023fe0596f8d2a
MD5 3ea257e90ccaf28ad31b8429318b94e6
BLAKE2b-256 7728429cfc0acb8ad1b94f64154ebee94b0a66c6760e52e42258ac828f7ca408

See more details on using hashes here.

File details

Details for the file twobodyproblem-1.2.0.post1-py3-none-any.whl.

File metadata

  • Download URL: twobodyproblem-1.2.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 223.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

File hashes

Hashes for twobodyproblem-1.2.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 ce415ddee654ab8ef20769bc3f2cd9d48a8d9bd6f6be0b5e0562ec716b587d78
MD5 fe94c7f98c7f15486cbad30cd1991f29
BLAKE2b-256 f4147caffb6166ba2641382399bfcacfd8a0fac8a32d0485254abcce10387635

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page