Spacecraft Dynamics And Missions Simulator
The Spacecraft Simulator
application has the objective to implement the algorithms used in Orbital Mechanics and Entry Mechanics, integrating them inside a GUI application to simplify the analysis.
I decided to adopt the Python language to develop all the algorithms due to the high variety of libraries for scientific applications.
For the Graphical User Interface (GUI) I decided to rely on the QML language (part of the Qt environment) due to its flexibility and the nice and modern fill it can reach.
The application is developed in Python 3.11.9
and uses the following main libraries:
matplotlib 3.9.2
for data visualizationmplcyberpunk 0.7.1
for nice matplotlib plotsnumpy 2.0.2
for linear algebra and matrix manipulationscipy 1.14.1
for numerical intergrationPySide6 6.8.0.2
for the Grafical User Interfaceqbstyles 0.1.4
for nice matplotlib plots
The front-end is developed in Qt 6.8.0
using the QML
language.
The project is structured in the following folders.
images
: README imagesimg
: icons and images used in the GUIlib
: list of external librarieslib\matplotlib_backend_qtquick
: library for integrating matplotlib in QMLlib\pyextrema
: library implementing Matlab extrema function
src
: back-end of the applicationtools
: algorithmstools\texture
: list of images for different astronomical objects
ui
: front-end of the applicationui\components
: list of components used in the GUIui\dialogs
: list of dialogsui\pages
: list of pagesmain.qml
: root file of the QtQuick / QML projectqml.qrc
: resource file for the QtQuick / QML projectqtquickcontrols2.conf
: configuration file for the QtQuick / QML project
generate.bat
: batch file used to compile the file qml.qrc in Pythonmain.py
: root file of the Python project
Orbital Mechanics for Engineering Students
Authors
Howard D. CurtisISBN
9780080977485Series
Aerospace EngineeringYear
2013Publisher
Elsevier ScienceURL
https://www.google.it/books/edition/Orbital_Mechanics_for_Engineering_Studen/2U9Z8k0TlTYC?hl=it&gbpv=0
Manned Spacecraft: Design Principles
Authors
Pasquale M. SforzaISBN
9780128044254Series
Aerospace EngineeringYear
2016Publisher
Butterworth-HeinenmannURL
https://www.google.it/books/edition/Manned_Spacecraft_Design_Principles/ntWcBAAAQBAJ?hl=it&gbpv=0
matplotlib_backend_qtquick
pyextrema
qbstyles
mplcyberpunk
Under the menu item Edit \ Mission Settings
it is possible to configure the all the properties of the systems and the missions.
This dialog contains in the left the list of all sections. The sections are divided into two parts (differentiated by their color):
- Systems Settings comprising all the properties of the different systems:
Launcher
(TODO)Spacecraft
Re-Entry Capsule
-
Mission Settings comprising the parameters to configure the different types of mission:
-
Orbit Insertion
(TODO)
-
Orbit Transfer
Simulate the cost in terms of$\Delta v$ ,$\Delta t$ , and$\Delta m$ of the transfer between a departure and an arrival orbit
-
Orbit Propagation
Simulate the propagation of an orbit around Earth due to perturbations
-
Interplanetary Transfer
Simulate the transfer between two planets of the Solar System
-
Atmospheric Entry
Simulate the re-entry of a capsule
-
By clicking on a section, the right part of the dialog populates with the corresponding parameters that can be configured. All these missions will be discussed in detail in the following sections.
An orbit transfer consists of a set of maneuvers to move a spacecraft from a departure orbit towards an arrival orbit. The user can decide the two orbits and the list of maneuver to simulate an orbit transfer.
First choose among the given celestial bodies.
The second step consists of configuring the Departure Orbit and Arrival Orbit. The orbits can be configured using one of the following representations:
- Cartesian based on the position vector and the velocity vector
- Keplerian based on the orbital elements
- Semi-major axis
- Eccentricity
- Inclination
- Right Ascension of the Ascending Node
- Anomaly of the Perigee
- True Anomaly
- Modified Keplerian based on the following elements
- Periapsis Radius
- Apoapsis Radius
- Inclination
- Right Ascension of the Ascending Node
- Anomaly of the Perigee
- True Anomaly
A preview of the Orbit and the Ground Track can be visioned by clicking on the available buttons.
At this point it is possible to configure the maneuvers for the transfer between the departure and the arrival orbits, among the following ones:
- Hohmann Transfer
- Bi-Elliptic Hohmann Transfer
- Plane Change Maneuver
- Apse Line Rotation From Eta
After the transfer has been evaluated, the values of
By clicking on the Run
button, the transfer is simulated and becomes visible in the chart.
In the Orbit Propagation mission it is possible to analyze the effects of the following perturbations on an orbit around Earth in a range of dates:
- Drag
- Gravitational
- Solar Radiation Pressure
- Third Body: the user shall select the third body between Moon and Sun
for a given set of initial orbital elements.
To simulate the orbit propagation click on the Run
button. The evolution of the orbital elements with respect to the initial values can be analyzed in the main window.
One of the most interesting aspect of space is space exploration. In this section I explain how the user can simulate an interplanetary transfer.
Under the section Interplanetary Transfer
it is possible to analyze/design the interplanetary transfer bewteen two planets of the Solar System, given a Launch Window and an Arrival Window. Once selected the parameters, by clicking on the Generate
button the Pork Chop Plot is generated, and can be seen by clicking on the Show
button. Use the Stop
button to finish the generation before it ends.
This is a Pork Chop Plot between Earth and Neptune.
After the analysis of the Pork Chop Plot, the actual transfer can be simulated, by choosing the effective departure and arrival dates, and the departure and arrival orbits around the planets. The following is a simulation for a tansfer between Earth and Mars.
The Atmospheric Entry problem studies what happens when an object (e.g. capsule carrying extraterrestrial meterial) re-enters on Earth.
Under the section Atmospheric Entry
it is possible to set up the parameters needed to simulate a capsule re-entry: some of the data are also present in the Capsule section. The user can activate / deactivate the usage of the parachute. Under the results sub-section the user can analyze the Impact Velocity at ground.
After you have decided the Entry Conditions, by clicking on the Run
button, the simulation is executed and the results shown on the charts below. Each chart represents a peculiar parameter of the analysis:
- Velocity vs Time
- Acceleration g's vs Time
- Altitude vs Downrange Distance
- Fight Path Angle vs Time
- Stagnation Point Convective Heat Flux vs Time
- Altitude vs Velocity