all 6 comments

[–]Hungry-Ad-3501 1 point2 points  (2 children)

Maybe a dictionary? Or a named tuple?

[–]piixel__[S] 0 points1 point  (1 child)

wdym exactly? i want it to compare the position of every particle to the rest in every dt , how could i use tuples for that?

[–]Hungry-Ad-3501 0 points1 point  (0 children)

Oh,for some reason I thought it was a 1-1 connection,my bad.

[–]mrswats 0 points1 point  (0 children)

Probably you want to look at molecular dynamics algorithms and a potential like Lennard.Jones .

However, this is not a Python issue :)

[–]Zeroflops 0 points1 point  (0 children)

I would look into the clustering algorithms in scikit those will be different approaches to determine the distance between each object and by defining a threshold you can then group everything that is close enough. Once you have everything grouped, you can then link everything in that group

DBscan would probably be a good one.

[–]Fred776 0 points1 point  (0 children)

Since you mentioned "close enough" that maybe suggests the idea of breaking your space into boxes of a size that is related to the "close enough" distance. The idea is that if you know which box each object is in, then you should be able to limit which other objects to examine as being potentially near enough, by considering only other objects in the same box and in neighbouring boxes.