torsdag 26 februari 2015

Collisions!

Guess we forgot to mention in the initial post that we're making this in unity.

Well, there it happened.

Now - as the title implies - we've decided to add collision detection and handling to the simulation.
This would of course be mostly unnecessary if we had it in a realistic simulation of the solar system, as any objects that would collide within a computable timeframe would be too small to include.
The first type of collision we'll model is elastic collision, as it's more predictable.

But simple tinkering and adding of a few new planets can yield some interesting results.

Gif of the first collision.

After adding some new planets the simulation slowed down (naturally) and we did some simple code optimizations.

While the above picture looks pretty neat, on closer inspection one might find it a bit unrealistic (even if one considers planets as billiard balls). This became much more apparent when a planet collided with the sun at an angle. The reason for this was that the code didn't take multiple dimensions into account. It simply assumed the two objects moved in one dimension (on the same line).

The solution we used was to simply let the projection of the velocity vectors on the line connecting the center of the two planets (one dimension) and let them collide, and replace the projected components of the velocity vectors with the results.

Gif of updated collision.

måndag 23 februari 2015

Hello universe

This is a project by Martin Mützell, Jesper Simonsson and Janne Selkälä for the course "Models and Simulations" held by CSC school at the Royal Institute of Technology in Stockholm.

We have until the fourth of March to finish this, so time is of course very limited.

Alright, so with the timeframe in mind we've decided to (as the title implies) build a simulation of our solar system, as there are numerous examples to draw from and one of the labs the course provided can easily be expanded into this.

We'll start with simulating the actual solar system to a reasonable degree.

The standard simulation with all the planets


This is the simulation after earth has been mixed with.