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.




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

Modeling of 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.


PyParticles require the following packages:

For more details about the installation visit the Blog:


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:


Start a simulation described in a config file

pyparticle_app <file_name>


Start the specified demo simulation

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 (shold be improved)
pyparticles_app --demo springs
pyparticles_app --demo solar_system
pyparticles_app --demo bubble
pyparticles_app --demo cat_spri
pyparticles_app --demo gas_lj


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:

media_origin = from_file
file_name = solar_sys.csv

len_unit = 149597870700.0
mass_unit = 5.9736e24
boundary = open

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

animation_type = opengl
xlim = -5.0  5.0
ylim = -5.0  5.0
zlim = -5.0  5.0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s