Particle Simulations

Hello all,
I was just fooling around with coding my own physics engine and I was wondering if anyone had a good, efficient way to do particles? If you don’t know what I am talking about look at games like Powder Game (which is on the app store) or dust. Preferably I would want around 1000 particles to be on the screen before the framerate drops at all, but the most I can get is around 500. I have tried representing each pixel on the screen as an element in a table, but that was extremely slow. Collisions were fast, but the overall thing ran at like 30 FPS. I also tried representing each particle simply as an element in a table, but this made collisions costly and still I could only get 500 onscreen before the framerate dropped. Does anyone have any idea how to do this quickly and efficiently, while still making collisions between particles as efficient as possible (preferably not too many nested for loops)? Thank you!
PS I understand this may not be possible… I expect tables with their functioning as objects and arrays rather than just arrays in a language like C++ are probably a lot slower.

enter “particles” in the search box above, and you’ll see many examples of this…

maybe this will help http://codea.io/talk/discussion/6224/gaz-simulation#latest

Here’s something also.

http://codea.io/talk/discussion/1349/brownian-motion-kind-of#latest