Author: Behrouz Safari
License: MIT
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 initial_state
from gravitational.constants import Constant
# Define the time as a datetime object or a string (default now)
t = '2021-02-17 04:26:00'
sim = Simulation(t)
c = Constant()
# Get initial states from Horizons API
p0_sun, v0_sun = initial_state('sun', t)
p0_venus, v0_venus = initial_state('venus', t)
p0_earth, v0_earth = initial_state('earth', t)
# Add bodies
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)
# Run and play the simulation
sim.play(path=True)
Metadata
Release files for gravitational 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| gravitational-0.2.2.tar.gz | 9.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gravitational-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.3 kB
Release files / gravitational-0.2.2.tar.gz
| Download URL | gravitational-0.2.2.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffdde7dc0c23a1ea343b60973daae5cfc4e584a6c958a7bc3584b7b33740999b
|
|
BLAKE2b-256 checksum How to use checksums |
1acfd3e367387933bd0a48b164c21f99208c696ecdf50f747733f09f441167a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / gravitational-0.2.2-py3-none-any.whl
| Download URL | gravitational-0.2.2-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
49d087cbc4c76cd4fd78dd9976749886e0a25389a09c35ea87c08fe94f50ac4a
|
|
BLAKE2b-256 checksum How to use checksums |
c6e2f2785fd8747076270da79f5713d2c0bdbb60e15a287fc2b657364beb351f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for gravitational 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.