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 - fflopsi/twobodyproblem: A simulation of the two-body problem with VPython

BranchesTags
Open more actions menu

Latest commit

 

History

285 Commits
285 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
twobodyproblem
twobodyproblem
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

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 for inputting your data, visit this repository containing a GUI program.

Installation

(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. pip install --upgrade pip setuptools wheel
    2. pip install --upgrade twobodyproblem
  3. Now, the program is usable with python -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/fflopsi/twobodyproblem.git
    3. pip install --upgrade pip setuptools wheel
    4. pip install ./twobodyproblem/
  4. Now, the program is usable with python -m twobodyproblem.

Usage

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

Run the program with python -m twobodyproblem on a command line.

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. You can either load them from a prepared YAML file (*.yml) or type them in directly. After having them typed in, you can choose to save them in a file for later use. When saving to an existing file, the previous contents of the file will be overwritten. When working with these files, you need to have the exact paths to the files at hand. Otherwise, the default files for saving/loading will be used.

The simulation window will open 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.

About

A simulation of the two-body problem with VPython

Topics

physics-simulationpythonpython3simulationvpython

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity

Stars

2 stars

Watchers

1 watching

Forks

4 forks
Report repository

Releases

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.