# How to model Solar System formation accurately and realistically, Part 1

I've been working on a crude N-body simulator which allows N bodies of equal masse​s to interact gravitationally in 2 dimensions. My goal is to model the formation of Solar System.

Each body is modeled as a circle with a radius as a function of its mass, in such a way that all bodies have the same density.

When two bodies collide, i.e their radii overlap, they stick together inelastically (but momentum is conserved).

I have initialized the simulation with N=300 particles, and initial positions and velocties randomized (all positions bounded to a certain rectangular window, all velocties of the same modulus).

As the simulation progresses, particles move about, collide and form larger particles, and after some time the system appears to reach a stable state in which the number of particles is very few, usually between 2-5 (the most common case is a planet-sun system)

I've taken care of the efficiency of the code (by implementing Barnes-Hut). However I am now concerning myself with the accuracy/realism, especially with respect to two issues:

I. I have read online about collisional and collisionless systems. Apparently a small globular star cluster is collisional, but the stars in a galaxy or dark matter particles in a galazy are collisionless. Apparently whether the system is collisional or not is related to the "two-body relaxation time", which I don't understand either.

• Is the formation of a Solar System a collisional problem? Is the relaxation time relevant for my simulation? How would this change if I wanted to model the evolution of a galaxy?

II.

Please see this question: How to model Solar System formation accurately and realistically, Part 2

(I've broken up this post into two separate SE questions because it was too long.)

-Finally, any other things I should be considering in my simulation/ general suggestions?

Collisional simulations scale as ${\cal{O}}(n^2)$ or, with Barnes-Hut, as ${\cal{O}}(n\log n)$. Whereas collisionless typically scale as ${\cal{O}}(n)$ (although that may depend on how the forces are evaluated).