Hi Davide,

Could it be that you should used different indexes when retrieving the particles from the container ps? 
Instead of having

p1 = ps.get_particle(i)
      p2 = ps.get_particle(i+2)
      p3 = ps.get_particle(i+3)

This makes much more sense to me

p1 = ps.get_particle(i)
      p2 = ps.get_particle(i+1)
      p3 = ps.get_particle(i+2)

Ciao
R

Sent from my iPhone

On Jan 10, 2014, at 4:49 AM, Davide BaĆ¹ <davide.bau@gmail.com> wrote:

p1 = ps.get_particle(i)
      p2 = ps.get_particle(i+2)
      p3 = ps.get_particle(i+3)