Solar System


Compute the orbits of the planets in the solar system for period of 400 days. Besides, the planets a spaceship is included in the simulation. Based on the specified initial conditions of the sheship, the movement of the spaceship is computed as well.

Input:



Spaceship properties:

Mass spaceship is equal to 1000.0 kg

x-position spaceship is equal to -65000000000.0 m

y-position spaceship is equal to 1.33e11 m

Spaceship initial x-velocity is equal to -10000.0 m/s

Spaceship initial y-velocity is equal to -1e4 m/s

Background: Newtonian physics


The position and velocity of objects can be computed with Newton's laws of motion and Newton's law of gravitation. Newton's second law says that the rate of change of velocity time mass of the object is equal to an applied force, $$F = \frac{d (m v)}{d t}$$ where F is the total force applied to the object with mass m and velocity v. Based on this law the velocity and positions of an object can be predicted when the applied force is known. The positions can be obtained from the velocity definition (v ), $$v = r/t$$ with r the distance and t the time. Using Newton's law of gravitation, the force between planets and stars can be predicted. This force is proportional to the mass of both objects and the distance squared, $$F = G m_1 m_2/(R^2)$$