Skip to content

bc-li/NbodySimulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBodySimulator: a mini 3D multibody simulator made for CPII 2020

Build Status CI Python application

This is my mini project for n-body problem for Computer Programming II 2020 Spring in USTC.

Source: https://introcs.cs.princeton.edu/python/34nbody/

Princeton used their own API based on a 2D toolkit "pygame". So I used numpy instead to meet current needs.

Directory Structure

├─.travis.yml // Travis CI config
├─my_project // my project and testcase.
└─Princeton_sample // samples given by Princeton

Getting Started

Clone this repo, move directly into my_project directory and run nbodysimulation.py.

Dependencies

  • Matplotlib
  • Numpy

Run the project

  • Install all the dependencies before you start running this demo

  • Run cd path_to_the_file_you_cloned in Windows Terminal

  • Run python nbodysimulator.py

  • Input the parameters following the instruction given. For example:

    • Input the number of material points you want to simulate and their mass (KG) , velocity and position.
    • Among them, the velocity and position needs to be in the form of numpy vector like [x,y,z].
  • See the results.

Commit History & Changes

May 21, 2020: Sample given by princeton updated. Test ok.

Jul 24, 2020: Finish adding runnable 3 & 2 body simulators. Test OK.

Jul 27, 2020: Finish the project.

About

A 3D multibody simulator made for CPII 2020

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages