nodepoly®Open Twinsys ↗
/
All articles
TWINSYS · SIMULATION FUNDAMENTALS

What is FMU? The Universal Language of Simulation

8 min read

This article is available in English only.

The Problem: Every Simulation Tool Is an Island

Imagine a hydraulic pump model that took six months to build in one simulation tool. A colleague modeled the electric motor in another. A third team keeps the thermal management model in yet another package. Then the project manager asks: "Can we simulate the complete system together?"

This is where most teams hit a wall. Each tool has its own model format, solver and interface. Getting them to talk to each other usually means exporting data, writing glue code, reconciling incompatible time steps — and losing weeks of integration work.

The Functional Mock-up Interface (FMI) is the standard written to remove that wall. The Functional Mock-up Unit (FMU) is what it standardizes: a simulation model packaged so that any tool that speaks FMI can run it.


FMI in One Paragraph

FMI is a free, tool-independent standard for exchanging dynamic simulation models. It defines two things: a container (the .fmu file) and a C programming interface that every FMU implements. A tool that exports FMUs writes the container; a tool that imports them loads the model and drives it through the interface. FMI started in the European MODELISAR project (2008–2011) and has been maintained since 2012 as a project of the Modelica Association. The standard's website lists more than 280 tools that support it.


What's Inside an FMU

An FMU is a ZIP archive with a .fmu extension. Rename it to .zip and you can look inside:

myPump.fmu
├── modelDescription.xml     ← the contract: variables, units, capabilities
├── binaries/
│   ├── x86_64-windows/
│   │   └── myPump.dll       ← compiled model code (Windows)
│   └── x86_64-linux/
│       └── myPump.so        ← compiled model code (Linux)
├── sources/                 ← optional: C source code
├── resources/               ← optional: data tables, parameter files
└── documentation/           ← optional: HTML documentation

The folder names follow FMI 3.0, which names platforms like x86_64-windows; FMI 2.0 FMUs use names such as win64 and linux64. FMI 3.0 also adds optional terminalsAndIcons/ and extra/ folders.

Three parts matter most:


Reading a modelDescription.xml

Here is a shortened FMI 3.0 description of a simple pump model:

<fmiModelDescription fmiVersion="3.0" modelName="Pump"
    instantiationToken="{8c4e810f-3df3-4a00-8276-176fa3c9f000}">
  <CoSimulation modelIdentifier="myPump"/>
  <UnitDefinitions>
    <Unit name="rad/s"><BaseUnit s="-1" rad="1"/></Unit>
    <Unit name="Pa"><BaseUnit kg="1" m="-1" s="-2"/></Unit>
    <Unit name="m3"><BaseUnit m="3"/></Unit>
  </UnitDefinitions>
  <ModelVariables>
    <Float64 name="speed" valueReference="1" causality="input" unit="rad/s" start="0"/>
    <Float64 name="pressure" valueReference="2" causality="output" unit="Pa"/>
    <Float64 name="displacement" valueReference="3" causality="parameter"
        variability="fixed" unit="m3" start="1e-5"/>
  </ModelVariables>
  <ModelStructure>
    <Output valueReference="2"/>
    <InitialUnknown valueReference="2"/>
  </ModelStructure>
</fmiModelDescription>

A few things to notice:


Three Ways to Run an FMU

FMI defines three interface types. One FMU can support more than one; its modelDescription.xml says which — the <CoSimulation> element in the example above.

Model Exchange (ME)Co-Simulation (CS)Scheduled Execution (SE)
The FMU providesThe model equationsThe equations and its own solverSeparately callable model partitions
Time integration byThe importer's solverThe FMU, between communication pointsThe importer's scheduler, which runs each partition
CouplingTight: one solver for the whole systemLoose: values exchanged at communication pointsClock-driven
Typical useTightly coupled physics in one environmentCoupling tools and subsystemsReal-time setups such as virtual control units
Available sinceFMI 1.0FMI 1.0FMI 3.0

Model Exchange hands the importer the model's equations — state derivatives and event indicators — and lets the importer's solver integrate them. The whole system shares one solver and one step-size control, which is the most accurate way to couple stiff or tightly interacting physics. The price: the importer must bring a capable solver and handle events itself.

Co-Simulation is the natural choice when models come from different tools. Each FMU carries its own solver, tuned by the model's author. The importer — often called the master or orchestrator — advances every FMU by one communication step, passes outputs on to inputs, and repeats. Between communication points an FMU typically holds its inputs constant.

Scheduled Execution, added in FMI 3.0, targets real-time setups: the FMU exposes separate model partitions — for example the tasks of a control unit running at different rates — and the importer's scheduler decides when each one runs.


What an Importer Actually Does

Driving a co-simulation FMU follows the same pattern in every tool. Simplified, with FMI 3.0 function names:

instance = fmi3InstantiateCoSimulation(...)

fmi3EnterInitializationMode(instance, ...)    ← start time, tolerance
    fmi3SetFloat64(instance, ...)             ← parameters and start values
fmi3ExitInitializationMode(instance)

t = startTime
while t < stopTime:
    fmi3SetFloat64(instance, inputs)          ← values from other components
    fmi3DoStep(instance, t, h, ...)           ← the FMU advances with its own solver
    fmi3GetFloat64(instance, outputs)         ← values for other components
    t = t + h

fmi3Terminate(instance)
fmi3FreeInstance(instance)

Two consequences follow from this loop:


Why Engineering Teams Use FMUs

Connecting many FMUs into one system has its own companion standard, SSP (System Structure and Parameterization), also maintained by the Modelica Association.


What an FMU Is Not


FMI Versions at a Glance

VersionReleasedWhat it brought
FMI 1.02010Model Exchange (January) and Co-Simulation (October), published as two separate specifications
FMI 2.02014One specification for both interface types; maintenance releases 2.0.1 to 2.0.5 followed
FMI 3.02022Scheduled Execution, array variables, clocks, more integer types, a 32-bit float and a binary type, structural parameters, terminals and icons, event handling and early return in co-simulation; maintenance releases 3.0.1 and 3.0.2 followed

Conclusion

FMI is one of the most successful standards in engineering simulation because it standardizes the right thing: not how a model is built, but how it is packaged and driven. A .fmu file carries a contract (modelDescription.xml), executable model code, and optionally sources and data. Whether it runs under your solver (Model Exchange), under its own (Co-Simulation) or under your scheduler (Scheduled Execution) is written in that contract.

This post covers the standard itself. We will go deeper into working with FMUs in a follow-up.