程序代写案例-ULATION 2021 61

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
COMPUTER SIMULATION 2021 61
2. There are two Martian moons: Phobos and Deimos (named after the ancient
Greek gods of fear and terror respectively). Add Deimos to your simulation and
check that it still runs correctly. INPUT PARAMETERS: DEIMOS
5.7 Relevant course sections
Studying the following course sections will help you complete this checkpoint:
• Plotting using Matplotlib
• Custom Plotting
• Animation using Matplotlib
5.8 Marking Scheme
• Orbital Motion Checkpoint Marking Scheme
1 Solar
1.1 Introduction
In 1543 Copernicus proposed that the known planets (at that time only the planets
as far out as Saturn) were in circular orbit around the sun. This theory was revised
by Kepler and Brahe who showed that the orbits were in fact elliptical. Since then
the orbits of the planets have been very accurately calculated and can be precisely
predicted far into the future. NASA uses powerful computers to determine both the
position of the planets and the path of its space missions, including the Mars landing
probes.
This project will aim to simulate the motion of the planets in two-dimensions and to
predict launch conditions for satellites to successfully reach planets.
1.2 Numerical integration
The solar system represents a gravitational “many body problem”, i.e. one that can-
not be solved analytically, which means that a numerical integration scheme must be
used. In this project we will use the three-step Beeman scheme. The Beeman algorithm
is a stable method which predicts the position at the next time step by combining the
current acceleration with the acceleration from the previous time step. This new po-
sition can then be used to calculate the new acceleration which, in turn, predicts the
new velocity. The algorithm is given by:
~r(t+t) = ~r(t) + ~v(t)t+
1
6
[4~a(t) ~a(tt)]t2 (1.1)
School of Physics and Astronomy, The University of Edinburgh. All Rights Reserved.
COMPUTER SIMULATION 2021 62
and
~v(t+t) = ~v(t) +
1
6
[2~a(t+t) + 5~a(t) ~a(tt)]t. (1.2)
Where t is the small time-step, t is the current time and ~r, ~v and ~a represent the
position, velocity and acceleration vectors for the motion.
1.3 Project task
Your task is to produce a simulation of the orbit of the inner planets (Mercury, Venus,
Earth, Mars), however, you should code the simulation in such a way that adding new
planets does not involve changing the code. The simulation should read the planet
details from a file and show the orbit of the planets as they move around the sun
in a graphical display. Your code will implement the Beeman integration scheme to
update the position and velocity of the planets at each time step. The program should
calculate the orbital periods in Earth years, and these should match the actual ratios -
so that a day on Mercury should be 4 times shorter than an Earth day.
You should also regularly write out to a file the total energy of the system – the sum of
kinetic and gravitational potential energy – to check that it is conserved. TOTAL ENERGY
For information on how to set the initial positions and velocities and how to determine
the acceleration due to gravitational attraction, see CP5 Orbital Motion .
1.4 Experiments
Once you have a working code, you should work through Experiment 1 (energy con-
servation) and Experiment 2 (Satellite to Mars) below.
1. Energy conservation
The Beeman algorithm is a symplectic integrator, which means that the total energy of
the system should be conserved over time.
Experiment 1 : Check whether (or not) energy is conserved dur-
ing your simulation. Illustrate your results graphically.
2. Satellite to Mars
Suppose you wish to launch a satellite from Earth to perform a fly-past of Mars.
Experiment 2 : Find initial velocities that will enable a satellite to
get close to Mars. Check whether your satellite ever gets back to
Earth.
School of Physics and Astronomy, The University of Edinburgh. All Rights Reserved.
COMPUTER SIMULATION 2021 63
You should launch the satellite at the start of your simulation. Once you have found
a path that lets the satellite get close to Mars you should check to see if your journey
time is similar to that of NASA’s Viking probe.
Care must be taken to start the satellite from just off Earth (so that there is no division
by zero) and also to ensure that the starting velocities are realistic - a probe could
get to Mars in a few days if it were fired fast enough but carrying that much fuel is
prohibitive!
1.5 Optional extras
3. Satellite to Jupiter
Now suppose you wish to launch a satellite to Jupiter - again to do a fly-past (again
using realistic velocities). Add Jupiter to your list of planets and re-run the simulation
to try and find a realistic satellite path from Earth to Jupiter. You may find that the
satellite ‘slingshots’ around Jupiter. As a result, the position of the satellite after it has
visited Jupiter is very sensitive to the initial launch conditions of the satellite.
To add an extra coding challenge, modify your program to launch the satellite two
earth years after the start of your simulation.
Experiment 3 : Characterise the slingshot event and investigate
the initial sensitivity to conditions - how do you think NASA
copes with this problem?
4. Asteroids and doomsday
Incorporate into your program the ability for an asteroid to be added with random
position, speed and (realistic) mass at any time.
Experiment 4 : It has been suggested that Earth is under danger
of an asteroid impact. Use your simulation to explore whether is
this probable. Other, more radical influences have associated the
aligning of the planets with the coming of Doomsday. How often
does such an alignment occur?
1.6 Marking Scheme
• Project Marking Scheme
1 Course Assessment
Details of the course assessment are given in the Course Handbook, available in Learn,
and are reproduced here for information.
School of Physics and Astronomy, The University of Edinburgh. All Rights Reserved.

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468