Sei sulla pagina 1di 6

ASSIGNMENT

Gravitational Motion

CONTENTS

SUBMISSION DETAILS ................................................................................................................. 1

BACKGROUND ............................................................................................................................ 2

Kepler’s Laws ....................................................................................................................... 2

Newton’s Law of Gravitation ............................................................................................... 2

SIMULATION DETAILS ................................................................................................................. 4

PART 1: Orbit of the Earth around the Sun (20%) ............................................................ 4

PART 2: Motion of a Comet around the Sun (70%) .......................................................... 5

SUBMISSION DETAILS

This assignment is worth 50% of the mark for the computing lab component of the module.

In addition to producing working code, you should produce a short report explaining your
methodology and your main results / findings. Both the code and the report should be
uploaded to blackboard.

The deadline for submission is Wednesday 20th May at 16:00

More details are given in the assignment brief on blackboard.

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 1
ASSIGNMENT
Gravitational Motion

BACKGROUND

KEPLER’S LAWS
Kepler’s first law (1609) states that the path of a planet around the sun is an ellipse with the
sun at one focus, shown schematically in Fig. 1. The perihelion is the closest point in the
orbit. The aphelion is the farthest point in the orbit. The major axis joins the perihelion and
aphelion. The eccentricity of the orbit is a measure of how close the orbit is to a circle.

Figure 1: Schematic of an orbital path around the sun. The aphelion and perihelion are the farthest and closest
points in the orbit to the sun, respectively. The major axis joins the aphelion and perihelion.

Kepler’s second law (1609) states that the line joining the sun and the planet sweeps out
equal areas in equal times. The consequence of this is that the speed of the planet will vary
during the period of its orbit, being slowest at the aphelion and fastest at the perihelion.

NEWTON’S LAW OF GRAVITATION


The magnitude of the force between the Sun, with mass 𝑀, and a body of mass 𝑚 at a
distance 𝑟 is given by:

𝑀𝑚 (1)
𝐹=𝐺
𝑟2

In terms of a vector quantity, we need to multply the equation above by minus the unit
vector between the two bodies, 𝒓̂. The minus sign is because the force is attractive.

𝑀𝑚 (2)
𝑭 = −𝐺 𝒓̂
𝑟2

Since 𝒓̂ = 𝒓/𝑟,

𝑀𝑚 (3)
𝑭 = −𝐺 𝒓
𝑟3

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 2
ASSIGNMENT
Gravitational Motion

The differential equation obeyed by a body in orbit can be obtained by considering Newton’s
second law of motion, 𝐹 = 𝑚𝑎 using the force in Eqn. 3:

𝑑2𝒓 𝑀𝑚 (4)
𝑚 2
= −𝐺 3 𝒓
𝑑𝑡 𝑟

If we orient our axes so that the plane of motion is perpendicular to the 𝑧-axis, then the 𝑧-
component will not change with time, and so doesn’t need to be included in the calculations.
Noting that 𝑚 cancels and considering the 𝑥 and 𝑦 components separately, we have two
second order differential equations.

𝑑2𝑥 𝑥
2
= −𝐺𝑀 3
𝑑𝑡 𝑟
(5)
𝑑2𝑦 𝑦
= −𝐺𝑀
𝑑𝑡 2 𝑟3

As we have done in the in-class exercises, we need to transform each of the equations in (5)
into two first order differential equations

Defining:

𝑑𝑥
= 𝑣𝑥
𝑑𝑡
(6)
𝑑𝑦
= 𝑣𝑦
𝑑𝑡

We then have:

𝑑𝑣𝑥 𝑥
= −𝐺𝑀 3
𝑑𝑡 𝑟 (7)
𝑑𝑣𝑦 𝑦
= −𝐺𝑀 3
𝑑𝑡 𝑟

The equations in (6) and (7) are the ones that we need to evaluate in order to model the
differential equations in (5).

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 3
ASSIGNMENT
Gravitational Motion

SIMULATION DETAILS

PART 1: ORBIT OF THE EARTH AROUND THE SUN (20%)

This part of the assignment is designed to help you to develop functioning code and to
consider suitable timescales to use for this type of simulation. Before you attempt this part,
it is strongly advised that you complete exercise 3.3, the non-linear pendulum.

You are required to calculate the orbital trajectory of the earth around the sun. You should
use the 4th order Runge-Kutta method with the differential equations in (6) and (7).

Data:

• Mass of the sun: 1.989 1030 kg


• Aphelion distance: 152.1  106 km
• Speed at the aphelion: 29.3 km / s
• 𝐺 = 6.7 × 10−11 N m2 kg −2

As a guide, the results of a calculation with a step size of one week is shown in Fig. 2.

Figure 2: Path of the earth around the sun for one period with a step size of 1 week.

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 4
ASSIGNMENT
Gravitational Motion

If you set the major axis (see Fig.1) along the 𝑥-axis, and position the earth at the aphelion
initially, then the initial values of 𝑣𝑥 will be zero.

You should:

(a) Produce a plot of the orbital path (𝑦-displacement as a function of 𝑥-displacement)

(b) Produce a plot of the orbital speed as a function of time

(c) Determine the orbital period from your simulation. Explain in your report the
methodology you have used

PART 2: MOTION OF A COMET AROUND THE SUN (70%)


Many comets travel in highly elongated orbits around the Sun. For much of their lives they
are far out in the solar system, moving very slowly, but on rare occasions their orbit brings
them close to the Sun for a fly-by and for a brief period of time they move very fast indeed:

Figure 3: Path of a comet around the sun

This is a classic example of a system for which an adaptive step size method is useful,
because for the large periods of time when the comet is moving slowly we can use long
time-steps, so that the program runs quickly, but short time-steps are crucial in the brief but
fast-moving period close to the Sun. Here you are required to calculate the trajectory, firstly
with a constant step size and, secondly, with an adaptive step size. As an initial condition,
take the comet at coordinates 𝑥 = 4 × 109 kilometers and 𝑥 = 0 (which is somewhere out
around the orbit of Neptune) with initial velocity 𝑣𝑥 = 0 and 𝑣𝑦 = 500 m s −1 .

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 5
ASSIGNMENT
Gravitational Motion

(a) Produce a graph showing the trajectory of the comet (i.e., a plot of 𝑦 against 𝑥).
Choose a fixed step size ℎ that allows you to calculate accurately at least two full orbits
of the comet. Since orbits are periodic, a good indicator of an accurate calculation is
that successive orbits of the comet lie on top of one another on your plot. If they do
not, then you need a smaller value of. Comment on the minimum value of ℎ required.

[20%]

(b) In a separate programme, repeat the calculation in part (a) using an adaptive step size
see session 4 notes and exercise 4.2 for details). Set a target accuracy of 1 kilometre
per year in the position of the comet and plot the trajectory. Also plot the speed and
step size as a function of time Comment on how the running time of the simulation
compares with part (a).

NOTES:

30ℎ𝛿
1. 𝜌 = |(𝑥 , where we are now considering the x and y displacements
1 −𝑥2 )+(𝑦1 −𝑦2 )|

2. In order to calculate the time taken for the simulation, you will need code similar
to the following. There are other ways to calculate the time.

[50%]

(c) Modify your program to place dots on your graph showing the position of the comet
at each Runge–Kutta step around a single orbit. You should see the steps getting
closer together when the comet is close to the Sun and further apart when it is far
out in the solar system.

[10%]

Year 2, 2019-20 COMPUTING LABORATORY


Dan Bull, SEE 6

Potrebbero piacerti anche