{"id":19283709,"url":"https://github.com/alessionegri/spacecraftsimulator","last_synced_at":"2026-03-01T14:32:44.733Z","repository":{"id":239289902,"uuid":"799106955","full_name":"AlessioNegri/SpacecraftSimulator","owner":"AlessioNegri","description":"Spacecraft Dynamics And Missions Simulator","archived":false,"fork":false,"pushed_at":"2025-02-21T19:41:21.000Z","size":106391,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T02:44:48.952Z","etag":null,"topics":["astronautics","python","qml","simulation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlessioNegri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-11T07:44:30.000Z","updated_at":"2025-02-21T19:41:24.000Z","dependencies_parsed_at":"2024-09-07T21:39:52.055Z","dependency_job_id":"7cad2027-fa00-427a-9d33-3ec62b4ac208","html_url":"https://github.com/AlessioNegri/SpacecraftSimulator","commit_stats":null,"previous_names":["alessionegri/spacecraftsimulator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AlessioNegri/SpacecraftSimulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioNegri%2FSpacecraftSimulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioNegri%2FSpacecraftSimulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioNegri%2FSpacecraftSimulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioNegri%2FSpacecraftSimulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlessioNegri","download_url":"https://codeload.github.com/AlessioNegri/SpacecraftSimulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlessioNegri%2FSpacecraftSimulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29970988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T14:11:48.712Z","status":"ssl_error","status_checked_at":"2026-03-01T14:11:48.352Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astronautics","python","qml","simulation"],"created_at":"2024-11-09T21:34:42.695Z","updated_at":"2026-03-01T14:32:44.722Z","avatar_url":"https://github.com/AlessioNegri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpacecraftSimulator 🛰️\n\n**Spacecraft Dynamics And Missions Simulator**\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/about.png?\" width=\"50%\"\u003e\u003c/p\u003e\n\n![Static Badge](https://img.shields.io/badge/python-white?logo=python\u0026logoColor=white\u0026label=3.11.9\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/matplotlib-white?logo=python\u0026logoColor=white\u0026label=3.9.2\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/mplcyberpunk-white?logo=python\u0026logoColor=white\u0026label=0.7.1\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/numpy-white?logo=python\u0026logoColor=white\u0026label=2.0.2\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/scipy-white?logo=python\u0026logoColor=white\u0026label=1.14.1\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/qbstyles-white?logo=python\u0026logoColor=white\u0026label=0.1.4\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/pyinstaller-white?logo=python\u0026logoColor=white\u0026label=6.11.1\u0026labelColor=red\u0026color=darkcyan)\n![Static Badge](https://img.shields.io/badge/PySide6-white?logo=qt\u0026logoColor=white\u0026label=6.8.0\u0026labelColor=red\u0026color=darkcyan)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/home.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 1. Introduction 📖\n\nThe `Spacecraft Simulator` application has the objective to implement the algorithms used in **Orbital Mechanics**, **Launch Mechanics** ,and **Entry Mechanics**, integrating them inside a GUI application to simplify the analysis.\n\nI decided to adopt the *Python* language to develop all the algorithms due to the high variety of libraries for scientific applications.\n\nFor 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.\n\nThe **Missions** that can be simulated are the following:\n- `Orbit Insertion` \u003cbr/\u003e\nSimulate the launch phase when the spacecraft reaches the orbit from ground thanks to a launcher \u003cbr/\u003e\u003cbr/\u003e\n- `Orbit Transfer` \u003cbr/\u003e\nSimulate the cost in terms of $\\Delta v$, $\\Delta t$, and $\\Delta m$ of the transfer between a departure and an arrival orbit \u003cbr/\u003e\u003cbr/\u003e\n- `Orbit Propagation` \u003cbr/\u003e\nSimulate the propagation of an orbit around Earth due to perturbations \u003cbr/\u003e\u003cbr/\u003e\n- `Interplanetary Transfer` \u003cbr/\u003e\nSimulate the transfer between two planets of the Solar System \u003cbr/\u003e\u003cbr/\u003e\n- `Atmospheric Entry` \u003cbr/\u003e\nSimulate the re-entry of a capsule\n\n### 1.1 Languages \u0026 Libraries\n\nThe application is developed in `Python 3.11.9` and uses the following main libraries:\n\n- `matplotlib 3.9.2` for data visualization\n- `mplcyberpunk 0.7.1` for nice matplotlib plots\n- `numpy 2.0.2` for linear algebra and matrix manipulation\n- `scipy 1.14.1` for numerical intergration\n- `PySide6 6.8.0.2` for the Grafical User Interface\n- `qbstyles 0.1.4` for nice matplotlib plots\n- `pyinstaller 6.11.1` for executable generation\n\nThe front-end is developed in `Qt 6.8.0` using the `QML` language.\n\n### 1.2 Project's Structure\n\nThe project is structured in the following folders.\n\n- `dist`: contains the application executable\n- `images`: README images\n- `img`: icons and images used in the GUI\n- `lib`: list of external libraries\n    - `lib\\matplotlib_backend_qtquick`: library for integrating *matplotlib* in *QML*\n    - `lib\\pyextrema`: library implementing Matlab extrema function\n- `src`: back-end of the application\n    - `missions`: available missions\n    - `systems`: available systems\n    - `utility`: list of supporting classes\n- `tools`: algorithms\n    - `tools\\texture`: list of images for different astronomical objects\n- `ui`: front-end of the application\n    - `ui\\components`: list of components used in the GUI\n    - `ui\\dialogs`: list of dialogs\n    - `ui\\pages`: list of pages\n    - `main.qml`: root file of the QtQuick / QML project\n    - `qml.qrc`: resource file for the QtQuick / QML project\n    - `qtquickcontrols2.conf`: configuration file for the QtQuick / QML project\n- `generate.bat`: batch file used to compile the file *qml.qrc* in Python\n- `installer.bat`: pyinstaller command for the executable creation\n- `main.py`: root file of the Python project\n- `SpacecraftSimulator.spec`: pyinstaller generated file\n\n### 1.3 References\n\n#### Books\n\n\u003e **Orbital Mechanics for Engineering Students**\n\u003e - `Authors`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Howard D. Curtis\n\u003e - `ISBN`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;9780080977485\n\u003e - `Series`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Aerospace Engineering\n\u003e - `Year`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2013\n\u003e - `Publisher`\u0026nbsp;Elsevier Science\n\u003e - `URL`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;https://www.google.it/books/edition/Orbital_Mechanics_for_Engineering_Studen/2U9Z8k0TlTYC?hl=it\u0026gbpv=0\n\n\u003e **Manned Spacecraft: Design Principles**\n\u003e - `Authors`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Pasquale M. Sforza\n\u003e - `ISBN`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;9780128044254\n\u003e - `Series`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;Aerospace Engineering\n\u003e - `Year`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2016\n\u003e - `Publisher`\u0026nbsp;Butterworth-Heinenmann\n\u003e - `URL`\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;https://www.google.it/books/edition/Manned_Spacecraft_Design_Principles/ntWcBAAAQBAJ?hl=it\u0026gbpv=0\n\n\u003c!-- | Title  | Authors | ISBN | Series | Year | Publisher | URL |\n| ------------- | ------------- | ------------- | ------------- | ------------- | ------------- | ------------- |\n| Content Cell  | Content Cell  | Content Cell  | Content Cell  | Content Cell  | Content Cell  | Content Cell  | --\u003e\n\n#### GitHub Repositories\n\n\u003e **matplotlib_backend_qtquick**\n\u003e - `URL` https://github.com/jmitrevs/matplotlib_backend_qtquick\n\n\u003e **pyextrema**\n\u003e - `URL` https://github.com/manmadan03/pyextrema\n\n\u003e **qbstyles**\n\u003e - `URL` https://github.com/mckinsey/qbstyles\n\n\u003e **mplcyberpunk**\n\u003e - `URL` https://github.com/dhaitz/mplcyberpunk\n\n## 2. Systems ⚙️\n\nFrom the left menu, it is possible to configure all the properties of the systems and the missions. The **systems** managed are the following:\n- `Launcher`\n- `Spacecraft`\n- `Re-Entry Capsule` \u003cbr/\u003e\u003cbr/\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/launcher.png\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/launcher_details.png\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/spacecraft.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/re_entry_capsule.png\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 3 Orbit Insertion 🏷️\n\nThe first phase of a mission is to bring the spacecraft to space from Earth. This can be done thanks to a launcher. It is possible to simulate up to 3 **stages** in series activating them through the switch buttons. The **pitchover conditions** establish the altitude at which the rocket starts turning with a flight path angle slightly different from the 90 degress at launch. The **circular parking orbit conditions** allow the user to select the altitude of the target circular orbit, giving the value of the velocity for it.\n\nEach stage is characterized by some parameters used by the *Calculate Staging* button to make an initial estimate for the parameters the user find on the *Launcher* page.\n\nBy clicking on the `Simulate` button, the launcher trajectory and data can be visualized and analyzed from the main window. It can be seen, from the example below, that the launcher reached the target altitude with the desired velocity, with a small flight path angle. In addition, the usage of three stages allows keeping the acceleration at small values.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_insertion_1.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_insertion_2.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 4 Orbit Transfer 🏷️\n\nAn 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.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_transfer_1.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_transfer_2.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n### 4.1 Celestial Body\n\nFirst choose among the given celestial bodies.\n\n### 4.2 Departure \u0026 Arrival Orbits\n\nThe second step consists of configuring the **Departure Orbit** and **Arrival Orbit**. The orbits can be configured using one of the following representations: \u003cbr/\u003e\n- **Cartesian** based on the *position vector* and the *velocity vector* \u003cbr/\u003e\u003cbr/\u003e\n- **Keplerian** based on the orbital elements \u003cbr/\u003e\u003cbr/\u003e\n    - *Semi-major axis*\n    - *Eccentricity*\n    - *Inclination*\n    - *Right Ascension of the Ascending Node*\n    - *Anomaly of the Perigee*\n    - *True Anomaly*\n- **Modified Keplerian** based on the following elements \u003cbr/\u003e\u003cbr/\u003e\n    - *Periapsis Radius*\n    - *Apoapsis Radius*\n    - *Inclination*\n    - *Right Ascension of the Ascending Node*\n    - *Anomaly of the Perigee*\n    - *True Anomaly*\n\nA preview of the **Orbit** and the **Ground Track** can be visioned by clicking on the available buttons.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_preview.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/ground_track_preview.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n### 4.3 Maneuvers\n\nAt this point it is possible to configure the maneuvers for the transfer between the departure and the arrival orbits, among the following ones:\n- **Hohmann Transfer**\n- **Bi-Elliptic Hohmann Transfer**\n- **Plane Change Maneuver**\n- **Apse Line Rotation From Eta**\n\nAfter the transfer has been evaluated, the values of $\\Delta v$, $\\Delta t$, and $\\Delta m$ for each transfer are calculated for a detailed analysis of the cost of the transfer.\n\nBy clicking on the `Simulate` button, the transfer is simulated and becomes visible in the chart.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_transfer.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 5 Orbit Propagation 🏷️\n\nIn 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:\n- **Drag**\n- **Gravitational**\n- **Solar Radiation Pressure**\n- **Third Body**: the user shall select the third body between *Moon* and *Sun*\n\nfor a given set of initial orbital elements.\n\nBy clicking on the `Simulate` button, you can simulate the orbit propagation. The evolution of the orbital elements with respect to the initial values can be analyzed in the main window.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_propagation_1.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_propagation_2.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/orbit_propagation_3.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 6 Interplanetary Transfer 🏷️\n\nOne of the most interesting aspect of space is space exploration. In this section I explain how the user can simulate an interplanetary transfer.\n\n### 6.1 Analysis\n\nUnder 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 int the bottom right figure. Use the `Stop` button to finish the generation before it ends.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/interplanetary_transfer_1.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\nThis is a Pork Chop Plot between *Earth* and *Mars*.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/pork_chop_plot.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n### 6.2 Transfer\n\nAfter 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*.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/interplanetary_transfer_2.png?\" width=\"100%\"\u003e\u003c/p\u003e\n\n## 7 Atmospheric Entry 🏷️\n\nThe **Atmospheric Entry** problem studies what happens when an object (e.g. capsule carrying extraterrestrial meterial) re-enters on Earth.\n\n### 7.1 Entry Conditions\n\nUnder 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.\n\n### 7.2 Simulation\n\nAfter you have decided the *Entry Conditions*, by clicking on the `Simulate` button, the simulation is executed and the results shown on the charts below. Each chart represents a peculiar parameter of the analysis:\n\n- **Velocity vs Time**\n- **Acceleration g's vs Time**\n- **Altitude vs Downrange Distance**\n- **Fight Path Angle vs Time**\n- **Stagnation Point Convective Heat Flux vs Time**\n- **Stagnation Point Radiative Heat Flux vs Time**\n- **Altitude vs Velocity**\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"./images/atmospheric_entry_1.png\" width=\"100%\"\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./images/atmospheric_entry_2.png\" width=\"30%\"\u003e\n    \u0026nbsp;\n    \u003cimg src=\"./images/atmospheric_entry_3.png\" width=\"30%\"\u003e\n    \u0026nbsp;\n    \u003cimg src=\"./images/atmospheric_entry_4.png\" width=\"30%\"\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessionegri%2Fspacecraftsimulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falessionegri%2Fspacecraftsimulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falessionegri%2Fspacecraftsimulator/lists"}