Skip to content

modelica/fmusim

Repository files navigation

fmusim

fmusim is a command line tool to work with Functions Mock-up Units, written in Rust.

Highlights

  • Supports FMI version 2.0 and 3.0.
  • Supports Co-Simulation and Model Exchange.
  • Builds platform binaries from source code FMUs using CMake.
  • Logs FMI API calls.
  • Reads and writes CSVs.
  • Creates plots from simulation results.

Installation

Install fmusim with our standalone installers

# on macOS and Linux
curl -LsSf https://raw.githubusercontent.com/modelica/fmusim/refs/heads/main/install.sh | sh
# on Windows
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/modelica/fmusim/refs/heads/main/install.ps1 | iex"

To try out fmusim you can download the latest release of the Reference FMUs.

Documentation

fmusim's documentation is available at modelica.github.io/fmusim.

Additionally, the command line reference documentation can be viewed with fmusim help.

Getting help

Help menus

The --help flag can be used to view the help menu for a command, e.g., for fmusim:

$ fmusim help

To view the help menu for a specific sub command, e.g., for fmusim simulate:

$ fmusim help simulate

Viewing the version

When seeking help, it's important to determine the version of fmusim that you're using — sometimes the problem is already solved in a newer version.

To check the installed version:

$ fmusim --version

Display information about an FMU

$ fmusim info BouncingBall.fmu
Model Information

FMI Version:       3.0
Model Name:        BouncingBall
Platforms:         c-code, aarch64-darwin, aarch64-linux, x86-windows, x86_64-darwin, x86_64-linux, x86_64-windows
Continuous States: 2
Event Indicators:  1
Model Variables:   8
Generation Date:   2026-07-09T12:21:24.670948+00:00
Generation Tool:   Reference FMUs (7b3fc08)
Description:       This model calculates the trajectory, over time, of a ball dropped from a height of 1 m

Model Variables

Name   | Description
-------|---------------------------------------------
time   | Simulation time
h      | Position of the ball
der(h) | Derivative of h
v      | Velocity of the ball
der(v) | Derivative of v
g      | Gravity acting on the ball
e      | Coefficient of restitution
v_min  | Velocity below which the ball stops bouncing

List the contents of an FMU

$ fmusim list BouncingBall.fmu
binaries/
binaries/x86_64-linux/
binaries/x86_64-linux/BouncingBall.so
binaries/x86_64-windows/
binaries/x86_64-windows/BouncingBall.dll
documentation/
documentation/index.html
documentation/result.svg
modelDescription.xml
...

Validate an FMU

$ fmusim validate BouncingBall.fmu
    Validating ZIP archive
    Validating model description

Simulate an FMU

Simulate an FMU with the default settings and plot the outputs

$ fmusim simulate BoucingBall.fmu --show-plot

BoucingBall

See simulate to learn more.

Build the platform binary for an FMU

Build the platform binary for a source code FMU. This requires CMake and a supported compiler to be installed.

$ fmusim build BouncingBall.fmu  
Creating CMake project
Configuring CMake project
...
Building CMake project
...
Finished

License

fmusim is released under the BSD-2-Clause license.

About

Work with Functional Mock-up Units

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors