Hello, I am trying to make a very rough computer model of the clumping of matter into galaxies in the large scale structure of the universe. As a starting point, I'm randomly distributing particles across a rectangle and then letting all the particles (about 22500 particles) interact via the inverse square law. The particles can be thought of as stardust clumps, "mass clouds," whatever you want to call them; the important thing is that they don't have an internal structure. However, I'm curious as to how to exactly model the interaction between these particles. With Newton's law alone, the "particles" attract each other until they're a distance 0 apart; but of course with real matter the two particles cannot occupy the same space. How might one model this "same space" repulsion? What I have been doing is saying that once the particles get within a certain radius of each other, they stop attracting one another. It might be better to say that within some radius they begin repelling each other, but I'm not sure what this repulsion would look like. The way I'm doing gives me some interesting results but it seems arbitrary and unphysical (see attached gif). This may not be the right place for this post, but I don't consider this purely or primarily a computer simulation question... Thank anyone for any suggestions or criticisms.