realoot

Solve the averaged low-thrust optimal control transfer problem


Keywords
"optimal, control", "space, trajectory", orbit, aerospace, applied mathematics, mission analysis, optimal control, optimization, space
License
GPL-3.0
Install
pip install realoot==1.0.2

Documentation

README

Preambule

The application solves the averaged optimal minimum time orbit transfer problem. It is initially inspired by [MIPELEC] that uses the averaged optimal control formulation. This application however includes important upgrade, such as:

  • different terminal conditions
  • inclusion of zonal gravitational field perturbation to model secular evolution of node and apoapsis lines, around an oblate body.

IMPORTANT WARNINGS

  1. The optimal control is the solution of the averaged optimal control problem.
    • It cannot be used as such for high fidelity propagation,
    • It cannot currently be used for rendezvous problems (e.g. interplanetary)
  2. The solution starts diverging from the non-averaged optimal control problem solution for very large thrust accelerations.

Compiling and Running

Requirements

  1. A C++11 compiler (The build chain is based on CMake)
  2. The application should compile on Windows, Linux and Max. I have actually tested it on Windows (Cygwin) and Linux.
  3. Optionally Python

Download the sources

Download the latest version source code from the main page as a zip.

Third-parties

There are mandatory third-party products:

  1. Eigen, a very nice C++ math library. You can found it here: eigen
  2. Apache Xerces-C++ XML Parser library is necessary for linking.
    • Xerces is available as binary distribution for Cygwin.
    • For Linux, install liberces-c-dev.
    • Any other case, download and compile the source.
  3. Boost for Python wrapper

Compiling

The building and compilation is based on cross platform CMake configuration file. Go into the root folder. In a console, type

mkdir build_directory
cd build_directory
cmake -DCMAKE_INSTALL_PREFIX=[your install path] ..

where [your install path] defines the installation destination directory ("prefix"). (If omitted, the build would most probably be installed in /usr/local.)

Then:

make
make install

The build [your install path] folder should contain:

  • an executable,
  • lib directory with the static and share libraries,
  • the Python package,
  • examples directory.

If you want to compile the unit tests, add DBUILD_TESTS to the cmake call,

cmake -DBUILD_TESTS=ON .

and then run: ctest or make test

If you do not want to the Python Package,

cmake -DBUILD_PY_PKG=OFF .

Using the Application

In the build directory, you should now be able to run the app by running the executable. The program takes as input an script, which define the problem and the program options. Have a look at input.xml for guidance on how to setup the problem. The program is then launch with realoot [input xml file]

Using the Module under python

Import

	from realoot import core, utils, main as lt

Then either, as for the application, open a script file with

	reader = utils.InputScriptReader()
	problemDefinition, problemContext = reader.readXml("examples/ex2.xml")
	lt.solve(problemDefinition, problemContext, problemSolution, True)

Or define manually your problem filling the structure

	problemContext = core.LtProblemContext()
	problemDefinition = core.LtProblemDefinition()

Then call

	lt.solve(problemDefinition, problemContext, problemSolution, True)

Please see the examples for details.

To run Python unit tests, run:

python -m unittest discover -v --start-directory test

Credits