We present a simulation of a rocket’s path from Earth's surface to the orbit of the Moon. We model the complex dynamics involved in rocket propulsion, gravitational interactions, and orbital mechanics by leveraging differential equations and numerical methods. Our simulation captures the stages of ascent, including liftoff, trajectory optimization, and orbital insertion. Through detailed analysis and visualization, we explore the critical factors influencing orbital maneuvers required for this trajectory. The results offer insights into the challenges and considerations of space exploration, paving the way for future missions to celestial bodies beyond Earth's orbit.
Space travel presents a highly relevant and classic optimal control problem, influenced by numerous factors such as drag, fuel consumption, gravitational forces from multiple celestial bodies, and varying mass considerations. Navigating a rocket from Earth's surface to the Moon's orbit requires modeling complex dynamics that encompass rocket propulsion, gravitational interactions, and orbital mechanics. We rely on a set of differential equations and numerical methods to simulate and analyze these dynamics in order to accurately optimize trajectory and orbital insertion.
Understanding and optimizing orbital maneuvers for interplanetary travel has been a longstanding challenge in aerospace engineering and space exploration. Previous research has explored various aspects of trajectory optimization, spacecraft propulsion, and orbital transfers to achieve efficient and successful missions beyond Earth's immediate vicinity. One such investigation is "Minimum-time Earth–Moon and Moon–Earth orbital maneuvers using time-domain finite element method" by S.A. Fazelzadeh and G.A. Varzandian that employed a method similar to ours. Another instance of prior research that our project built upon was a Volume 4 example project from 2020 'Rocket Launch Trajectory' by Ahn et. al. This project attempted to reach Earth's orbit, and we wanted to build on this by leaving Earth's orbit and reaching the moon's. Notably, the formulation and solution of optimal control problems have been instrumental in advancing our understanding of spaceflight dynamics and guiding mission planning efforts in order to achieve recent feats such as landing on the moon and Mars.
This study builds upon existing research by focusing on the specific trajectory from Earth's surface to the moon's orbit. By conducting detailed analysis and visualizing critical factors affecting orbital maneuvers, our simulation provides valuable insights into the challenges and considerations of space exploration beyond Earth's orbit. The results obtained pave the way for enhanced mission planning and spacecraft design, contributing to the realization of future missions to celestial bodies throughout the solar system and beyond.
To solve this problem, we defined a cost functional, a state-space evolution equation, and initial and endpoint conditions. We then utilized Pontraygin’s maximum principle (PMP) to formulate the co-state evolution equations and solve for the optimal control in terms of the co-state. This theorem allows us to set up a boundary-value problem and solve for the state, costate and optimal control. We define the code and steps for this process below. We also made several simplifying assumptions in this project as follows.
Assumptions
- Rocket, earth, and moon have point mass for the sake of calculating gravity
- Rocket, earth, and moon are the only objects for the sake of calculating gravity (no influence of the sun, stars, etc)
- Rocket, earth, and moon lie on a 2D plane
- Moon's orbit is perfectly circular
- Rocket's mass does not change
- Rocket is single stage
- The earth's position remains at the origin of the 2D plane
- The moon's position at time zero is on the
$x$ -axis
Unless otherwise specified, we define the units for this project as follows:
- Mass: kilograms (kg)
- Distance: meters (m)
- Force: newtons (N)
- Angle: degrees (°)
- Speed: meters per second (m/s)
- Time: seconds (s)
We seek to find the optimal thrust for a rocket to leave Earth and begin orbiting the moon. To do so, we set up our cost functional as
where we can interpret
as the thrust in the
where
-
$c$ is the scaling constant for the cost of thrust -
$R_e$ is the radius of the Earth, -
$L_m$ is the distance from the Earth to the moon, -
$R_m$ is the radius of the moon, -
$h_f$ is the desired height above the moon to enter orbit, -
$v_f$ is the final velocity of the rocket to enter orbit, -
$\omega_e$ is the angular velocity of the Earth at the equator, -
$\theta$ is the angle between the$x$ -axis and the line between the Earth and the moon, assuming the Earth is at the origin.
We define our state space equation as
and our state space evolution equation as
where
where
-
$G$ is the universal gravitational constant -
$M_e$ is the mass of the Earth -
$M_m$ is the mass of the moon -
$m_r$ is the mass of the rocket -
$u_x$ is the rocket's thrust in the$x$ direction -
$u_y$ is the rocket's thrust in the$y$ direction -
$L_x$ is the$x$ position of the moon -
$L_y$ is the$y$ position of the moon -
$c$ is the drag constant$\frac{1}{4}$ -
$A$ is the surface area of the top of the rocket -
$\rho(x,y)$ is the air density at position$(x,y)$
We now derive the Hamiltonian equation. We have
Plugging in
We now derive the necessary equations for the PMP. We first derive the necessary equations for the adjoint equations (co-state evolution). We have
Using
Our initial attempt at this problem included a stationary moon. This assumption reduced the complexity of our evolution equations and still lead to acceptable results. We included the static location of the moon in the numerical solver by providing the angle
We see that when the moon is stationary and on the
We also tested our system when the moon was not on the
Similar to when the moon was on the
Once we were able to achieve satisfactory results with a stationary moon, we removed this simplifying assumption and allowed the moon to move.
Throughout this project we made several simplifying assumptions. From these assumptions, we achieved satisfactory results and learned more about the complicated dynamics of space travel as we can see in the images above. Despite these results, we feel that the project is not yet at its full potential and could be improved in several ways.
One of the first improvements is implementing variable fuel consumption, thus adding variable weight to the rocket. This improvement would change the rocket's optimal solution and make the problem more realistic.
A second improvement is making the rocket's limitations more realistic. In typical rocket launches, the rocket has at least two phases: a phase inside the Earth's atmosphere and a phase outside the Earth's atmosphere. This design involves a drastic change in the rocket's weight and maximum thrust, which would be a significant change to our model that would allow for a more accurate reflection of the dynamics of a real rocket launch.
The final improvement we would make is optimizing our system over final time. Including final time in the cost function would allow us to achieve a solution that is not only optimal over thrust, but also over time. Finding the optimal time to reach the moon would make the results of the system much more interesting and would potentially lead to new insights into the dynamics of space travel.