A package for gravitational simulations
Project description
gravitational
A package for gravitational simulations
Installation
You can install the latest version of gravitational from PyPI:
pip install gravitational
The only requirements are numpy and matplotlib.
How to use
An example of simulating the inner planets:
from gravitational.simulation import Simulation
from gravitational.solar_system import Constant, initial_state
t = '2021-02-17 04:26:00'
sim = Simulation(t)
c = Constant()
p0_sun, v0_sun = initial_state('sun', t)
p0_venus, v0_venus = initial_state('venus', t)
p0_earth, v0_earth = initial_state('earth', t)
s = sim.add_body(name='Sun', color='y', size=25, mass=c.m_sun,
position=p0_sun, velocity=v0_sun)
v = sim.add_body(name='Venus', color='k', size=8, mass=c.m_venus,
position=p0_venus, velocity=v0_venus)
e = sim.add_body(name='Earth', color='b', size=10, mass=c.m_earth,
position=p0_earth, velocity=v0_earth)
sim.play(path=True)
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
gravitational-0.1.0.tar.gz
(8.4 kB
view details)
Built Distribution
File details
Details for the file gravitational-0.1.0.tar.gz
.
File metadata
- Download URL: gravitational-0.1.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93014b56b3f19f67200d1427188839cf3330e2af225602489349e70ffcae7abd |
|
MD5 | f90fd2bed8ac2e0627a9d6d4c78f324c |
|
BLAKE2b-256 | 5df5f8a5921d877ddcac14b479b2c3967fb19fccb852b485cf780eedc4ae885e |
File details
Details for the file gravitational-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: gravitational-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d29e40e2769a18fbdfaca9f8f581ec8932d957149317657463fc49bc669c526 |
|
MD5 | 82d090b8ed4bd5080862d2c08c23f78e |
|
BLAKE2b-256 | 2aae465cbeae80523ebc93f4452e3c2364fff6dd54ffc0dc2f647fbf9a6576ca |