Optimizing an n-body simulation using Numpy and Glumpy
0
I am making the process of moving from MatLab to Python, and am attempting a real time N-body simulation as a way of getting to grips with the language. I have completed a script that uses glumpy for the visualisation, and vectorised numpy code for the numerical integration, but it slows waaaaaay down for more than about 150 points. Essentially, I am looking for tips on how to optimize the code so that it can run in real time with at least an order of magnitude more points. Particularly, is there any way of implementing the integration within the shader code using the GPU?? I am aware of the limitations with the Euler method that I have used (and the scaling of the acceleration), and am looking for input on optimization of the software implementation, as opposed to the numerical method itself. import numpy a...