The purpose of this software is to provide a simplified, yet powerful, interface to run simulations in Jupyter notebooks in a Python environment using pre-compiled FMUs from Modelica distributions.
The simplified interface is especially useful when simulations are used in teaching where the focus is on dynamics of the process, rather than on Python scripting. The examples below illustrate the virtue of the simplified user interface.
Figure 1. Two lines of code using FMU_explore to make the following diagrams
Figure 2. The corresponding plain Python-script to make the same diagrams
Here is a need in a Jupyter notebook context for:
- Simplified code
- Improved readability
- Facilitate change of simulator-engine without changing the notebook
- Same notebook for both Windows and Linux environment
The package FMU_explore try to meet these needs, by introducing a handfull of functions adapted to the context of the application. The user provides short names of important parameters and variables as well as definitions of standard plots. The main ideas behind the package were presented in OpenModelica workshops a few years ago, see references below.
The package contains one module for each simulator-engine, and so far:
- fmu_explore_pyfmi - using PyFMI - https://github.com/modelon-community/PyFMI
- fmu_explore_fmpy - using FMPy - https://github.com/CATIA-Systems/FMPy
License information: The package FMU_explore is shared under the GPL 3.0 license.
References:
Axelsson, J. P., "Design apsects of FMU_explore a Python module to complement PyFMI", OpenModelica workshop in Linköping, January 31, 2022, abstract slides.
Axelsson, J. P., "Experience with Google Colab for running Modelica FMU in notebooks and no installation", OpenModelica workshop in Linköping, February 3, 2025, abstract slides.