COMPUTING II: PROJECT F (00/01)

Planetary motion: how "square" is the inverse square law?

Kepler’s laws of planetary motion, although formulated almost a century before Newton developed his law of gravitation, are a direct consequence of the inverse square law for the gravitational force. In this project you will write a C program to simulate the motion of a planet around the Sun and show that stable orbits are possible only for a 1/r2 dependence. (See Chapter 4 of Giordano.)

Simulate the motion of the planet using the Euler-Cromer method (which differs only slightly from Euler’s method - see lab. session 3) to solve the differential equations that determine the position of the planet as a function of time (see Chapter 4 of Giordano). Your program should "trace out" the orbit of the planet. An appropriate choice of units will make production of the animation much simpler. Calculate the total energy and angular momentum of the planet as it moves through its orbit. For the Euler-Cromer method too large a time step will not produce satisfactory results (although, using the Euler-Cromer method, there may be some oscillatory behaviour in the total energy during an orbit, the total energy should be conserved from orbit to orbit). Modify the force law in your program so that instead of an inverse square dependence, the force is dependent on r -2.5 . What happens to the orbit of the planet? Try other values for the power to which r is raised.