Home
π About CoFmuPy¶
CoFmuPy is a Python library designed for rapid prototyping of digital twins through the co-simulation of Functional Mock-up Units (FMUs). It offers advanced master coordination features, such as solving algebraic loops between FMUs and managing the interaction between various simulation components. This library provides a seamless interface to orchestrate complex physics simulations and handle the data exchange between FMUs.
The documentation is available online: https://irt-saint-exupery.github.io/CoFmuPy
πΎ Installation¶
CoFmuPy is available on PyPI and can be installed using pip:
pip install cofmupy
π Key Keatures¶
CoFmuPy provides a Python interface (with a graphical user interface under development) for configuring and running co-simulations of FMI-based systems, with a focus on coordinating interacting FMUs within complex digital twin architectures.
A high-level API allows users to easily define, execute, and visualize digital twins scenarios, while still enabling more advanced control when needed.
Building on the FMPy library as an FMI-compliant execution backend, CoFmuPy focuses on system-level co-simulation capabilities and advanced coordination logic. In particular, CoFmuPy provides the following key features:
-
Advanced master coordination for coupled FMUs: Native master algorithms orchestrate the execution of multiple interacting FMUs, ensuring coherent time advancement and stable system-level simulation across heterogeneous subsystems. Cyclic dependencies between FMUs (algebraic loops) are automatically detected and resolved using fixed-point strategies, supporting both Jacobi and GaussβSeidel co-simulation schemes, with or without rollback. This enables the simulation of tightly coupled systems without manual intervention or model restructuring.
-
Explicit data exchange and synchronization mechanisms: CoFmuPy provides fine-grained control over data routing, synchronization, and signal propagation between FMUs, as well as between FMUs and external data sources or sinks.
-
Native integration of Python and AI components: Python-based models (e.g., machine learning or control logic) can be directly integrated into the co-simulation loop without immediate FMU export while still being FMI-compliant, enabling full integration of AI frameworks.
-
Declarative and reproducible configuration: Co-simulation systems are fully defined through a structured JSON configuration file, making experiments easy to reproduce, modify, and extend.
-
Graphical interface (coming soon): A user-friendly graphical interface will enable drag-and-drop system construction, FMU interconnection, remote interfaces configuration, algorithm selection, and co-simulation control.
π JSON configuration file¶
To properly define the co-simulation system, a JSON configuration file must be created. This file is the only information required by CoFmuPy to run the simulation. It must respect a specific syntax in order to define the FMUs, the interactions between them, the data sources and sinks, etc.
π Citation¶
If you use CoFmuPy in your research or publications, please cite:
@inproceedings{friedrich2025cofmupy,
title={CoFmuPy: A Python Framework for Rapid Prototyping of FMI-based Digital Twins},
author={Friedrich, Corentin and Lombana, Andr{\'e}s and Fasquel, J{\'e}r{\^o}me and Schlick, Charlie and Bennani, Nora and Mendil, Mouhcine},
booktitle={The 2nd International Conference on Engineering Digital Twins},
year={2025}
}
βοΈ Contributing¶
Feel free to propose your ideas or come and contribute with us on the CoFmuPy library!
π Acknowledgments¶
This project was funded by the European Union under GA no 101101961 - HECATE. Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union or Clean Aviation Joint Undertaking. Neither the European Union nor the granting authority can be held responsible for them. The project is supported by the Clean Aviation Joint Undertaking and its Members.
π License¶
The package is released under the 2-Clause BSD License.