This repository contains the agenda and materials for the FMI Beginner's tutorial presented at the SIMULTECH 2024 conference.
Time | Topic |
---|---|
09:15 | Introduction to the FMI (Christian Bertsch) |
09:45 | Working with FMUs (Claudio Gomes) |
10:30 | Q&A |
10:40 | Break |
11:10 | Connecting Multiple FMUs (Maurizio Palmieri) |
11:55 | Closing Session (Maurizio and Claudio) |
12:00 | Q&A |
Presentation covering
- Simulink with Coder (optional) and FMI Kit (optional)
- the motivation and history of FMI
- general technical concepts
- tool support
- an outlook on FMI 3.0
- FMU export (from Dymola)
- open
MODELICA_Demo.Drive
in Dymola and export it as a source code FMU - FMU export (from Simulink with FMIKit)
- download and install FMI Kit for Simulink
- open
Controller.slx
with grtfmi.tlc as a source code FMU
- Python with fmpy[complete]
- Dymola (optional)
Live demo + Jupyter notebook
- Validation of FMUs on the Website
- work with FMUs in FMPy
- set up FMPy (with mambaforge)
- open GUI, create file association, create desktop shortcut
- view the model info
- view the documentation
- simulate the Drive FMU and plot the result
- create an input CSV file
- set the stop time, parameters, output interval (loadInertia1.J = 10)
- validate the Drive FMU
- compile platform binary for the Drive FMU
- log debug info and FMI calls + short discussion of FMI calling sequence
- generate a Python notebook from the FMU and run it
- simulate an FMU with created jupyter notebook
- download the Drive FMU
- simulate the Drive model with fmusim using the input file and set a parameter
- plot the result CSV with Excel
- Optional requisites for following along in the live demo:
- Java (recommended version 11)
- Install the into-cps application. A full guide can be found in this video: https://youtu.be/HkWh-PubYQo
- Have a Google account that you can use for Google Colab.
- Live demo using the into-cps application (use the slides to follow along):
- Setup
- Pre-requisites: show that java is installed.
- Download intocps application
- Download coe from download manager.
- Launch COE from UI to show that it works.
- Configure a multimodel
- Create new project (created project can be found in part3/example_intocps_app)
- Locate FMUs to be used.
- Move them to new project folder.
- Create multi model
- Configure a co-simulation
- Create cosim configuration.
- Explain the different options.
- Run it.
- Open the results folder
- Exploring alternative co-simulation configurations.
- Create new cosim config, with an increasing step size, and show instability creeping in.
- Summary
- Using Google Colab, run the Jupyter notebook found in part3/tutorial_multiple_FMUs
- Run a co-simulation from the command line
- Run a co-simulation with a single FMU
- Run a co-simulation with multiple FMUs
- Measure Accuracy of the Co-simulation Wrt to Baseline
- Co-simulation Scenario with Baseline
- Impact of Step Size on the Accuracy
by Maurizio Palmieri and Cláudio Gomes
Slides can be downloaded here.
- Overview of some FMI Applications
- Role of FMI in Digital twins.
Code and documentation copyright (C) 2023 the Modelica Association Project FMI. Code released under the 2-Clause BSD License. Docs released under Attribution-ShareAlike 4.0 International.