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 in Python to simulate the two body problem. You type in some parameters, like mass, radius, velocity and distance. The program will show you a visualization of the simulation.

This program is command line only. If you want a graphical user interface, visit this GitHub page.

Table of Contents

Installation Instructions

Usage

Installation Instructions

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

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 GitHub (see below).

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

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.

Usage

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

Run the program with python -m twobodyproblem or python3 -m twobodyproblem.

First, 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.

The simulation will start automatically after the last input.

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-2.0.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

twobodyproblem-2.0.0-py3-none-any.whl (224.3 kB view details)

Uploaded Python 3

File details

Details for the file twobodyproblem-2.0.0.tar.gz.

File metadata

  • Download URL: twobodyproblem-2.0.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for twobodyproblem-2.0.0.tar.gz
Algorithm Hash digest
SHA256 73f29662b0059ae6b1567b926e82a063f5bbf66fcec0f5c003eac1dde6c39987
MD5 b15900ea7213ca79c19d25f31d44e495
BLAKE2b-256 37536e16246ec67d2b5bd9b72b163e0d638e63affb313253787bdc5d502daee9

See more details on using hashes here.

File details

Details for the file twobodyproblem-2.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for twobodyproblem-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 edf4fc3b64d830ad4c1a6e27fe831c8a5ae9387c75e35217c84ebaef900a518d
MD5 353bfcf2515c08f7153a1bc9935fd61b
BLAKE2b-256 96c41751cdd63caf8976e4d50e6d46a7b0a8733c4830d40816a51d2104a7c4f8

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