The Simulation and the Calculation of the Shortest Hohmann Transfer Orbit to Mars

This paper will present the results and analyses of a simulation to send a satellite from the Earth to Mars. We use Python to simulate the orbit of the rocket. Our goal is to find the least energy-cost trajectory, with the least initial velocity. We find the date which allows the satellite to go from the Earth to Mars in the shortest distance based on a Hohmann transfer orbit considering the gravity of the Sun, Earth, and Mars.

a big obstacle. Since the Soviet Union launched its first Mars probe in 1960, 46 missions have been launched around the world, with less than a 45 percent success rate. In the last century, a total of thirty-three detectors were launched worldwide, but only 9 of them were completely successful. The key concerns of launching process are the calculation of the track and the unknown accidents. When the detector approaches Mars, a slight deviation in the orbital calculation will cause amplified error enough to pass the planet. Also to be practical, fuel is another serious problem, which means the limited size of the aircraft restricted the amount of fuel carried. Then in order to solve these two problems, we try to figure out a better trajectory that can minimize the use of fuel with our careful calculation. We chose the Hohmann transfer as the basic model of our trajectory, because it's undoubtedly the most fuel-efficient one of all the orbital paths, which has been proved hundreds of times, such as the article Journey to Mars: The physics of travelling to the red written by Stinner and Begoray (2005) [4]. In this paper, we simulate the launch of a detector from the Earth's low Earth orbit, continuous moving by passing the sun and entering the orbit of Mars under solar gravitation with the help of PYTHON. In addition, on the basis of Hohmann's orbit, we compared the 365 launch dates, the path generated, and the shortest distance path on a daily basis, which allows a relatively small amount of required fuel and short time. And then we calculated the time required, and the initial position of the Martian Earth, and chose the ideal launch date.

Organization
During our brainstorm, there were two routines of the probe from Earth to Mars that can travel for solving this problem: directly from the Perihelion of the Earth move to the Perihelion of Mars.
Because our simulation depends on the Hohmann transfer, we first simulated an elliptic trajectory from lower orbit (the earth orbit around the sun) to the higher orbit (the mars orbit around the sun). In order to be simple, we chose to simplified the whole solar system with seven planets to be only Sun, Earth, and Mars, and also treat Earth and Mars orbits as two circular orbits with the same center. Because we want the trajectory from Earth to Mars to be the shortest.
Then we treat the Perihelion coordinate to be the starting point from Earth, and the aphelion coordinate to be the ending point approaching Mars. We used the data (speed and distance from sun of the Perihelion coordinate and the aphelion coordinate of two planets) to dot a point on every final positions of mars and earth in a linear motion with the gravitational force, and gain two oval orbits of them. However, in fact, those two points, aphelion and Perihelion, are not in the same line, because there is an angle between the long-axis of two ellipses. We use the knowledge in geometry to figure out the coordinate of one point in mars orbit and successfully "turn the orbit of Mars in a certain angle". The orbits of two planets were fixed. The next step of the research was to add the probe into the simulation. We assume an initial altitude of probe and calculate the initial angle and the speed which allow the probe to reach Mars. We simulate the first situation (move directly toward mars). The result was it requires a numerous amounts of energy allowing the probe move toward mars, resisting the gravitational force exerted by Sun. Then, we considered Sun's gravity at first, and gain an approximate initial speed. Then, we tended to figure out the shortest distance for probe to reach Mars, and enter the orbit to rotate around mars. We used recursive algorithm again, to simulate every position of Earth on daily basis, found the shortest distance it need to take, and return the position of the earth. After we finished the final orbit of probe with the gravity of earth, we located the shortest position between the orbit of Mars and probe, and calculate the time of probe takes to reach this point. Finally, we calculated the initial position of mars. We used the possible mass of probe provided by professor to evaluate the altitude of the low mars orbit, and speed. We tried to figure out the shortest time period needed from launching from Earth and arriving on mars, but our computer was unable to finish such huge amount of computation. Then, we found the target launch date in the lists of the coordinates of earth and mars for our shortest routine plan and end up our research.

Experimental Tools
We used Python and Matlab to do the calculation and draw graph to simulate the orbits.

The Initial Data
In order to simulating the revolution orbit of Earth and Mars, we need initial data, the data is listed: 1) The mass, radius of Mars, Earth, and Sun respectively, and Distance to Sun, Perihelion Speed, Perihelion coordinates, and Period of Mars and Earth are displayed in Table 1 and Table 2. 2)

