Hopsan
Functional Mock-up Interface

The Functional Mock-up Interface is an free standard for exchanging simulation models between simulation tools. It is maintained by the Modelica Association and is currently supported by more than 220 simulation tools. The concept is to exchange Functional Mock-up Units (FMUs) between different programs. An FMU is a zip-file with the file ending ".fmu", containing an XML description file and a binary file (DLL in Windows or SO in Linux) with a plain C interface which the host program can link against. It can also contain graphics, documentation and source code files.

Exporting a Functional Mock-up Unit

Hopsan models can be exported to FMUs by clicking on the Export to FMU button. Then choose an empty folder. All required files will be exported, compiled and compressed. Model inputs and outputs can be specified by using interface components.

Export to FMU

Compatibility

Note:** Hopsan uses the fmi4c library for FMI import. Compatibility for importing FMUs is thus also applicable on the fmi4c library itself.

Example FMUs exported from Hopsan are available at https://github.com/Hopsan/example-fmus/. All example FMUs have been verified with the FMU Check tool available at https://fmu-check.herokuapp.com/.

FMUs exported from Hopsan have been successfully imported and simulated in the following importing tools:

Compatibility with importing tools
tool FMI 1.0 FMI 2.0 FMI 3.0
Hopsan/fmi4c
OMSimulator
Adams
AMESim
Simulink
PyFMI

Prerequisites

  • MinGW compiler (available in system path)

Importing a Functional Mock-up Unit

FMUs from other programs (or from Hopsan itself) can be imported by clicking on the import from FMU icon. If all goes well they will appear as components in the component library.

Impohrt from FMU

Compatibility

Hopsan FMU import is validated against the Reference FMUs, available att https://github.com/modelica/Reference-FMUs. Below is the current compatibility:

Compatibility with reference FMUs
file FMI 1.0 FMI 2.0 FMI 3.0
BouncingBall.fmu
Clocks.fmu N/A N/A
Dahlquist.fmu
Feedthrough.fmu
Resource.fmu
Stair.fmu
StateSpace.fmu N/A N/A
VanDerPol.fmu

FMUs from the following tools have successfully been imported and simulated in Hopsan:

Compatibility with FMUs exported from other tools
tool FMI 1.0 FMI 2.0 FMI 3.0
Hopsan/fmi4c
OpenModelica
Dymola
Simulink
LS-DYNA

Prerequisites

  • MinGW compiler (available in system path)