Inspiration
I was mainly influenced by the famous three-body problem which gives you an initial set of data that specifies the positions, masses, and velocities of three bodies for some particular point in time and then the goal is to determine the motions of the three bodies. Henri Poincare proved there is no general analytical solution for the three-body problem which means iteration is one of the closest ways to approach the soliton.
What it does
It randomly places planets/meteorites with various speeds in a 3D space. Each object is influenced by the others. Their position is updated every 0.01 seconds which represent one day. The limit of the plot is 3e11 meters which are about the distance from the Sun to Mars. There are five predefined objects: Two Stars (With the mass of our Sun), Venus, Earth & Mars.
How I built it
Began by understanding the way spheres move in 3D. Defined the relationship between distance, velocity, and acceleration. Setting up an accurate scale of the entire system so that the Gravitational Constant works appropriately. Set the mass of every object. Set the exact velocity of the body so that it stays in orbit. Define a scaling factor for the radius so that the planets and the sun are visible. Understanding the implications of general relativity in the velocity limit. Create walls at the boundaries so that the objects "bounce back" in a light ray vector fashion.
Challenges I ran into
The primary difficulty was calibrating the system. I had to use very specific values and decided to test it with a model of our solar system. I even included the moon when calibrating the main model and it did what expected and started orbiting the Earth. Another challenge was understanding the way objects were colliding with the wall and how the vectors should be set so that they flip and reflect correctly. General relativity also had to be considered. The objects that tried to surpass the speed of light were naturally slowed down because the acceleration would impose a lower impulse as the speed got higher. The math behind this type of systems is extremely advanced, solving the movement of this kind of bodies requires third order differential equations and sometimes is unsolvable as seen in the classic three-body problem.
Accomplishments that I'm proud of
Understanding how to use an iterative approach to solve a problem without solving any differential equations. It was also incredibly fulfilling when I was finally able to replicate part of the solar system.
What I learned
I learned to use an iterative approach to approximately solve complicated mathematical equations. When objects collide they "explode" and are instantly shoot normally to the impact plane, it happens because at that point Newtons' law of universal gravitation blows up.
What's next for Planet System Gravity
I want to measure the average velocity of the system. Understand how entropy changes with time. I want to be able to optimize my code and also utilize a higher computing system so that I can calculate the result at a further time. This method would allow me to begin with the random amount of objects that move in different directions and see how over time they stabilize and come to equilibrium. At this time we should be able to see the dominant directions and objects.
Built With
- matlab
- physic
Log in or sign up for Devpost to join the conversation.