Functional Mock-up Interface (FMI)
The Functional Mock-up Interface (FMI) standard is an open and tool-independent standard for exchange of models between tools. FMI defines a C interface that is implemented by an executable called a Functional Mock-up Unit (FMU). A simulation environment, such as System Modeler, can use the FMI to create an instance of the FMU and simulate it together with other FMUs or models native to the simulation environment.
The development of FMI was driven by an aspiration to create a standard in which a modeling environment could generate C code of a system model, which could then be utilized by other modeling and simulation environments, thereby making it easier to collaborate in modeling projects where different tools and workflows are used.
System Modeler currently supports FMI 1.0 and 2.0 for Model Exchange (import and export) and FMI 2.0 for Co-Simulation (import and export).
For a more detailed description of the FMU export and import workflow in System Modeler, see the page on FMU Export and Import. The properties of the imported model are covered in Using an Imported FMU.
FMI IN SYSTEMMODELER |
FMU Export and Import Using an Imported FMU FMI Variable Naming |
The Functional Mock-up Unit
An FMU, or a Functional Mock-up Unit, is the executable that implements the interface. During FMU export an FMU archive is generated from a systems model, while during FMU import a systems model is generated from an FMU archive.
An FMU contains the following:
- A model description XML file: The model description file contains information about the model, for example, variable definitions—type, unit, description, etc.—and other more general model information, such as model name, generation tool and FMI version.
- Model equations: A model can be described using ordinary differential equations, algebraic relations and discrete equations—including time, state and step events. These equations can in turn be represented by a small set of C functions. The C code is then distributed in the FMU in source and/or binary form, and one FMU can contain binaries for more than one platform and/or platform version.
- Optional resource files: There are other optional files that might be included in the FMU, such as documentation files (HTML), model icon (bitmap file), maps and tables and other libraries or DLLs that are used in the model.
Model Exchange and Co-Simulation
The FMI standards currently specify two types of protocols: FMI for Model Exchange (import and export), and FMI for Co-Simulation (master and slave). The main difference between these two protocols is that in Model Exchange the FMU is simulated using the importing tool's solver, while in Co-Simulation the FMU is shipped with its own solver.
FMI for Model Exchange allows FMUs to be used in offline or online simulation, where several FMUs can be connected together, or in embedded control systems on microprocessors. In both Model Exchange and Co-Simulation, the FMUs can potentially be very large, containing tens of thousands of variables.
For more general information about FMUs and the FMI standard, see www.fmi-standard.org.