This repository contains the agenda and materials for the FMI Beginner's tutorial presented at the SIMULTECH 2024 conference.
Presentation covering
- 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)
- Simulink with Coder and FMI Kit (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 fmusim
- download the Reference FMUs
- 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 1. Pre-requisites: show that java is installed. 2. Download intocps application 3. Download coe from download manager. 4. Launch COE from UI to show that it works.
- Configure a multimodel 1. Create new project (created project can be found in part3/example_intocps_app) 2. Locate FMUs to be used. 3. Move them to new project folder. 4. Create multi model
- Configure a co-simulation 1. Create cosim configuration. 2. Explain the different options. 3. Run it. 4. Open the results folder
- Exploring alternative co-simulation configurations. 1. 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 1. Run a co-simulation with a single FMU 2. Run a co-simulation with multiple FMUs
- Measure Accuracy of the Co-simulation Wrt to Baseline 1. Co-simulation Scenario with Baseline 2. 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.