OMDc  1.0.0
created from 0b26fa0 on deploy-documentation

This repo contains the implementation of OMDc that was presented at the European Control Conference 2025.

Assuming that you are in the repo's directory, the quick start is

cmake -B build -S .
cmake --build build --target all
./build/test/testOMDc

Note that you have to activate optimized compilation with -DCMAKE_BUILD_TYPE=Release when configuring the project with cmake. See the sections Configurations and Targets below to build the Matlab or Python interface, and generate the documentation with doxygen.

Citing our Work

If you found OMDc useful in your scientific work, we encourage you to cite our main paper:

@inproceedings{mieg2025omdc,
author = {Mieg, Lucas and M\"onnigmann, Martin},
booktitle = {2025 23rd IEEE European Control Conference (ECC)},
title = {Optimal Mode Decomposition for control},
year = {2025},
volume = {},
number = {},
pages = {},
doi = {}
}

Documentation

This project is documented with doxygen within the source code. The documentation can be compiled with

cmake -S . -B <YOUR_BUILD_DIR> -DGENERATE_DOCS=Yes
cmake --build <YOUR_BUILD_DIR> --target documentation

Ensure that doxygen is available to cmake. The documenation is also available on Gitlab-Pages under OMDc Documentation.

You may use Awesome Doxygen by specifying

cmake -S . -B <YOUR_BUILD_DIR> -DAwesome_CSS_DIR=<PATH_TO_AWESOME_DOXYGEN>

Configuration Options

The cmake project supplies several options for building interfaces

Key Info required cmake-packages Default
BUILD_Matlab builds with Matlab mex interface Matlab mex Off
BUILD_Python builds with Python interface Python, pybind11 Off
USE_BLAS links to external BLAS lib. BLAS Off
USE_OPEN_MP multi-threading with OpenMP OpenMP Off
GENERATE_DOCS generate html documentation Doxygen Off
USE_UTF8_FMT print iter. with UT8 formatting n/a Off

The default configuration only requires the Eigen3 library. The project only specifies static libraries to be linked with, see below. The following command will compile a test target that links against the OMDc framework.

cmake -S . -B <YOUR_BUILD_DIR>
cmake --build <YOUR_BUILD_DIR> --target testOMDc --parallel

It only requires Eigen3 to be accessible to cmake. A list of all user-defined variables can be queried with

cmake -S . -B <YOUR_BUILD_DIR> -LH

Note on Matlab mex

This project is not built with the mex command inside Matlab, but with the compiler specified to CMake. Find the related documentation under FindMatlab(). Also note the cross-compilation remarks below.

Targets

The interface targets are only available if corresponding options are activated. The static libraries are always configured, and used by the interfaces.

Framework Static library Matlab interface Python interface Other
Documenation n/a n/a n/a documentation
OMD omd-impl omd-mex omd-py n/a
OMDc omdc-impl omdc-mex omdc-py n/a

Cross-compilation

The Matlab interface can be cross-compiled from Windows Subsystem for Linux (WSL) to Windows, linking to a Matlab installation on the hosting Windows. It was tested with WSL/Ubuntu-22.04 using mingw64 from the standard Ubuntu packages. The Matlab installation must be accessible from WSL with drvfs. The project is configured by

cmake -S . -B <YOUR_BUILD_DIR> --toolchain TC-windows.cmake -DBUILD_Matlab=True

where a toolchain file, e.g. TC-windows.cmake, defines the necessary environment:

set(CMAKE_SYSTEM_NAME Windows)

set(Matlab_ROOT_DIR "<WSL_PATH_TO_MATLAB_DIR>")

# explicitly set mex extension for windows, because mexext.bat is badly executed
set(Matlab_MEX_EXTENSION "mexw64")
# matlab version cannot be identified, ensure C++
set(Matlab_HAS_CPP_API True)

# ensure posix thread model for std::future
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-10-posix)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix)

# The necessary .dll's libraries are under:
#   /usr/lib/gcc/x86_64-w64-mingw32/10-posix
# the windows pthreads (winpthread.dll) are under 
#   /usr/x86_64-w64-mingw32/lib

# copied from online: cmake cross compile
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

Automatic Control and Systems Theory, Ruhr-Univeristy Bochum