A particles simulation ToolBox written in Python

Main menu

Category Python

Post navigation

In this release I’ve introduced OpenCL and GPU in the development of PyParticles, and the firsts result are very well , try by yourself the galaxy demo.

The acceleration respect the the simulation based only on numpy is impressive.

If you want you can try also the fountain demo were I’ve introduced OpenCL in the drag computation, and the result is very encouraging and now you can simulate easily up to 700K particles or 1M particles.

In this release I’ve added the damping force, that’s useful in a lot of simulations.

And I’ve finally fixed and improved the documentation, in particular I’ve written a chapter dedicated to the testing procedures, for me this point is very important because it show practically the reliability of pyparticles. At the moment the implemented tests are 3, but in the future I hope to add also some other procedure.

If you have some suggestion for testing PyPaticles don’t hesitate to contact me.

With this release PyParticles become compatible with python 3.3, it need some other test but all mains functionalities works correctly. At the moment the main goal is to have an application that works either with python 2.7 and 3.3.

The second and very important point of this release are the testing, so I’ve finally written a pair of test procedures for comparing an analytical solution with the simulated solution.
For the moment the two tests are a falling object in a dragged fluid and the harmonic oscillator, and in both cases the result of the simulation is correct or, for be more precise, it follow the analytical solution with a very good approximation, so I can think that the procedures implemented in PyParticles are reliable.

In the following I report the absolute error for the harmonic oscillator (click for enlarge):

With PyParticle version 0.3.0 I’ve added the possibility to inset constraints in the particles system. The constraints are used to force the positions of some particles or for set up the interactions between the particles so we can build some complex and detailed models. In my example (see the video above) I’m simulating a vibrating string with the drag of the air under a constant gravity, and the result is very interesting.

In this version I’ve also improved the OpenGl rendering by using the display lists and I’ve also added a bubble demo, based on a ‘fantasious’ force.

For understanding the potential of the constraints watch this video, where I’ve developed a vibrating string in a very simple manner.

Whit this new version I’ve added some interesting featured, first of all I’ve added the possibility to measures some quantity like the potential energy or the kinetic energy in the particles system, try to watch the springs or the solar system demo, I’ve also added the Lennard Jones potential as a force model for simulating the particles system, that’s very useful for simulating the gases.

For the visualization I’ve written some new features in the OpenGl animation, and now you can change easily the particle rendering model, and if you want you can turn ON or turn OFF the lighting, plus a little help (push the key h).

With PyParticles you can freely combine every force model with all integration method in an easier as possible manner, for example you can change the integration method by switching a single line of code:

For example with this single line of code we can say to PyParticle to use the Runge Kutta method for simulating the model.solver = rks.RungeKuttaSolver( grav , pset , dt )