Skip to content

modelica/fmi-beginners-tutorial-2023

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FMI-tutorial-logo

FMI Beginner's tutorial

This repository contains the agenda and materials for the FMI Beginner's tutorial presented at the 15th International Modelica Conference 2023. A recording is available on YouTube.

Part 1: Introduction to the FMI (40 min)

by Christian Bertsch

Presentation covering

  • the motivation and history of FMI
  • general technical concepts
  • tool support
  • an outlook on FMI 3.0

Part 2: Working with FMUs (45 min)

by Torsten Sommer

Prerequisites

Schedule

Live demo + Jupyter notebook

  • 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
  • Validation on 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

Break (30 min)

Part 3: Connecting Multiple FMUs (45 min)

by Maurizio Palmieri and Cláudio Gomes

Prerequisites

  1. Optional requisites for following along in the live demo:
    1. Java (recommended version 11)
    2. Install the into-cps application. A full guide can be found in this video: https://youtu.be/HkWh-PubYQo
    3. Have a Google account that you can use for Google Colab.

Schedule

  1. Live demo using the into-cps application (use the slides to follow along):

    1. 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.
    2. 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
    3. Configure a co-simulation
      1. Create cosim configuration.
      2. Explain the different options.
      3. Run it.
      4. Open the results folder
    4. Exploring alternative co-simulation configurations.
      1. Create new cosim config, with an increasing step size, and show instability creeping in.
    5. Summary
  2. Using Google Colab, run the Jupyter notebook found in part3/tutorial_multiple_FMUs

    1. 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
    2. Measure Accuracy of the Co-simulation Wrt to Baseline
      1. Co-simulation Scenario with Baseline
      2. Impact of Step Size on the Accuracy

Part 4: Closing Session (10 min)

by Cinzia Bernardeschi and Cláudio Gomes

Slides can be downloaded here.

Schedule

  1. Overview of some FMI Applications
  2. Role of FMI in Digital twins.

Q&A (10 min)

Photos of the Event

Photo Photo Photo Photo Photo Photo Photo Photo Photo Photo

Copyright and License

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.

About

FMI tutorial at the 15th International Modelica Conference 2023

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •