# I How to model Solar System formation accurately and realistically

Tags:
1. Aug 17, 2017

### Joshua Benabou

I've been working on a crude N-body simulator which allows N bodies of equal masses 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 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.**
I've read online about "gravitational softening" whereby Newton's law $F=\frac{Gm_1m_2}{r^2}$ is replaced by $F=\frac{Gm_1m_2}{r^2+\epsilon^2}$ for some constant $\epsilon$ which is small compared to the distances involved in the simulation.

As I understand it, the purpose is to bound errors in the simulation due to close encounters between bodies: if $r$ is small, the accelerations are large, but since the time resolution is finite, the error grows.

I've tested the effect of softening for $N=3$ particles intialized at the vertices of an equilateral triangle with equal speeds (Lagrange's peridic solution to the N-body problem). The configuration is supposed to be symmetric, with the particles moving on ellipses which form $120$ degree angles with eachother and share a common focus. But since all three particles come very close together at their perigees, errors grow and eventually the symmetry collapses and the planets go haywire.

Introducing softening didn't seem to make much of a difference. It seems to prevent large-angle scattering, but it leads to errors which grow overtime and destroy the symmetry of the Lagrange configuration anyways.

Now I'm not sure relevant this test is for my solar system sim because it is almost impossible to have close encounter of three particles simultaneously.

My question is thus:

-**What is the advantage of gravitational softening? Doesn't it create errors which grow overtime? Should I be using it in my simulation?**
------------------------------------------

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

2. Aug 18, 2017

### nikkkom

I would search for already existing open-source simulations. If they exist, why reinvent the wheel when you can take existing, imperfect one and help improve it?

3. Aug 18, 2017

### Joshua Benabou

No. I'm not going to read through other people's code. Second, this is my project - to make the simulation myself and see how far I can get.

4. Aug 18, 2017

### Staff: Mentor

But the solar system did not begin with N bodies. It started as a cloud of gas and dust.

I'm sure you know that, so I'm puzzled about your goals with an N body simulation.

5. Aug 18, 2017

### Joshua Benabou

Well a cloud of gas and dust is a system of N bodies for N very very large. Since the computer can't deal with that many particles, what I'm simulating (if N is on the order of 10,000 say) is more the formation of a Solar System starting from planetisemals.

And indeed, even though the assumptions of the model I'm using in my code are super simplistic, I already got a Solar System with a sun and 3 orbiting planets moving in apparently stable elliptical orbits, with one of these planets having a moon!

Modeling solar system formation is one of the main uses of N body simulations, is it not? See for example the Nice model.

6. Aug 18, 2017

### Staff: Mentor

But a key to gravitational collapse is the ability to radiate away energy. If you model only the gravity of N rigid bodies, energy will be conserved and collapse shouldn't happen. Right?

7. Aug 18, 2017

### Joshua Benabou

Indeed, but as I said, my code allows the particles to collide inelastically, so this is where the energy is lost...