Simple solution implementation of the N Body Problem of Physics
Project description
N Body Problem
A quick implementation of the N Body Problem of Celestial Mechanics
Features
-
Create Bodies with 3 initial parameters:
param dtype description mass float mass of the body pos np.array position vector <i, j, k> vel np.array scape velocity vector <i, j, k> -
Create an NBPSolver with two parameters:
param dtype description bodies list list of bodies ts float time step -
Utilize the NBPSolver method solve_timestep() to update each body's position after the specified time step has passed.
-
Call the method plot_animation(time_lim, frame_size, output), where the parameters are:
param dtype description time_lim int limit number of seconds frame_size int amount of iterations before recording a frame output string output file name (include file extension, e.g. output.gif) -
This package offers flexibility in terms of handling the output, as well as dinamically adding or removing bodies during run time.
TODO:
- Add different integration methods
- Add efficiency monitoring (*hint: create a context manager to monitor execution times)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hynbp-0.0.3.tar.gz.
File metadata
- Download URL: hynbp-0.0.3.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3725eef05119917f43fe09a0139bf071c40b07d94cbc842e8f73f56ed594809e
|
|
| MD5 |
3983bc7af050f48f9940f2e802c8f8b9
|
|
| BLAKE2b-256 |
4725748a2c6276b76ce9efdd6408d0f11d6bc0cc997efdd49e6c2cfde38f2cf2
|
File details
Details for the file hynbp-0.0.3-py3-none-any.whl.
File metadata
- Download URL: hynbp-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3f780cb5790ea0aa46f7a69719fc0773696f6e868426030cefbec59bd239c5d
|
|
| MD5 |
5fb4e6f4ff7e51ae5dcd3561a892532b
|
|
| BLAKE2b-256 |
f9ee4310ce4223f4fafec3f5a4d4aebb42183153f1d0639448fa9dce5b5f3e33
|