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 from this repo rendered as notebooks.
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, using the create_scripts.py
script in this repo.
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
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.
The examples are organized in different categories.
- Propagation: Examples showcasing various aspects of the state propagation functionality in Tudat, ranging from simple unperturbed orbits, to complex multi-body dynamics, re-entry guidance, etc.
- Estimation: Examples showcasing various aspects of the state estimation functionality, from both simulated data and real data, such as astrometric data of asteroids, and radio tracking data of planetary missions.
- Mission Design: Examples showcasing the preliminary mission design functionality in Tudat, which provides (semi-)analytical design of transfer trajectory using both low- and high-thrust
- Optimization: Examples showing how to optimize a problem modelled with Tudatpy via algorithms provided by Pygmo.
Contributions to this repository are always welcome.
It is recommended to use the tudat-examples
conda environment for the development of example applications (created using this .yaml file), as it contains all dependencies for the creation and maintenance of example applications, such as ipython
, nbconvert
in addition to pygmo
. However, examples developed using the regular (or develop) conda environment are also most welcome!
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.