Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hynbp-0.0.3.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

hynbp-0.0.3-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page