Kepler ellipse

Exercise:

Write a program that simulates the orbit of a satellite around the Earth.

The law of gravity applies to the gravitational force

F = G *(M*m)/rē

Here G=6.67e-11 is the gravitational constant, M=6e24 the mass of the earth. From the force you can determine the acceleration of the satellite using Newton's fundamental law. If you calculate the x- and y-coordinate of the satellite from the components vx and vy of the velocity, you get r for the law of gravity. From the acceleration a you can calculate the components ax = a*x/r and ay = a*y/r and from this again vx,vy,x,y etc.

Choose DeltaT=10 , x=6,9e6, y=0, vy=9000 and vx=0.

In the graph, plot y over x.

Change also the exponent in the law of gravity e.g. to r^1.9. How does the path change?

Interpret the graph if you plot x over t.