Welcome to the repository showcasing example applications set up with Tudatpy!
If you want to know more about Tudatpy, please visit the Tudat website. The website also holds the examples rendered as notebooks. Any update to the examples in this repository will automatically update the website repository via the Sync tudat-space submodule action.
The examples are organized in different categories.
Examples related to state estimation.
covariance_estimated_parameters
: setup of an orbit estimation problem, definition and propagation of the covariance matrix.estimation_dynamical_models
: application of different dynamical models to the simulation of observations and the estimation.full_estimation_example
: full estimation of individual parameters.retrieving_mpc_observation_data
: using Tudat'sBatchMPC
class for the retrieval and processing of observational data of minor planets, comets and outer irregular natural satellites of the major planets.estimation_with_mpc
: using real observational data from the Minor Planet Center (MPC) for the initial state estimation of a minor body.improved_estimation_with_mpc
: extension of theestimation_with_mpc
example. Introduce and compare the effects of including satellite data, star catalog corrections, observation weighting and more expansive acceleration models in the estimation, retrieval of JPL Horizons data.galilean_moons_state_estimation
: using ephemeris data to simulate observations and enhance the accuracy of predicted orbits of the Galilean moons.mro_range_estimation
: loading tracking observations from Mars Reconnaissance Orbiter (MRO) with a variety of Deep Space Network (DSN) ground stations.
Examples related to mission design.
mga_trajectories
: simulation of Multiple Gravity Assist (MGA) transfer trajectories using high- and low-thrust transfers, as well as deep space maneuvers (DSMs).cassini1_mga_optimization
: using PyGMO to optimize an interplanetary transfer trajectory simulated using the multiple gravity assist (MGA) module of Tudat.hodographic_shaping_mga_optimization
: extension of thecassini1_mga_optimization
example. Optimization of a low-thrust interplanetary transfer trajectory using the hodographic shaping method for the low-thrust legs.earth_mars_transfer_window
: usage of the Tudatpy'sporkchop
module to determine an optimal launch window (departure and arrival date) for an Earth-Mars transfer mission.low_thrust_earth_mars_transfer_window
: extension of theearth_mars_transfer_window
example, modelling the interplanetary leg as low-thrust leg.
Examples related to state propagation.
Introductory examples:
keplerian_satellite_orbit
: simulation of a Keplerian orbit around Earth (two-body problem).perturbed_satellite_orbit
: simulation of a perturbed orbit around Earth.linear_sensitivity_analysis
: extension of theperturbed_satellite_orbit
example to propagate variational equations to perform a sensitivity analysis.solar_system_propagation
: numerical propagation of solar-system bodies, showing how a hierarchical, multi-body simulation can be set up.thrust_between_Earth_Moon
: transfer trajectory between the Earth and the Moon that implements a simple thrust guidance scheme.thrust_satellite_engine
: using a custom class to model the thrust of a satellite.two_stage_rocket_ascent
: simulation of an ascent trajectory of a two-stage rocket. Implementation of a custom thrust model and hybrid termination condition.
Advanced examples:
reentry_trajectory
: simulation of a reentry flight for the Space Transportation System (STS) and implementation of aerodynamic guidance.separation_satellites_diff_drag
: shows the effects of differential drag for CubeSats in LEO.coupled_translational_rotational_dynamics
: using a multi-type propagator to simulate the coupled translational-rotational dynamics of Phobos around Mars.impact_manifolds_lpo_cr3bp
: setup and propagation of orbits and their invariant manifolds in the circular restricted three body problem (CR3BP) with a polyhedral secondary body.
Examples showing how to optimize a problem modelled with Tudatpy via algorithms provided by Pygmo.
himmelblau_optimization
: finds the minimum of an analytical function to show the basic usage of Pygmoasteroid_orbit_optimization
: simulates the orbit around the Itokawa asteroid and finds the initial state that ensures optimal coverage and close approaches
The examples are available as both Jupyter Notebooks and raw .py
scripts. The Python scripts are auto-generated from the Jupyter notebooks to ensure consistency.
To run these examples, first create the tudat-space
conda environment to install tudatpy
and its required dependencies, as described here.
Then, make sure that the tudat-space
environment is activated:
conda activate tudat-space
Two packages then need to be added to this environment. First, the notebook
package is needed to run the Jupyter notebooks:
conda install notebook
Then, if you wish to be able to run the Pygmo
examples, this package also need to be installed:
conda install pygmo
The tudat-space
environment has to be added to the Jupyter kernel, running the following:
python -m ipykernel install --user --name=tudat-space
Finally, run the following command to start the Jupyter notebooks:
jupyter notebook
To run the examples as regular Python files, you can clone this repository, open the examples on your favorite IDE, and install the tudat-space
conda environment, as described here.
All of the examples, provided as .py
files, can then be run and edited as you see fit.
Please note that these .py
files were generated from the Jupyter Notebooks.
We set up a repository on MyBinder: this way, you can explore and run the examples online, without having to set up a development environment or installing the tudatpy conda environment. Click on the button below to launch the examples on mybinder
:
Contributions to this repository are always welcome.
It is recommended to use the tudat-examples
conda environment for the development of example applications, as it contains all dependencies for the creation and maintenance of example applications, such as ipython
, nbconvert
in addition to pygmo
.
Simply install the environment using
conda env create -f environment.yaml
and then activate it:
conda activate tudat-examples
The following guidelines should be followed when creating a new example application.
-
Any modification or addition to this set of examples should be made in a personal fork of the current repository. No changes are to be done directly on a local clone of this repo.
-
The example should be written directly on a Jupyter notebook (
.ipynb
file). -
Convert the finished
.ipynb
example to a.py
file with thecreate_scripts.py
CLI utility:-
Activate the virtual environment:
conda activate tudat-examples
-
Use the
create_scripts.py
CLI application to convert your notebook:python create_scripts.py path/to/your/notebook.ipynb
By default, this converts the
.ipynb
notebook to a.py
file, cleans it, checks for syntax errors and runs it. -
Use the
-h
flag to see the available options of the CLI utility. A common set of options ispython create_scripts.py -a --no-run
That converts all
.ipynb
files to.py
files, cleans and checks them for syntax errors but does not run them.
-
-
At this point, the example is complete. You are ready to create a pull request from your personal fork to the current repository, and the admins will take it from there.