Depending Theory
Hohmann transfer a certain trajectory from the Earth to Mars. law of universal gravitation Newton's second law    Law of conservation of angular momentum The total angular momentum of a system remains constant unless acted on by an external torque.
x,y components We separated the x component and y component of Force, speed, acceleration. We calculate the gravitational forces between the Sun, Earth and Mars. The gravitational force between two masses is given by:

Simulation and Analysis
According to the Newton's second law F ma = , we obtain the acceleration:

Modeling the Revolution Orbit of Earth and Mars
In order to simulate the revolution orbit of Earth and Mars, we need Perihelion coordinates and Perihelion speed of Mars and Earth in the initial data. Choose the time step (t) as one minute. Combined with gravitational effect, we can get the acceleration: Therefore, the velocity varies by acceleration: Also, the position varies by velocity: Journal of Applied Mathematics and Physics Finally, the distance between the two objects is: Because we have known the initial theta, we can draw the elliptical revolution orbit of Earth and Mars by using these equations (see from Figure 1).

Determining the Trajectory
In order to find the least amount of fuel, we need to find the shortest distance from the initial position to the final position of the rocket.
Because of the Kepler's first law: all planets move around the Sun in elliptical orbits, having the Sun as one of the foci, the rocket's trajectory is elliptical and focuses on the Sun. As a result, the line connecting the initial position to the final position passes through the center of the Sun.
We have known that the initial position of the rocket is on the line between the Sun and Earth and 6800 km from the center of Earth and also on the line between the Sun and Mars and 3800 km from the center of Mars.
To find the shortest distance from the initial position to the final position, we use python to select it and print the coordinates of the initial and final position of the rocket. The results are below:

The Velocity of Rocket to Transfer into the Hohmann Orbit
A) Simplifying the original problem The problem in reality is quite difficult to solve by our hand calculation, we started from a simplified form that we ignore the competing gravitational effect from the Earth and Mars. In this situation, the rocket moves noticeably in a simple Keplerian elliptical orbit under the gravitation of the Sun, which we can use the Kepler's law to solve the problem.
According to the Kepler's second law, a line segment joining a planet and the Sun sweeps out equal areas during equal intervals of time, which represents the ratio of area to time as a constant.
Area swept in a very small time interval at the initial position: Area swept in a period: According to the Kepler's third law, Square of the orbital period of a planet is proportional to the cube of the semi-major axis of its orbit. Combining with the Newton's gravitation law, we can get the equation: The result is below:

B) Perturbation and Correction
Considering the competing gravitation of Sun, Earth and Mars, we can first get a range of the velocity.
-To determine the initial velocity We start with velocity l v , which is equal to the orbital speed of the earth around the sun plus the escape velocity from the Earth: l v = the lower speed a) The Lower Speed Because we ignore the Earth gravitational effect on the rocket, we can add the energy needed to escape from the earth to find a velocity which has lower magnitude than the actual velocity. Escape v = escape velocity from earth b) The Higher Speed Because planets conserve energy at any point as it moves around the same star in an elliptical orbit, we can use the conservation law of energy to calculate the speed difference between the initial position and final position.
According to the conservation law of energy: The figure of elliptical revolution orbits of Earth and Mars with pointing a and b is depicted in Figure 2.
We obtain the value of 18117 m s v ∆ = Journal of Applied Mathematics and Physics The sum of f v and v ∆ is greater than the true speed, because the ignorance of Earth and Mars gravitation. As a result, we obtain a range of speed at initial position Using the Newton's law of motion (Rocket Equation), we can get these functions: Input the initial position ( ) 0 0 , x y , the range of initial velocity (get results every 50), and the duration of time steps, these functions help us to modeling the trajectory. We can use python to add up these steps and using numerical method for integration. The result is below: 41600 m s i v = We then increase the velocity l v from velocity in small steps to find the trajectory that approximately intersects the designated point. From this process, we find the required change in velocity to be 648 m/s and the total velocity to be Journal of Applied Mathematics and Physics 41,600 m/s. With the total velocity, we find out that it takes 209 days for the satellite to approach to Mars.
We input the initial position ( ) We can then consider the 3 gravitational forces, and simulate the trajectory of the satellite as the Earth and Mars orbit the Sun.
We then iterate the initial velocity from 41,600 m/s to optimize the distance between the earth and Mars when they approximately get to the designated point. We thus get the optimal initial velocity Initial Velocity v , which is 41,655 m/s, and the distance between the satellite and Mars at that moment is 497,311 km.
The full figure of the trajectory and the figure of the designated part are shown in Figure 3.
In 4.2.3, we specifically explain how we draw the trajectory (see from Figure  4).

