Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
USING THE PERIHELION ADVANCE OF MERCURY
TO VERIFY GENERAL RELATIVITY
by
Joseph Harris
A senior thesis submitted to the faculty of
Brigham Young University - Idaho
in partial fulfillment of the requirements for the degree of
Bachelor of Science
Department of Physics
Brigham Young University - Idaho
April 2020
Copyright c© 2020 Joseph Harris
All Rights Reserved
BRIGHAM YOUNG UNIVERSITY - IDAHO
DEPARTMENT APPROVAL
of a senior thesis submitted by
Joseph Harris
This thesis has been reviewed by the research committee, senior thesis coor-dinator, and department chair and has been found to be satisfactory.
Date David Oliphant, Advisor
Date David Oliphant, Senior Thesis Coordinator
Date Stephen McNeil, Committee Member
Date Brian Tonks, Committee Member
Date Todd Lines, Chair
ABSTRACT
USING THE PERIHELION ADVANCE OF MERCURY
TO VERIFY GENERAL RELATIVITY
Joseph Harris
Department of Physics
Bachelor of Science
The perihelion advance of Mercury is one of the celestial occurrences that
can provide evidence for general relativity. The code provided can be used
to predict the future locations of Mercury, and predict the time of the next
transit. If general relativity was not affecting Mercury as Einstein suggested
then the 2019 transit of Mercury would have occurred 17.973±11.596 seconds
later than predicted.
ACKNOWLEDGMENTS
Thank you, to Nonnie Woodruff for presenting me with the idea that this
work is based on, and for the opportunity to push myself.
David Oliphant, Dr. Brian Tonks, and Dr. Lance Nelson for their patience
and assistance in the different aspects of my work.
Jesica Seeley-Williams for her assistance in quality control.
Katie Harris for believing in me and supporting me in many aspects during
the time of my work.
Contents
Table of Contents xi
List of Figures xiii
1 Introduction 11.1 History of General Relativity . . . . . . . . . . . . . . . . . . . . . . . 11.2 What is Perihelion Advance . . . . . . . . . . . . . . . . . . . . . . . 31.3 Why do We Care . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Methods 72.1 Finding a Celestial Body in Three Dimensions . . . . . . . . . . . . . 72.2 Predicting the Future Location of a Celestial Body . . . . . . . . . . 102.3 The Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3 Results 13
4 Conclusion 154.1 What This Means for General Relativity . . . . . . . . . . . . . . . . 154.2 Other Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.3 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Bibliography 18
A Code for Mercury 21
B Code for Earth 27
xi
List of Figures
1.1 Perihelion Advance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.2 Example of Gravity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1 Anomalies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1 Motion After Each Orbit . . . . . . . . . . . . . . . . . . . . . . . . . 14
xiii
Chapter 1
Introduction
1.1 History of General Relativity
Albert Einstein was one of the most notable and iconic minds of his time. He spent
many years of his life figuring out mathematics and applying theories that have shaped
the way we understand the universe. One of the theories that he came up with was
the idea of general relativity, which he used to explain the force of gravity. He realized
that if one were in a box accelerating at 9.8ms2
no experiment that they performed
could prove whether they were in fact on Earth or accelerating through space. This
came with some interesting implications, from the way light worked to the existence
of black holes. However, the implication we are interested in today is how it helps
explain what Mercury does. An ideal way of describing how Einstein thought of the
universe is like a sheet of stretchy fabric with some mass in the middle and another
object being rolled past it. The second object will begin to orbit the larger central
one, and for most objects, that’s the end of the thought experiment. However, for
Mercury, there are some additional effects that I will cover.
The image of space being some form of stretchy fabric where everything warped
1
2 Chapter 1 Introduction
said fabric causing the effect we call gravity was a theory that not many people wanted
to agree with. It seemed to resemble the idea of the aether, which had already been
rejected. However, Einstein postulated that one could verify his theory by waiting
for a solar eclipse. If you plot the location of the visible stars then during the eclipse
plot them again they will appear to have moved. Arthur Eddington and his team
actually did this and Einstein’s predictions came out correct. This all but confirmed
his theories; however, nothing in science is ever proven and as such more evidence is
always a must.
During the time that Einstein was working on his theory, people were trying to
figure out why Mercury moved the way it did. Mercury had a tendency to appear
earlier than they predicted based on the Newtonian gravitational force of the planets.
It seemed to be moving about 42.98 additional arcsec/ cent (arc seconds per cen-
tury). Many people were confused by this until Einstein applied his theory of general
relativity. The full derivation can be found in “Explanation of the Perihelion Motion
of Mercury from General Relativity Theory” [9]. The conclusion comes down to one
equation
ε = 24π3 a2
T 2c2(1 − e2)(1.1)
with ε being the missing angle, a the semi-major axis, e the eccentricity, T the
period, and c is the speed of light. This leads to the missing angle of almost exactly
the 43 arcsec/cent they were missing. I decided that it would be beneficial to use this
lesser-known method to help verify general relativity, as Mercury would be transiting
this year.
1.2 What is Perihelion Advance 3
Figure 1.1 Perihelion Advance
1.2 What is Perihelion Advance
The perihelion is the point in a planet’s orbit that is closest to its sun. A perihelion
advance is when that point also moves around its sun. Many factors contribute to
perihelion advance including, the gravitational force of the other planets and the
movement of the sun, as the sun does have a slight wobble that can affect nearby
planets. However, in some cases, there is still a missing part and that is where general
relativity comes in.
Mercury has the largest eccentricity or in other words the most elliptical orbit of
all the planets in our solar system. Also being as close to the Sun as it is means
that its orbit can have some interesting effects. The orbit seems to have an orbit of
its own this is known as a perihelion advance. It is slow and hardly noticeable but
there is about 574.1 arcsec /cent in total movement. The other planets and Sun i.e.
Newtonian mechanics can account for 532.805 arcs/cent leaving about 43 arcs/cent.
As already demonstrated in equation 1.1 Einstein predicted that the effects of gravity
would change given Mercury’s proximity to the Sun and that change comes out to
the 43 arcs/cent that Newtonian mechanics was missing.
To be clear, perihelion advance can be seen in any orbit. However, most orbits
4 Chapter 1 Introduction
in our solar system are quite circular and their small advance is easily explained by
Newtonian mechanics i.e. the pull from other planets. I believe that being able to
predict locations of planets and how much effect general relativity has on them can
be useful in understanding extra-solar planets. If we have the necessary information,
we can make better estimates and predictions of a solar system’s makeup, which we
discuss later. For now we are focused on Mercury and its odd orbit.
1.3 Why do We Care
The implications of general relativity reaches much further than simply being able to
predict the location of Mercury at any given time. Additionally, it would allow us
to use similar methods in predicting the orbital mechanics of planets in other solar
systems. This also leads to being able to think of gravity more accurately. Since the
time of Sir Isaac Newton, people have thought of gravity as a force, for many aspects
it acts like one, but if Einstein’s theory is right it’s not so much a force that is pulling
objects together but rather the object falling into a “dip” or warp in the fabric of
space time.
Figure 1.2 Example of Gravity
In addition, knowing about general relativity and how much it affects the space in
which we live can help us avoid misunderstandings of what is or is not out there. When
1.3 Why do We Care 5
observers first started trying to discover what was causing Mercury’s odd behavior,
a scientist by the name of Le Verriere [4] believed that a 3rd inner planet or rather
a series of small objects was to blame. Named Vulcan, this invisible object needed
to be approximately 10% of Venus’s mass and be within the orbit of Mercury. It was
determined that such an object would not only affect Mercury but Venus and Earth
as well. This was not found and other options where needed to explanation of this
phenomenon.
There are a few implications with the verification of general relativity and the
accompanying theories. The great thing about testing general relativity is that anyone
can do it thanks to transits. A transit is when a planet moves between the observer
and a star. In the case of Earth, only two planets can transit between us and the
Sun; Venus and Mercury. My goal is to allow any amateur observer to be able to
predict Mercury’s location. Using stringing information provided by NASA [6] for
the location of Mercury during its last transit. As a result, we could predict when
Mercury would transit again if we include verses don’t include Einstein’s theory of
general relativity.
6 Chapter 1 Introduction
Chapter 2
Methods
2.1 Finding a Celestial Body in Three Dimensions
When people think of the motion of the solar system many will often think of Kepler’s
heliocentric model with the Sun in the center and the slightly elliptical orbits of the
planets. The problem with this mental image is that it is two dimensional. Many
people will depict the motions of the planets as two dimensional movements and
though for many situations this simplification works well. For my experiment, we are
trying to find a difference of approximately 0.04 arcsec per month. This requires that
we consider not only the orbit but the tilt, or inclination to the ecliptic, that each
orbit has. Thankfully, we can simply place Earth’s inclination at 0 and only consider
the inclination of Mercury 7.0047◦.
To do this first we need to know the semi-major axis a, the eccentricity e, and the
mean anomaly M . Eccentricity is the variable that helps us determine how elliptical
an orbit is, and semi-major axis is the length from the center of the orbit to the
nearest edge. The mean anomaly is a variable used to make the geometry a little
easier; briefly, it is the angle that a planet would have moved if it had a circular orbit
7
8 Chapter 2 Methods
Figure 2.1 Anomalies
i.e. its eccentricity was 0.
The current mean anomaly can be calculated with the following equation [8].
M = M(0) + 2π(t/T ) (2.1)
M(0) the initial mean anomaly, t the current time, T the orbital period of the
planet.
We also need to find the eccentric anomaly E, which is the angle forming a right
triangle with a perpendicular line going from the semi-major axis intersecting the
planet and ending at the imaginary circle that was drawn when finding the mean
anomaly [8]. This has to be done with a recursive method as it cannot be calculated
analytically.
E = M + (180◦/π)esin(E) (2.2)
Once the eccentric anomaly is found the radius and the true anomaly θ (which
is the angle that the planet has traveled from perihelion) can be found at any given
time using [8]
r = a ∗ (1 − e ∗ cos(E)) (2.3)
2.1 Finding a Celestial Body in Three Dimensions 9
θ = arccos(1/e ∗ ((a ∗ (1 − e2))/r − 1)) (2.4)
or [5]
θ = arccos((e− cos(E))/(e ∗ cos(E) − 1)) (2.5)
Thinking about the 3rd dimension one can give the planet tilt. This will give
φ or its position above or below the solar ecliptic, it was found that converting to
Cartesian for a moment gives the accuracy needed [3]. This is done by using the
fallowing formulas
x = r ∗ (cos(N) ∗ cos(θ + ω) − sin(N) ∗ sin(θ + ω) ∗ cos(i)) (2.6)
y = r ∗ (sin(N) ∗ cos(θ + ω) + cos(N) ∗ sin(θ + ω) ∗ cos(i)) (2.7)
z = r ∗ (sin(θ + ω) ∗ sin(i)) (2.8)
φ = arccos(z/(sqrt(x ∗ ∗2 + y ∗ ∗2 + z ∗ ∗2) (2.9)
x, y, z being the planets location in space, N being the longitude of ascending
node, which is the angle the planet would be at as it crossed the plane of reference,
in this case the ecliptic. ω being the argument of perihelion, which is the angle from
the reference plane, the ecliptic, to its perihelion [3]. Then repeat the same steps
for Earth and compare the two as time moves on. When both θ for Earth and θ
for Mercury align in addition to φ for Earth and φ for Mercury then the planets are
aligned with the Sun and thus a transit is in progress.
In summary, find the mean anomaly at any given time so that the eccentric
anomaly and then the 2 angles φ and θ can be found. When these values are known
for each planet and they are within a certain degree of each other. This means that
10 Chapter 2 Methods
Mercury is passing between Earth and the Sun or is transiting. Now if general relativ-
ity is taken away there should be an observable difference in location and by extension
the next transiting time. Using the variable M(0) in equation 2.1, I added the effects
of gravity from the other planets and the effects of general relativity separately. I
then took out the effect from general relativity and compared the final location.
2.2 Predicting the Future Location of a Celestial
Body
To know where you’re going you need to have a starting point, NASA keeps track of
planetary locations and other useful data [6]. This gives us a starting location with
which we can calculate the eccentric anomaly and mean anomaly using
E =e+ cos(θ)
1 + ecos(θ)(2.10)
and equation 2.1 setting t as 0 [5]. For this experiment I will use the last time
Mercury transited as this was the last time that anyone with a solar telescope would
have been able to verify where the planet was in reference to Earth and the Sun.
After that I will have my program from appendix A step in time; the calculations
being used are designed in such a way there is no need to worry about velocity of the
planet and can focus only on time past.
With this application the program can run for as long as it is needed; however
all of this does have a purpose. For this experiment we are going to find the next
time that Mercury will be visible to anyone with a solar telescope. The difference
between general relativity’s effect and the lack thereof is only a matter of seconds,
so for simplicity’s sake, I will use the starting time of a transit as the beginning and
2.3 The Calculation 11
end. If a few seconds is not enough to be convincing of the validity of the experiment
it can always run longer or have a different starting point further back in history.
Scientists’ have done a few different thought/ mathematical experiments for the
motion of the planets, each one with varying degrees of accuracy. Burchell [1] explains
many of these methods and explains the positives and negatives of them. For purposes
of this experiment, I will be accepting the generally used 531.63 arcs/cent effect due
to Newtonian mechanics, as well as the 0.0254 arcs/cent due to oblateness from the
Sun. The only question is whether or not general relativity’s effect will give me a
proper prediction.
2.3 The Calculation
Mercury’s most recent transit before my experiment happened was on May 09, 2016
second contact at 11:12:18. Mercury’s position in AU (astronomical units) was x =
−2.9835 ∗ 10−1, y = −3.3989 ∗ 10−1, z = −4.0108 ∗ 10−4 with Earth’s being x =
−6.6195 ∗ 10−1, y = −7.6244 ∗ 10−1, z = 3.3869 ∗ 10−5. That doesn’t mean much until
the location is converted to spherical coordinates, and one can see that θ for Earth
is 3.9973 rads, and for Mercury is 3.9918 rads. this gives us a θ difference of about
0.0055 rads. φ for Earth is 1.570796 rads and Mercury is 1.581504 rads giving us a
difference of about 0.0107 rads. This will be our threshold to indicate that Mercury
is transiting. According to NASA, the next transit was to happen on November 11,
2019, at 12:35:16.
The first thing I had to do was make a rough estimate of how big of a difference
general relativity was going to make. I did this by breaking the advance into two parts,
one being the advance due to all known effects, i.e. gravity from the other planets,
and oblateness of the Sun, the second being the calculated effect of general relativity.
12 Chapter 2 Methods
I then broke the effects down from arcs/century to arcs/month and multiplied by the
number of months it was going to take. This gave me 1.24 total arcs for the 31 month
difference. By using the small angle formula [2];
R = 206265d/D (2.11)
R being the missing angle in arcs (1.24), d being the distance between the planet
and its new predicted location, and D being the average distance of the planet from
the Sun. I am able to determine that the planet will be approximately 348.077 Km
behind if we don’t include the effects of general relativity. Given the average velocity
of Mercury 47.4 Km per second, I estimated that if general relativity was not in
play then the transit would occur 7.34 seconds after NASA’s prediction. Hardly a
difference, I know but it’s enough for a camera to catch and that is the important
part.
Now that I have shown my experiment is measurably possible, I had to write a
code that would give me a much more accurate result. The code shown in appendix 1
is broken into two parts; one shows the movement of Mercury while the other shows
the moment of the Earth. Each of these is broken into three parts one to calculate
the eccentric anomaly E the others to calculate the φ and θ. Now knowing that the
transits will be close together no matter if we use or don’t use general relativity. I
had the code run stepping in time, one minute at a time, until the full 31 months
had past. After which I compared the two φ angles of each planet, and the two θ
angles of each planet, once with general relativity and once without to see how they
compared.
Chapter 3
Results
The first result that I was interested in was what the location of Mercury would be
relative to the Earth from the perspective of the Sun, if I do not include general
relativity. To find this I had to adjust the M(0) seen in equation 2.1 with the effects
of Newtonian gravity but excluding the effects of General Relativity. This gave me a
final θ angle of 7.1836650 rads and a φ angle of 1.5539418 rads for Mercury compared
to Earth’s θ 7.1874917 rads and φ 1.5707963 rads giving us a difference of 0.0038267
rads in θ and 0.0168545 rads in φ which means it will be transiting. Now I just need
to find how much of a difference general relativity will make on Mercury’s location.
After adding in the effects of general relativity in to the M(0) variable in equation
2.1 the new θ angle is 7.1836741 rads and the new φ angle is 1.5539260 rads. This
gives us a difference in θ from the general relativity and θ from the lack of general
relativity to be 0.0000091 rads and a difference in φ of -0.0000158 rads. These angles
are so small, I converted them to arcs and applied the small angle formula. Once I
had the distance between these points, I found it was about 581.236 Km and using
Mercury’s average speed it would take about 17.973 ± 11.596 seconds to cross that
distance, meaning that unless we include general relativity the transit will happen
13
14 Chapter 3 Results
Figure 3.1 Motion After Each Orbit
about 18 seconds after NASA’s current prediction.
The transit happened exactly on time and as such, it would seem that Einstein was
right and that general relativity can be used to predict planetary location. This would
suggest that the other parts of the theory are valid and can be taken as accurate,
at least up to our ability to calculate and measure the effects. The transit itself
took about five and a half hours and according to my estimates there would be no
measurable difference in the transit time unless, we had more sensitive equipment.
Chapter 4
Conclusion
4.1 What This Means for General Relativity
Specific conditions are generally required to provide evidence for general relativity
as such it’s normally just a thought experiment, so it’s nice to provide some hard
evidence. The difference is very small and I cannot deny that this could be a simple
calculation error, however, we are talking about 43 arc seconds per century that’s
less than 12
an arc second per year. Burchell [1] voiced some disagreement and has
concluded that general relativity may not be as conclusive as it seems. Given how
small of a difference it made in my experiment, he may still have a point; however,
the experiment would need to be done with more precision in order to say for sure.
Once I included general relativity it made up the difference I needed. I am confident
in concluding that general relativity is the best explanation for the odd movement of
Mercury.
This lends itself to a lot of suggested evidences, namely that Einstein was right
in his way of thinking about the universe. This is not something that is universally
disputed but now anyone can test and see that it’s not just a thought experiment.
15
16 Chapter 4 Conclusion
With the understanding that general relativity is verifiable, we can conclude that
space-time does in fact act like an elastic fabric. It also suggests that if an object as
small as our Sun is able to create a measurable effect on a planet, then we can only
imagine what something that is ten or even a hundred solar masses can do.
Of course let’s not forget one of the more recent discoveries, gravitational waves.
Though my experiment does not directly provide evidence for the existence of gravi-
tational waves it does help validate the idea. Simply put, if one prediction of general
relativity can be verified then other parts of the theory are likely to be true as well.
And this may even include Time Travel as explained in the book ”Albert Einstein,
philosopher-scientist” [7]. Kurt Godel, explains in in a section titled ”A remark about
the relationship between relativity theory and idealistic philosophy”, that under very
extreme conditions time travel may be possible, he attributes the foundations of his
theory to General Relativity.
4.2 Other Methods
There are a few things that I would have liked to do differently and I think that
each has their positives and their negatives. Namely, when it comes to the math
of the gravitational effects of the other planets I used the calculations presented by
Burchell [1]. Now, I did this because I wanted to prove him wrong as he was trying
to prove that general relativity did not account for what we understand. However,
if I were to repeat the experiment I would prefer to calculate the effects of each
planet myself as this would provide a more accurate calculation. In addition, NASA
gives all their information in Cartesian for planetary location [6]. I then converted it
into spherical to help with the comparison to Earth. This may have caused a lot of
unnecessary math, it may be prudent to see if there would have been a better way.
4.3 Application 17
Using the perihelion advance of Mercury is not the only experiment one can per-
form. The most historically notable experiment for providing evidence for general
relativity is gravitational lensing. This is what happens when light passes a large
object like a distant galaxy or black hole. The only time someone without a NASA
telescope can see this effect is during a solar eclipse. Just like Eddingtons eclipse
experiment I referenced earlier, if you know the path of the eclipse you can chart the
stars that will be in the aria of the Sun. Then when the eclipse happens, chart them
again and you will see that the locations have changed. This would also show that
gravity has an effect on space time.
There are many other ways that one could provide evidence or verification for the
theory of general relativity. The method, I went with provides a level of simplicity
but I believe at the cost of some accuracy. Though many times in physics we give up
accuracy for simplicity and for most cases it comes out to be the same I would still
like to see how this could be perfected. The next transit will not be until 2032, which
would provide for a wonderful opportunity as there will be more time between it and
this last transit giving a bigger difference to look for.
4.3 Application
For this experiment and code you could simply change the initial conditions and look
at a different planet as I tried to keep it as general as possible. The one that comes to
mind first is Venus as it is the only other planet within Earth’s orbit. There are a few
problems with using Venus to prove general relativity. The main problems are that
the transits for Venus happen in pairs of 8 years apart, but each pair is separated by
121 years. The next transit for Vinus is not predicted to occur until the year 2125.
In addition one would need to find what effect general relativity has on Venus’s orbit
18 Chapter 4 Conclusion
if any.
This application could be taken to extra-solar planets as well; as I mentioned
I tried to keep it general though I had to make some assumptions for this specific
system. As long as you know the mass of the star a planet is orbiting, and the
observed period you could determine transit times, as well as if it is being affected
by general relativity. This could help in verifying mass of a planet or distance to
its star. Once you have verified that general relativity is affecting a planet you can
find the Newtonian effects as well and by extension make some estimates about the
organization of said solar system.
Finally we can see that the proper method to accurately predict the location of
Mercury is by including general relativity as explained by Einstein. By verifying that
his Mercury prediction is correct we are providing validity for the rest of his related
theories. Using these ideas we can infer information about massive objects or possibly
time travel. Though I believe more accuracy may be in order, I am convinced that
Einstein was right again and now anyone with a solar telescope can verify that.
Bibliography
[1] Bernard Burchell. Mercury’s perihelion advance, 2016.
http://alternativephysics.org/book/index.htm.
[2] University of Iowa. Imaging the universe, small-angle formula. Web Page, 2017.
http://astro.physics.uiowa.edu/ITU/glossary/small-angle-formula/.
[3] Sweden Paul Schlyter, Stockholm. how to compute planitary positions.
https://stjarnhimlen.se/comp/ppcomp.html, 2019.
[4] Chris Pollock. Mercury’s perihelion. http :
//www.math.toronto.edu/ colliand/42603/Papers03/CPollock.pdf , 2003.
[5] Jerry E. White Roger R. Bate, Donald D. Mueller. Fundamentals of Astrodynam-
ics. Dover Publications, Inc., 1971.
[6] Alan B. Chamberlin Ryan S. Park. Solar system dynamics.
https://ssd.jpl.nasa.gov/horizons.cgi, January 2020.
[7] & Einstein Albert Schilpp, P. A. Albert Einstein, philosopher-scientist. Library
of Living Philosophrs, 1949.
[8] Adam Szabo. How orbital motion is calculated. https://www-
spof.gsfc.nasa.gov/stargaze/Smotion.htm, 2016.
19
20 BIBLIOGRAPHY
[9] Anatoli Vankov. Einstein’s paper:“explanation of the perihelion motion of
mercury from general relativity theory”. Koniglich Preußische Akademie der
Wissenchaften, 01 2011. origonaly published 1915 Translated by Professor Roger
Rydin, University of Verginia.
Appendix A
Code for Mercury
1 # -*- coding: utf -8 -*-
2 """
3 Created on Tue Oct 1 14:04:50 2019
4
5 @author: user 1
6 """
7
8 from numpy import pi , sin , cos , sqrt , arctan , arccos
9
10 #######################################################
11 # using a recursive method to find the eccentric anomaly
12 #######################################################
13 def EcentricAnomaly(E,em ,M):
14 from math import sin
15 Enew = M + em*sin(E)
16 while abs(E - Enew) > 1e-8:
17 E = Enew
18 Enew = M + em*sin(E)
19
21
22 Chapter A Code for Mercury
20 return(Enew)
21
22 ########################################################
23 # calculate phi i.e. location above or below the ecliptic
24 #######################################################
25
26 def phiCalc(r,theta ,t):
27 from numpy import arccos , sqrt , pi
28 #staring information y = year , m = month , D = Day of month
29 y = 2016
30 m = 5
31 D = 9
32 d1 = 367*y-7*(y+(m+9) /12) /4+275*m/9+D -730530
33 UT = t/24 # a variable to keep a
consistent time
34 d = d1 + UT/24
35 #adjustment to phi with all mechanics considered
36 N = (48.3313+4.70935e-5*d)*(pi/180) #longitude of
ascending node
37 w = (29.1241+1.01444e-5*d)*(pi/180) #argument of
perihelion
38 i = (7.0047+5.00e-8*d)*(pi/180) #inclination to the
ecliptic
39
40 #adjustments to the phi angle with only Newtonian mechanics
considered
41 #N = (48.3313+((4.70935e-5*d)*0.92521))*(pi/180)
42 #w = (29.1241+((1.01444e-5*d)*0.92521))*(pi/180)
43 #i = (7.0047+((5.00e-8*d)*0.92521))*(pi/180)
44
45 x = r*(cos(N)*cos(theta+w)-sin(N)*sin(theta+w)*cos(i))
23
46 y = r*(sin(N)*cos(theta+w)+cos(N)*sin(theta+w)*cos(i))
47 z = r*(sin(theta+w)*sin(i))
48
49 J = z/(sqrt(x**2+y**2+z**2))
50 phi = arccos(J)
51
52 return phi
53
54 em = 0.20563069 #eccentricity of Mercury
55 a = 57909050.0 #semi -major axis in Km
56 T = 126675.36 #orbit of Mercury in Min
57
58 G = 6.67408e-11 #m^3/Kg s^2
59 Ms = 1.989 e30 #mass of the Sun in Kg
60
61 #Mercury ’s starting location
62 Mx = -2.98352231805042e-01 * 1.496e8
63 My = -3.39887939596431e-01 * 1.496e8
64 Mz = -4.01080274306904e-04 * 1.496e8
65 thetaT = arctan(My/Mx)+pi #total initial theta
66
67 #starting Mercury perihelion location
68 Px = 9.05492e-02 * 1.496e8
69 Py = 2.93617e-01 * 1.496e8
70 Pz = 1.56845e-02 * 1.496e8
71 thetaMp = arctan(Py/Px) #initial theta for perihelion
72 Mp = arccos ((em+cos (0))/(1+em*cos (0)))
73
74 theta1 = (thetaT - thetaMp) #initial true
anomaly
75 E = arccos ((cos(theta1)+em)/(1+em*cos(theta1))) #initial eccentric
24 Chapter A Code for Mercury
anomaly
76 n = sqrt((G*Ms)/((a*1000) **3))
77 Tp = -((Mp -em*sin(Mp))/n) #time of perihelion
passage
78 t = 0
79 t0 = (((E-em*sin(E))/n)+Tp)/60
80 Mo = 2*pi*(t0/T)+((13.6*( pi /(180*3600))))+((1.24*( pi /(180*3600))))
81 phi1 = arctan ((sqrt(Mx**2+My**2))/Mz)
82
83 x=[]
84 y=[]
85 z=[]
86 from numpy import mod
87 while t <= 1844362.63:
88 M = 2*pi*(t/T) + Mo #mean anomaly
89
90 Ef = EcentricAnomaly(E,em ,M) #replace old anomaly with new
91
92 r = a*(1-em*cos(Ef)) #solve for radius at time t
93
94 theta = arccos (1/em*((a*(1-em**2))/r-1)) #true anomaly at time
t
95
96 #keep the planet going in a circle
97 #correction statement to compensate for arccos limitation after
180
98 if pi < mod(Ef ,2*pi) < 2*pi:
99 theta = (2*pi) + (-1*theta)
100
101 phi = phiCalc(r,theta ,t)
102 phi1 = phi
25
103
104 xa = r*cos(theta)*sin(phi)
105 ya = r*sin(theta)*sin(phi)
106 za = r*cos(phi)
107
108 x.append(xa)
109 y.append(ya)
110 z.append(za)
111
112 E=Ef #new eccentric anomaly
113 t+= 1 #time step
114 last_r = r
115
116 print("phi",phi ,"Radius R", (r/10**6) ,"theta", (theta+thetaMp))
117
118 #########################################
119 #print a graph
120 #########################################
121
122 #from mpl_toolkits import mplot3d
123 #import numpy as np
124 #import matplotlib.pyplot as plt
125
126 #fig = plt.figure ()
127 #ax = plt.axes(projection ="3d")
128
129 #ax.scatter3D(x, y, z)
130 #ax.set_xlabel(’X ’)
131 #ax.set_ylabel(’Y ’)
132 #ax.set_zlabel(’Z ’)
133
26 Chapter A Code for Mercury
134 #ax.set_xlim (3.2*10**7 ,3.5*10**7)
135 #ax.set_ylim (3.2*10**7 ,3.5*10**7)
136 #ax.set_zlim (0.2*10**7 ,0.8*10**7)
137 #ax.set_aspect ("equal ")
138 #plt.show()
Appendix B
Code for Earth
1 # -*- coding: utf -8 -*-
2 """
3 Created on Mon Feb 10 16:29:33 2020
4
5 @author: user 1
6 """
7
8 from numpy import pi , sin , arccos , cos , sqrt , arctan
9
10 #######################################################
11 #using a recursive method to find the eccentric anomaly
12 #######################################################
13 def EcentricAnomalyE(E,ee ,M,Edif):
14 from math import sin
15 Enew = M + ee*sin(E)
16 while abs(E - Enew) > 1e-8:
17 E = Enew
18 Enew = M + ee*sin(E)
19 return(Enew)
27
28 Chapter B Code for Earth
20
21 ########################################################
22 #calculate phi i.e. location above or below the ecliptic
23 #######################################################
24
25 def phiCalcE(rE ,thetaE ,t):
26 from numpy import arccos , sqrt , pi
27 N = ( -11.26064) *(pi/180) #longitude of ascending node
28 w = (114.20703) *(pi/180) #argument of perihelion
29 i = 0 #inclination to the ecliptic
30
31 x = rE*(cos(N)*cos(thetaE+w)-sin(N)*sin(thetaE+w)*cos(i))
32 y = rE*(sin(N)*cos(thetaE+w)+cos(N)*sin(thetaE+w)*cos(i))
33 z = rE*(sin(thetaE+w)*sin(i))
34
35 J = z/(sqrt(x**2+y**2+z**2))
36 phiE = arccos(J)
37 return phiE
38
39 ee = 0.003353 #eccentricity of Earth
40 Ea = 149.60 e6 #semi -major axis in Km
41 T = 525948.768 #orbit of Earth in Min
42
43 G = 6.67408e-11 #m^3/Kg s^2
44 Ms = 1.989 e30 #mass of the Sun in Kg
45 m = 5.972 e24 #mass of Earth in kg
46
47 #Earth starting location
48 Ex = -6.619487581588294e-01 * 1.496e8
49 Ey = -7.62436937394947e-01 * 1.496e8
50 Ez = 3.386984851213855e-05 * 1.496e8
29
51 thetaT = arctan(Ey/Ex)+pi #total initial theta
52
53 #starting Earth perihelion location
54 Px = -2.00278e-01 * 1.496e8
55 Py = 9.62692e-01 * 1.496e8
56 Pz = -3.50150e-05 * 1.496e8
57 thetaEp = arctan(Py/Px)+pi #initial theta for perihelion
58 Ep = arccos ((ee+cos (0))/(1+ee*cos (0)))
59
60 thetaE = thetaT - thetaEp #initial true
anomaly
61 E = arccos ((ee+cos(thetaE))/(1+ee*cos(thetaE))) #initial eccentric
anomaly
62 n = sqrt((G*(Ms+m))/((Ea *1000) **3))
63 TpE = -((Ep -ee*sin(Ep))/n) #time of perihelion
passage
64 t = 0
65 t0 = (((E-ee*sin(E))/n)+TpE)/60
66 Mo = 2*pi*(t0/T)
67 phi1 = arccos(Ez/(sqrt(Ex**2+Ey**2+Ez**2)))
68
69 x=[]
70 y=[]
71 z=[]
72 from numpy import mod
73 while t <= 1845768.63:
74 M = 2*pi*(t/T) + Mo #mean anomaly
75
76 Edif = 1 #starting difference
77 Ef = EcentricAnomalyE(E,ee ,M,Edif) #replace old anomaly with
new
30 Chapter B Code for Earth
78
79 rE = Ea*(1-ee*cos(Ef)) #solve for radius at time
t
80
81 thetaE= arccos ((((Ea*(1-ee**2))/rE) -1)/ee) #true anomaly at
time t
82
83 #keep the planet going in a circle
84 #correction statement to compensate for arccos limitation after
180
85 if pi < mod(Ef ,2*pi) < 2*pi:
86 thetaE = (2*pi) + (-1* thetaE)
87
88 phiE = phiCalcE(rE ,thetaE ,t)
89 phi1 = phiE
90
91 xa = rE*cos(thetaE)*sin(phiE)
92 ya = rE*sin(thetaE)*sin(phiE)
93 za = rE*cos(phiE)
94
95 x.append(xa)
96 y.append(ya)
97 z.append(za)
98
99 E=Ef #new eccentric anomaly
100 t+= 1 #time step
101
102 print("phi", phiE ,"Radius R", (rE /10**6) ,"theta", (thetaE+thetaEp))
103
104 #########################################
105 #print a graph
31
106 #########################################
107
108 #from mpl_toolkits import mplot3d
109 #import numpy as np
110 #import matplotlib.pyplot as plt
111
112 #fig = plt.figure ()
113 #ax = plt.axes(projection ="3d")
114
115
116 #ax.scatter3D(x, y, z)
117 #ax.set_xlabel(’X ’)
118 #ax.set_ylabel(’Y ’)
119 #ax.set_zlabel(’Z ’)
120
121 #ax.set_xlim ( -10*10**7 ,10*10**7)
122 #ax.set_ylim ( -10*10**7 ,10*10**7)
123 #ax.set_zlim ( -10*10**7 ,10*10**7)
124 #ax.set_aspect ("equal ")
125 #plt.show()
32 Chapter B Code for Earth