Giter Club home page Giter Club logo

pyparticles's Introduction

PyParticles

PyParticles is a particle simulation toolbox entirely written in python.

The main objective of PyParticles is to provide a system API simple and fast to use. Furthermore is to provide a basic application for the implementation of simple models.

Download

PyParticles v0.3.5 tgz

Features

Simulate a particle by particle model with the most popular integrations methods, and it represents the results on a OpenGL or Matplotlib plot.

PyParticle includes the followings integrations methods

  1. Euler method
  2. Leap Frog method
  3. Rung Kutta method
  4. Midpoint
  5. Stormer Verlet method

As a forces model it includes:

  1. Gravity
  2. Particle by Particle spring
  3. Constant
  4. User defined field
  5. Lennard Jones
  6. Drag
  7. Damping
  8. Electromagnetic fields

We have also the possibility of modeling the forces with user-defined constraints (See demo cat_spri).

PyParticle offers an easy to use class structure with a fully interchangeable integrations method or force model, it also implements the possibility to add some boundary model.

Requirements

PyParticles require the following packages:

For more details about the installation visit the Blog: http://pyparticles.wordpress.com/installation/

Command line tool usage:

In PyParticles a simulation model is entirely described in a config file that should be edited by the user.

The following are the main command of the PyParticles application.

  • Start the demo simulation:
pyparticles_app
  • Start a simulation described in a config file
pyparticle_app <file_name>
  • Start the specified demo simulation
Demos ย 
springs 3 body springs
solar_system Simulation of the solar system with realistic magnitudes
bubble Bubbles. With a non realistic force
cat_spri Vibrating string with gravity and air drag
gas_lj Lennard jones gas model (should be improved)
elmag_field Electromagnetic field
fountain 250'000 particles fountain
pyparticles_app --demo springs
pyparticles_app --demo solar_system
pyparticles_app --demo bubble
pyparticles_app --demo cat_spri
pyparticles_app --demo gas_lj
pyparticles_app --demo elmag_field
pyparticles_app --demo fountain
  • Start a testing procedure

Execute the specified test:

pyparticles_app --test harmonic
pyparticles_app --test fall
  • Write out a model config file
pyparticle_app -m
  • Print out the help and version
pyparticles_app --help
pyparticles_app --version

During the simulation you can toggle the help message by pressing h

Config file Example:

[pset_origin]
media_origin = from_file
file_name = solar_sys.csv

[set_config]
len_unit = 149597870700.0
mass_unit = 5.9736e24
boundary = open

[model]
force = gravity
ode_solver_name = euler
time_step = 3600
steps = 1000000
force_const = 6.67384e-11
force_vector = 0 0 0

[animation]
animation_type = opengl
xlim = -5.0  5.0
ylim = -5.0  5.0
zlim = -5.0  5.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.