The Principle to Draw a Trajectory
To find out the position of the rocket at certain time and draw the trajectory, we can use the Newton's law of motion. and time step, we can get the initial acceleration; Input the initial speed and initial acceleration and time step, we can get the next step's velocity; Input the next step's velocity and time step, we can get Journal of Applied Mathematics and Physics   After launching from the Earth surface, the probe enters the orbit around Earth, which is 500 km above the Earth surface, with the velocity of 7605.662596 m/s.

Orbit from Low Earth Orbit Calculating the acceleration
Near Earth Orbit 6 5 6.67 10 5.965 10 7605.662596 m s 6.378 10 5 10 v And then, we change the velocity relative to the earth by plus a velocity change in order to reach the velocity to start the elliptical trajectory to Mars which is about 41,645 m/s relative to Sun. The process of velocity change of the probe near Earth is shown in Figure 5. The Thrust is 3000 tons, and the designed the mass of the rocket is 300 kg. The time period we use to change the velocity is now obvious to calculate According to the equivalent time around the orbit when accelerating, we can calculate the point where the probe starts the elliptical trajectory by python's data.

Simulating the Transfer
We use the python to simulate the picture, but we ignore the competing gravitation of Earth and Sun. So the rocket accelerates on the Low Earth orbit and get out of the orbit at the projection point.

Orbiting from Hohmann Transfer Orbit to Mars
Reconnaissance Orbit

Simplifying the Original Problem
The problem in reality is too complicated to solve, we started from a simplified form that we ignore the competing gravitational effect from the Earth and Mars. In this situation, the rocket moves noticeably a simple Keplerian ellipse under the gravitation of the Sun, which we can use the Kepler's law to solve the problem.
We calculated the area that the Mars swept from the initial position to the end position by the function: Because of the Kepler's second law, we know that the ratio of area to time as a constant. We know that it takes 209 days to Mars. After that, we need to use python to rearrange the data.

Perturbation and Correction
Considering the competing gravitation of Sun, Earth and Mars, we can first get a range of the period.
Because this initial day does not change so much, that we can try more days to make it better (adjust the period to enable the velocity).
Starting point: the point where we start entering the trajectory from the near surface orbit about 500 km height above the earth surface.
Starting point = initial position. Designated point: the point where we first get close to Mars (within 500,000 km). Journal of Applied Mathematics and Physics -To change the velocity to get closer to Mars (within 5000 km from the mass center of the Mars). In order to get closer to Mars which is necessary for us to enter the orbit around Mars, we plan to change the velocity again by changing the acceleration on XY component, to get to the point within 5000 km away from Mars.

The Date the Satellite Escape the Orbit of the Earth
We use the table including the Azimuth angle and the distance from Mars and the earth to the sun on each day separately to find the date of the earth appearing on the perihelion. According to our calculation, we know if we speed up the satellite and escape from the earth orbit after the earth passes the perihelion, the distance the satellite getting to Mars is the shortest route. Then we find the next date of the earth arrives its perihelion, add 28 days after it, we get the ideal date is January the 31st in 2019.

Conclusions
By modeling the condition of launching a rocket to Mars and simulating the rocket trajectory, we have successfully optimized the route that enables the rocket efficiently travel from Earth to Mars within a short period of 209 days, by adjusting the initial values of the launching condition to a precision of 3 figures in our attempts to orbit around Mars. With the thrust provided and the calculated trajectory, we are able to send 300-tons rocket into space, which also signifies a large effective payload of rocket being put into the orbit of Mars. However, along with all our achievements also come the drawbacks. We ignore other planets' gravity in the solar system.
We have tried our best to make our result as closer to the real situation as possible, but there are two limitations in our simulation that cause the error. Since our computers are not capable of running the code for some precise calculation, we have to approximate the real situation with some other ways to reduce the computation.
The first limitation is that the displacements of planets and probe in an extremely short period are infinitely close to linear segments, but our computers are not able to deal with the computation of such extremely short time period or integral. The only way we can cope with it is to calculate the linear displacement in certain short time period to simulate the real arc displacement of them. The second limitation is that we try to figure out the initial coordinates of Mars and Earth about the shortest time period plan, because the shortest time period means fewer risks for the probe to be damaged in the space. Our computers do not allow us to finish this simulation, so we have to abandon this plan.
Actually, although these approximations or errors have little impact on the result of the simulation, we have to admit that there is some unavoidable error between our simulation and the real situation of the movement of those celestial bodies.