I\'ve have created a small visualisation of particles in python. I\'m caclulation the movement of particels in a 2D space with zero gravity. As each particle attracts all o
(This may should go in a comment but I don't have the needed reputation to do that)
I don't see how you do the time stepping. You have
P.speedx -= acceleration * xc
P.speedy -= acceleration * yc
but to get the new speed at time t+delta_t you would do
P.speedx -= acceleration * xc * delta_t
P.speedy -= acceleration * yc * delta_t
and then update the position like so:
P.x = P.x + P.speedx * delta_t
P.y = P.y + P.speedy * delta_t
Then to your speed concern. Maybe it would be better to store the particle information not in a class but in numpy arrays? But I don't think you can avoid loops.
Also, have you looked at wikipedia, there it describes some methods to speed up the calculation.
(edited due to Mike's comment)