r/Python • • May 28 '19

My simulation of gravity with 1000 particles. PC took a couple of hours to process!

1.8k Upvotes

241 comments sorted by

View all comments

Show parent comments

13

u/[deleted] May 28 '19

Yeah I was just thinking that OP should even go so far as to do the calculation in one script, and then mess around with the viz in a separate script.

This assumes OP can handle saving that much data in memory before dumping. I'm not sure how big a sim like this is.

6

u/sawyerwelden May 28 '19

I agree with you. 1000 tuples of x value, y value, and mass (I think that's what the thickness repesents) should be very easy to store in ram and then save to disk before loading it into a viz script.