This repository contains the agenda and materials for the FMI Beginner's tutorial presented at the Asian Modelica & FMI Conference 2026.
A Video Recording from a similar tutorial at the Modelica and FMI Conference 2025 is available on YouTube
- Install the content of this Github Repository https://github.com/modelica/fmi-beginners-tutorial-2026
- create a directory c:\hub and change to there
git clone https://github.com/modelica/fmi-beginners-tutorial-2026.git- Install fmusim as described here: https://modelica.github.io/fmusim/
- Install Python
- Install fmpy 'python -m pip install fmpy[complete]' and Jupyter 'python -m pip install jupyter'
- Download the latest version of the Reference FMUs: https://github.com/modelica/Reference-FMUs/releases/latest/download/Reference-FMUs.zip
- Optional: Install OpenModelica from (https://openmodelica.org/free-and-open-source-software/download/) or use the Modelica tool of you choice
Presentation covering
- a general introduction to FMI
- explanation of the example model for part 2 + 3
- Do the fmusim tutorial: https://modelica.github.io/fmusim/tutorial/
- Simulate the FMU ControlledElectricDrive_FMU_3.fmu in the part2 folder with fmusim
- Start the fmpy GUI with
python -m fmpy.gui - Inspect the FMU
- Simulate the fmu
- Build a platform binary (assumption: cmake and compiler installed)
- Generate a Jupyter notebook from for the FMU and run it
Live demo + Hands On
- Open your Modelica Tool (e.g. OpenModelica)
- Load the Library "C:\hub\fmi-beginners-tutorial-2026\FMI\package.mo" (a preview of the next release of https://github.com/modelica/Modelica-FMI)
- We will import our FMUs to a package Import_FMUs_Library (It was created as a Modelica package stored in multiple files.
cd C:\hub\fmi-beginners-tutorial-2026\part3C:\hub\fmi-beginners-tutorial-2026\FMI\Resources\Library\win64\modelica-fmi .\fmus\Drive_FMU_3.fmu .\Imported_FMUs_Library\Drive_FMU_3.mo --overwriteC:\hub\fmi-beginners-tutorial-2026\FMI\Resources\Library\win64\modelica-fmi .\fmus\Controller_FMU_3.fmu .\Imported_FMUs_Library\Controller_FMU_3.mo --overwriteC:\hub\fmi-beginners-tutorial-2026\FMI\Resources\Library\win64\modelica-fmi .\fmus\Stimuli_FMU_3.fmu .\Imported_FMUs_Library\Stimuli_FMU_3.mo --overwrite
- (Re-)load the Imported_FMUs_Library in your Modelica tool from the hub\fmi-beginners-tutorial-2026\part directory
- Create a new Modelica model
Connected_FMUsin your Modelica tool in the packageImported_FMUs_Library - Insert the three FMus from the Imported_FMUs_Library to the Connected_FMUs model
- Connect the inputs and outputs (fitting by name)
- Simulate for 1s and plot the variable w of the Drive FMU
- vary the communicationStepsize of the FMus to 0.1s, 0.01s, 0.001s to see the effect of the communication stepsize
- Optional: Re-load the package in a different Modelica tool.
- optional: Create a container FMU out of the the FMUs and run it in fmpy.
Slides can be downloaded here.
FMI 3.0 examples:
- Change to the
C:\hub\fmi-beginners-tutorial-2026\part4\fmi3-featuresdirerctory - in a Python enviroment run
jupyter notebook
Code and documentation copyright (C) 2026 the Modelica Association Project FMI. fmusim and fmpy and cde released under the 2-Clause BSD License. Docs released under Attribution-ShareAlike 4.0 International.
This tutorial is based on previous versions of the tutorial given by Claudio Gomes, Maurizio Palmieri and Christian Bertsch. We are thankful to Torsten Sommer for his contributions to this tutorial materials, and to Kenneth Lausdahl as well as the other developers of the INTO-CPS tool and Maestro. In addition, part of this work has been supported by the DIGIT-Bench project (case no. 640222-497272), funded by the Energy Technology Development and Demonstration Programme (EUDP).
