Skip to content

modelica/Modelica-FMI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modelica FMI

A Modelica library to import Functional Mock-up Units.

Highlights

  • ✅ supports FMI 2.0 and FMI 3.0 for Co-Simulation
  • 🎉 works with all Modelica tools
  • 📃 logs FMI calls to the console or to a file

Installation

To import FMUs install the modelica-fmi and modelica-fmi-gui commands with uv:

uv tool install --reinstall https://github.com/modelica/Modelica-FMI/releases/download/v0.0.8/modelica_fmi-0.0.8-py3-none-any.whl

Or, with pip:

pip install https://github.com/modelica/Modelica-FMI/releases/download/v0.0.8/modelica_fmi-0.0.8-py3-none-any.whl

To simulate imported FMUs download the Modelica-FMI package and load it in your Modelica tool.

Usage

To open the import dialog run

modelica-fmi-gui

or

modelica-fmi /path/to/model.fmu /path/to/package/model.mo

to import an FMU directly.

In Dymola you can open the import dialog by selecting Tools > FMU Import > Import FMU....

After the import you have to reload the package.

Building the binaries from source

To build the binaries in FMI/Resources/Library from source install CMake

uv tool install cmake

clone the repository, and run

cmake -S runtime -B runtime/build
cmake --build runtime/build --config release --target install

Building distributable import commands

To build distributable version of the modelica-fmi and modelica-fmi-gui commands

  • create a new virtual environment
uv venv
  • install PyInstaller and modelica_fmi
uv pip install pyinstaller https://github.com/modelica/Modelica-FMI/releases/download/v0.0.8/modelica_fmi-0.0.8-py3-none-any.whl
  • build modelica-fmi-gui
uv run pyinstaller --windowed --name modelica-fmi-gui --collect-data modelica_fmi .venv/Lib/site-packages/modelica_fmi/gui/__main__.py
  • ...or modelica-fmi
uv run pyinstaller --name modelica-fmi --collect-data modelica_fmi .venv/Lib/site-packages/modelica_fmi/__main__.py

License

Copyright © 2025 Modelica Association. The code is released under the 2-Clause BSD license.

About

Import Functional Mock-up Units to Modelica

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •