Skip to main content

One-dimensional gravitational N-body code

Project description

A one-dimensional gravitational N-body code.

Build Status Coverage Status Binder

Overview

wendy solves the one-dimensional gravitational N-body problem to machine precision with an efficient algorithm [O(log N) / particle-collision]. Alternatively, it can solve the problem with approximate integration, but with exact forces.

Author

Jo Bovy (University of Toronto): bovy - at - astro - dot - utoronto - dot - ca

Installation

Clone/fork/download the repository and install using

sudo python setup.py install

or locally using

python setup.py install --user

Usage

Use wendy.nbody to initialize a generator object for initial (x,v) with masses m. The generator then returns the state of the system at equally-spaced time intervals:

g= wendy.nbody(x,v,m,0.05) # delta t = 0.05
next_x, next_v= next(g) # at t=0.05
next_x, next_v= next(g) # at t=0.10
...

The generator initialization with wendy.nbody has options to (a) solve the problem exactly or not using approx= and (b) include an external harmonic oscillator potential omega^2 x^2 / 2 with omega= (both for exact and approximate solutions).

Examples

You can run these without installing wendy by clicking on Binder and navigating to the examples/ directory. Note that some of the movies might fail to be rendered on the binder webpage, so you might want to skip those when running the notebooks (or changing the subsamp input for them).

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

wendy-0.1.tar.gz (11.0 kB view details)

Uploaded Source

File details

Details for the file wendy-0.1.tar.gz.

File metadata

  • Download URL: wendy-0.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wendy-0.1.tar.gz
Algorithm Hash digest
SHA256 f65fee7684c605fe43d1fd54cc3b7ab48eebd0edab10aceee78b5d7e55cc6a50
MD5 90d97b737cfd99f524ab05fee4fb065e
BLAKE2b-256 81f6fa9100913a8cd4bd98e19d24d08022a8dca15884867aacc2508aeac95284

See more details on using hashes here.

Supported by

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