Functional Mock-up Interface
The Functional Mock-up Interface (FMI) is a free and open standard that defines a tool-independent container format and application programming interface (API) for exchanging dynamic simulation models, primarily using XML descriptions, C source code, and compiled binaries packaged in a ZIP file known as a Functional Mock-up Unit (FMU).[1] It supports two main functionalities: model exchange, where an FMU encapsulates a complete model including its differential equations for simulation in another tool, and co-simulation, which allows distributed execution of coupled subsystems across different environments while handling communication between them.[2] Developed to address interoperability challenges in simulating complex cyber-physical systems, FMI facilitates seamless integration of models from diverse tools without reliance on vendor-specific formats, making it essential for industries like automotive, aerospace, and energy.[3]
FMI originated from the European ITEA2 MODELISAR project, which ran from July 2008 to December 2011 and involved 29 partners including Daimler AG, Bosch, and Dassault Systèmes, with the goal of improving methods for designing vehicle systems and embedded software.[3] The project's efforts culminated in the release of FMI version 1.0 in 2010, coordinated initially by Daimler and focused on establishing a unified interface for model sharing and simulation.[4] Following MODELISAR, development transitioned to the Modelica Association Project (MAP) FMI in 2011, an open collaboration managed by the Modelica Association with steering from industry leaders like Siemens, AVL List, and Bosch.[3] This ongoing project uses a transparent process involving GitHub for specifications, biweekly design meetings, and annual workshops to evolve the standard.[3]
The standard has progressed through key versions to enhance robustness and applicability. Version 2.0, released in 2014, introduced improvements such as support for intermediate variable updates during co-simulation and better handling of model variability.[4] Version 3.0, launched in 2022 with minor updates culminating in 3.0.2 on November 27, 2024, added advanced features including clock-based event handling for precise timing, terminals for grouping variables with graphical icons, support for binary data types and runtime-variable arrays, and a "scheduled execution" mode for integrating with external schedulers in real-time systems.[2] These enhancements address limitations in prior versions, such as asynchronous communication workarounds, and expand use cases to include digital twins, virtual electronic control units (vECUs), and hybrid simulation setups.[2]
FMI's adoption has been widespread, with over 260 compatible tools listed by the Modelica Association as of 2025, including Simulink from MathWorks, Dymola from Dassault Systèmes, and Amesim from Siemens, spanning commercial, open-source, and academic environments.[5] Its impact is particularly notable in system-level simulations for multi-domain engineering, where it reduces development time by enabling model reuse across organizational boundaries, as evidenced by its integration in projects at Bosch for beyond-tool-border simulations and in standards like ASAM XIL-MA for measurement and calibration.[6] Complementary layered standards, such as the System Structure and Parameterization (SSP) from MAP, further extend FMI for composing complex model hierarchies.[3]
Introduction
Definition and Purpose
The Functional Mock-up Interface (FMI) is a free and open standard that defines a container format and an interface for exchanging dynamic simulation models between different tools, utilizing a combination of XML files for model description, binary libraries, and C functions for runtime execution, all packaged in a ZIP file known as a Functional Mock-up Unit (FMU).[7] This standard enables the tool-independent transfer and integration of models, allowing simulations to be conducted across diverse software environments without proprietary dependencies.[3]
The primary purposes of FMI are to facilitate model exchange, where a black-box model is exported from one tool and imported into another for simulation using the importing tool's solver, and co-simulation, where multiple models from different tools are coupled and executed in parallel, exchanging data at discrete communication points to simulate complex systems.[7] These capabilities address the challenges of integrating subsystems in multi-domain applications, such as cyber-physical systems.[3]
Key benefits of FMI include enhanced interoperability across simulation tools from over 230 vendors, reducing vendor lock-in by promoting processor- and platform-independent model reuse, and supporting multi-physics simulations that span domains like mechanical, electrical, and thermal systems.[7][3] The FMU serves as the core component, encapsulating the model's XML-based description (including variables, dependencies, and structure), the interface via standardized C functions (e.g., for setting and getting variable values), and the compiled binaries required for execution, ensuring seamless portability and encapsulation of dynamic behavior.[7] Later versions, such as 3.0, build on this foundation with enhancements for broader applicability.[7]
History and Development
The development of the Functional Mock-up Interface (FMI) began in 2008 within the MODELISAR project, a European Union-funded initiative under the ITEA2 program designed to advance the design of vehicle systems and embedded software through standardized simulation practices.[3] This project, which ran from July 2008 to December 2011, involved 29 partners primarily from the automotive sector, including major companies such as Daimler, BMW, Bosch, and Dassault Systèmes, along with tool vendors like dSPACE and AVL List.[3][8] Funded by national research agencies including Germany's BMBF, France's DGCIS, and Sweden's VINNOVA, MODELISAR addressed the growing need for interoperable model exchange to enable collaborative development in complex cyber-physical systems, particularly in automotive applications.[3] The project's emphasis on replacing physical prototypes with digital functional mock-ups drove the creation of FMI as a tool-independent standard for sharing dynamic simulation models.[6]
The initial release, FMI 1.0, was published in 2010 and provided capabilities for both model exchange and co-simulation, allowing models to be imported into different simulation environments without proprietary tool dependencies.[9] Following the conclusion of MODELISAR, responsibility for FMI's evolution transferred to the Modelica Association, where it has been maintained as a dedicated project with contributions from a steering committee and working groups comprising tool vendors, OEMs, and research institutions.[3] This organizational structure has facilitated broad industry adoption, with over 230 tools now supporting the standard across automotive, aerospace, and energy sectors.[1] The key motivation remained the standardization of model reuse to streamline multi-domain simulations, reducing development costs and time in integrated system testing like model-in-the-loop (MiL) and hardware-in-the-loop (HiL).[6]
FMI 2.0, released on July 25, 2014, expanded the standard by enhancing co-simulation support, introducing intermediate variable handling for more efficient data exchange, and adding event handling mechanisms to better manage discrete events in simulations.[10] These improvements addressed limitations in earlier versions, enabling more robust integration of heterogeneous models from suppliers and OEMs in supply chain workflows.[10] In 2022, FMI 3.0 marked a significant advancement, incorporating features such as terminals for grouping variables with graphical icons, clock-based event handling for precise timing, support for binary data types and runtime-variable arrays, and a scheduled execution mode for integrating with external schedulers in real-time systems.[11] A minor maintenance update, FMI 3.0.2, was issued on November 27, 2024, providing clarifications and bug fixes without introducing new functionality.[12] These updates reflect ongoing collaboration involving more than 100 contributing organizations, extending FMI's applicability to emerging areas like virtual ECUs and digital twins in aerospace and beyond.
Core Concepts
The FMI Approach
The Functional Mock-up Interface (FMI) embodies a tool-agnostic philosophy, enabling the export of dynamic simulation models as self-contained Functional Mock-up Units (FMUs) that can be imported and executed in any compliant simulator without requiring access to the underlying source code or tool-specific details. This approach promotes interoperability across diverse modeling and simulation environments by standardizing the packaging and interaction of models, ensuring processor and operating system independence while supporting deployment on platforms ranging from personal computers to hardware-in-the-loop systems and embedded controllers.[13]
At its core, an FMU serves as a portable container structured as a ZIP archive, encapsulating essential components such as the modelDescription.xml file—which outlines variables, parameters, dependencies, and model capabilities—along with platform-specific binaries in compiled C code (e.g., dynamic link libraries) and optional elements like schematics, source code, or tabular data. This structure allows multiple instances of the same FMU to coexist and supports nesting of FMUs within others, facilitating modular model composition without exposing proprietary implementation details.[13]
The interface principles of FMI revolve around defining input and output variables through the XML description, complemented by a standardized set of functions for model setup, simulation advancement, and termination, thereby accommodating both continuous-time and discrete-event dynamics. These principles emphasize minimal runtime overhead through efficient data exchange mechanisms, such as caching and batch variable updates, while hiding internal data structures to maintain encapsulation. FMI supports varying levels of interoperability, ranging from basic parameter passing between static components to the full exchange of dynamic behaviors in coupled simulations, with distinctions between model exchange (transferring the model for integration into a single solver) and co-simulation (federating independently solved subsystems).[13]
Architecture
The Functional Mock-up Interface (FMI) employs a standardized file structure for Functional Mock-up Units (FMUs), which serve as portable containers for dynamic models. An FMU is packaged as a ZIP archive that includes a mandatory modelDescription.xml file at the root, along with platform-specific binary libraries (such as .dll for Windows, .so for Linux, or .dylib for macOS), optional C source code for custom compilation, and additional files like documentation or data tables. The modelDescription.xml file provides a comprehensive description of the model's interface, including exposed variables, their types, and interdependencies, ensuring interoperability across tools without requiring access to the model's internal implementation.[13]
Variables within the FMU are defined in the modelDescription.xml using an XML schema that specifies their data types—such as Float64 for real numbers, Int32 for integers, Boolean, String, Binary, and Clock—with support for scalar values or arrays stored in row-major order. Each variable includes attributes for causality, which indicates the direction of information flow (e.g., input for externally driven values, output for computed results, parameter for configurable constants, local for internal computations, or independent for elements like time), and variability, which describes temporal behavior (e.g., constant for unchanging values, fixed or tunable for parameters adjustable at setup, discrete for event-driven updates, continuous for smooth time dependence, or clocked for synchronized events). Enumerations are handled as strings with defined literals, while dependencies between variables are captured to inform efficient evaluation orders during simulation.[13]
The FMI architecture exposes the model through a C application programming interface (API), defined in header files like FMI3.h, which allows importers to interact with the FMU without recompiling the model. Core functions include fmi3Instantiate for creating an instance of the FMU, fmi3SetupExperiment for configuring experiment parameters such as start time, stop time, and tolerance, fmi3EnterInitializationMode and fmi3ExitInitializationMode for preparing and finalizing the model state, and fmi3DoStep for advancing time in co-simulation scenarios. Variable access is facilitated by type-specific getters and setters, such as fmi3GetFloat64/fmi3SetFloat64 for real variables, fmi3GetBoolean/fmi3SetBoolean for booleans, and similar pairs for integers, strings, binaries, and clocks; additional functions like fmi3GetFMUState and fmi3SetFMUState enable state serialization for rollback or reuse. Platform detection is handled via fmi3GetTypesPlatform, which returns a string identifier for the FMU's compilation environment. These functions support both model exchange and co-simulation modes, with optional extensions for scheduled execution via fmi3ActivateModelPartition.[13]
Key elements of the XML schema in modelDescription.xml further structure the model's metadata. The <UnitDefinitions> section defines physical units (e.g., meters per second as <Unit name="m/s">), which can be referenced by variables for dimensional consistency. <TypeDefinitions> allows custom type aliases, such as enumerations or structured floats with start/end values and quantities. The <DefaultExperiment> element specifies default simulation settings, including startTime, stopTime, and tolerance for numerical solvers. Variable dependencies are detailed in the <ModelStructure> element, using <Output> and <Derivative> tags to list known outputs and their influencing inputs, along with <Unknown> for undetermined relations, enabling dependency graph analysis for parallel evaluation.[13]
To ensure platform independence, FMUs include binaries compiled for major operating systems (Windows, Linux, macOS) and architectures (32-bit and 64-bit), identified by folder names like win64 or linuxx86_64 within the ZIP archive. If binaries are unavailable for a target platform, importers can compile the provided C source code using standard tools, minimizing reliance on proprietary libraries or OS-specific services. This approach promotes broad portability while documenting any runtime requirements, such as thread safety or floating-point precision.[13]
Error handling in the FMI API relies on status codes returned by all functions, providing a standardized way to diagnose issues without halting execution unnecessarily. The codes include fmi3OK for successful operations where outputs are fully defined, fmi3Warning for non-critical issues allowing continuation, fmi3Discard for failed calls where the FMU state remains unchanged and outputs are undefined (permitting simulation recovery), fmi3Error for recoverable errors requiring simulation termination unless a prior state is restored, and fmi3Fatal for irreparable failures corrupting all instances. These statuses, combined with optional string-based logging via fmi3GetString, facilitate robust integration and debugging.[13]
Operational Modes
Model Exchange
In the Model Exchange mode of the Functional Mock-up Interface (FMI), a dynamic simulation model is exported as a black-box Functional Mock-up Unit (FMU), allowing the importing environment to solve the model's equations using its own numerical solver. This mode targets systems described by ordinary differential equations (ODEs), differential algebraic equations (DAEs), discrete equations, or hybrid combinations thereof, encompassing continuous-time dynamics with algebraic constraints, discrete-time updates, and event handling such as time events, state events, and step events.[14] The FMU encapsulates the model's structure and behavior without an embedded solver, providing simulator independence for integrating models from diverse tools into a unified simulation environment.[15]
The simulation process begins with the importer instantiating the FMU via the fmi3InstantiateModelExchange function, followed by entering initialization mode with fmi3EnterInitializationMode to set parameters, initial states, and other setup values. Once initialized via fmi3ExitInitializationMode, the importer advances the simulation by entering continuous-time mode using fmi3EnterContinuousTimeMode, where it queries the FMU for continuous states with fmi3GetContinuousStates and their derivatives via fmi3GetContinuousStateDerivatives to integrate the system forward in time. For event handling, the importer calls fmi3EnterEventMode and uses functions like fmi3UpdateDiscreteStates to manage discrete updates and fmi3GetEventIndicator to detect state events, ensuring all state variables remain internal to the FMU without external inputs beyond initialization parameters during runtime.[14] The process concludes with termination using fmi3Terminate, allowing the importer full control over time stepping and event resolution.[16]
This mode supports continuous-time models formulated as DAEs in semi-explicit index-1 form, where the importer's solver resolves algebraic loops iteratively, as well as purely discrete models driven by clocked events and hybrid models blending both paradigms through event transitions.[17] Key advantages include complete flexibility in selecting the importer's solver algorithms—such as variable-step or fixed-step integrators—without requiring a dedicated master algorithm for orchestration, and efficient selective evaluation of model variables or partial derivatives via API calls like fmi3GetDirectionalDerivative to support advanced numerical methods.[14] These features enable minimal runtime overhead through output caching and vectorized data exchanges, promoting scalability for complex systems.[18]
However, Model Exchange demands that the model be fully specified at export, though FMI 3.0 supports runtime structural changes via structural parameters and allows setting input variables during simulation in appropriate modes, enabling interactive and adaptive scenarios.[19] It also imposes computational demands on algebraic loop resolution and does not natively support features like multi-body kinematics or trajectory optimization, requiring the importer to handle such extensions externally. Additionally, dependency information in the FMU may not fully capture array resizes or dynamic parameter impacts, potentially complicating efficient solving.[20]
Specific to this mode, the FMU's modelDescription.xml file includes a <ModelExchange> annotation to indicate compatibility, alongside <ModelVariables> for defining variable types, causalities (e.g., internal states), and clock dependencies for hybrid elements, but excludes input/output ports beyond those used in setup. The <ModelStructure> element encodes variable interdependencies via dependency graphs, aiding the importer in detecting algebraic loops and optimizing evaluation orders without revealing internal equations. Capability flags in the XML, such as support for continuous states or directional derivatives, further guide the importer's integration strategy.[21]
Co-Simulation
Co-simulation in the Functional Mock-up Interface (FMI) enables the integration of multiple Functional Mock-up Units (FMUs) as slave components, each advancing its internal state independently while communicating with a master algorithm responsible for overall time synchronization and coordination.[10] In this mode, FMUs encapsulate subsystem models with their own solvers, allowing distributed simulation of complex systems where the master orchestrates interactions at discrete communication points to ensure consistency across the coupled environment.[2]
The process begins with the master providing inputs to each slave FMU and specifying a communication time step, after which it invokes the fmi2DoStep (or fmi3DoStep in later versions) function to advance the slave's simulation. Slaves then compute their internal dynamics over the interval, return updated outputs to the master, and approximate input values for the subsequent interval, facilitating data exchange without exposing internal solver details. This master-slave interaction supports the coupling of heterogeneous models, such as mechanical and electrical subsystems, in a tool-independent manner.[10][2]
Key features of FMI co-simulation include support for both fixed and variable step sizes, allowing adaptation to model stiffness or computational demands. It accommodates weak coupling, where approximations occur at communication points for efficiency, and strong coupling, involving iterative exchanges for higher fidelity in tightly interconnected systems. Additionally, event detection across FMUs is handled through indicators that signal discrete changes, enabling synchronized responses to events like state transitions in hybrid models.[10]
Starting with FMI 2.0, enhancements improved accuracy by introducing intermediate variable updates, which permit mid-step data exchanges to refine approximations without full recomputation. Rollback mechanisms, using functions like fmi2SetFMUState, allow the master to revert and retry steps for better numerical precision, particularly in variable-step scenarios. These additions addressed limitations in earlier versions by enabling more flexible state management during coupled executions.[10]
FMI 3.0 further advanced co-simulation with early stopping capabilities via the earlyReturn flag in fmi3DoStep, enabling termination of a step if convergence fails, and improved scheduling through clock-based mechanisms for precise event timing in real-time applications. These features facilitate robust orchestration of large-scale, distributed simulations, such as in cyber-physical systems.[22]
Despite these advancements, co-simulation faces challenges in maintaining numerical stability, particularly with variable step sizes and extrapolation in weak coupling, which can amplify errors in stiff systems. Handling algebraic loops across FMUs requires iterative solvers at the master level, as direct dependencies may necessitate convergence checks to avoid instability or divergence in coupled algebraic constraints.[23][24]
Standards and Specifications
Versions and Evolution
The FMI 3.0 specification, released on May 10, 2022, introduced several key enhancements to support advanced simulation scenarios, including clock mechanisms for handling discrete events and synchronizing variable changes across functional mock-up units (FMUs).[13] These clocks enable predictable scheduling in synchronous clocked simulations and event-driven interactions in co-simulation modes.[25] Additionally, variable scoping was refined through attributes distinguishing local and global visibility in the model description XML, allowing better management of dependencies and access restrictions.[26] Intermediate sections in the XML schema facilitate partial updates by defining intermediate variables accessible between communication points in co-simulation, particularly for continuous-time variables.[27] Asynchronous co-simulation features, such as event mode and early return from step functions, were added to accommodate embedded systems requiring non-blocking execution and event handling.[28] New functions like fmi3GetNumberOfVariableDependencies and fmi3GetVariableDependencies were introduced to query runtime dependency counts and kinds (e.g., independent, constant, or tunable) for variables, which may vary with structural parameters or array sizes.[29]
Following the 3.0 release, FMI 3.0.1 was issued on July 10, 2023, as a maintenance update providing minor clarifications and bug fixes without introducing new features.[30] It specifically addressed ambiguities in variable dependencies.[31] FMUs compliant with FMI 3.0 remain fully compatible with 3.0.1. Subsequently, FMI 3.0.2, released on November 27, 2024, further refined these aspects through additional clarifications and fixes, enhancing XML schema validation for better compliance checking and improving platform support for greater independence across operating systems and processors via standardized C/C++ sources.[2] Like its predecessor, it maintains full backward compatibility with prior 3.0-series FMUs.
Backward compatibility is ensured through explicit version detection mechanisms in FMUs, such as the fmiVersion attribute in the model description XML, which allows importers to identify and handle the specification version dynamically.[32] Minor updates like 3.0.1 and 3.0.2 are designed to be fully interoperable with 3.0, while major version increments may introduce breaking changes. Migration guidance for exporters and importers is provided in the official implementers' guide, offering best practices for updating tools to leverage new dependency queries and event handling without disrupting existing workflows.[33]
Looking ahead, ongoing developments emphasize integration with cloud-based simulation environments to enable scalable, distributed model execution, as explored in recent literature on simulation-as-a-service architectures.[34] Efforts also include AI-enhanced techniques for model reduction to optimize large-scale FMU performance.[34]
By 2025, FMI adoption has surpassed 230 compliant tools and libraries, reflecting widespread industry integration for model exchange and co-simulation. Notable examples include MATLAB/Simulink for importing and exporting FMUs in control system design, Dymola for multi-domain physical modeling, and Simcenter Amesim for system-level simulations across versions 1.0 to 3.0.[35][36][5][37]
Licensing
The Functional Mock-up Interface (FMI) standard is provided under open licenses that promote broad accessibility and adoption. The specification document itself is licensed under the Creative Commons Attribution-ShareAlike 4.0 International (CC-BY-SA 4.0) license, which permits free use, sharing, adaptation, and distribution for any purpose, including commercial applications, as long as appropriate credit is given to the original authors and any derivative works are shared under the same license terms.[3][38] This licensing approach has been consistent since the early versions of the standard, originating from the MODELISAR project, and continues to apply to FMI 3.0 and later releases.[10]
Accompanying source materials, including the XML schema files and C header files essential for implementing the interface, are released under the 2-Clause BSD License. This permissive license allows implementers to freely use, modify, and distribute these files in both open-source and proprietary software without royalties or mandatory disclosure of source code modifications, provided the original copyright notice and disclaimer are retained.[3][38] The scope of these licenses covers the core standard artifacts—the specification text, schemas, and headers—but does not impose restrictions on the creation, export, or usage of Functional Mock-up Units (FMUs). Binaries embedded within FMUs, however, remain subject to the licensing terms of the specific tools or vendors that generate them.[13]
While the licensing framework has remained stable, FMI 3.0 explicitly reaffirms the CC-BY-SA 4.0 for the documentation and BSD for code components, ensuring compatibility with prior versions without substantive changes to the terms.[11][38] To contribute to the standard, participants must sign a Contributor License Agreement (CLA) with the Modelica Association, which sublicenses intellectual property to the organization for maintenance and distribution.[3]
For compliance, tools claiming to be "FMI-compliant" must fully adhere to the specification's requirements, but the Modelica Association does not endorse or certify specific implementations.[3] This open licensing model facilitates widespread adoption by enabling integration into commercial products without legal barriers, in contrast to proprietary simulation interfaces that often require paid licenses or restrict redistribution.[39]
System Structure and Parameterization (SSP)
The System Structure and Parameterization (SSP) standard serves as a companion to the Functional Mock-up Interface (FMI) by providing a tool-independent format for describing, packaging, and exchanging system structures along with their parameterization. Released in version 1.0 on March 5, 2019, SSP defines an XML-based schema to specify system topology, including connections between components such as FMUs, parameters, and initial values, enabling the composition of complex simulation models without reliance on proprietary tools.[40] Version 2.0, released on December 20, 2024, extends this foundation to support more advanced system designs while maintaining backward compatibility with earlier versions.[41]
At the core of SSP is the SystemStructure.xml file, which encapsulates key elements for model composition. The Component element represents instances of FMUs or other model entities, defining their properties and interfaces. Connector elements specify signal interfaces, such as inputs, outputs, or parameters, to link components logically. Element declarations allow for the representation of subsystems or atomic parts within the hierarchy, while Scenario elements outline complete simulation setups, including execution parameters and variability options. These structures are packaged in a ZIP archive, facilitating portable exchange of entire parameterized systems.[41][40]
SSP integrates seamlessly with FMI by referencing FMU files via URIs within its XML descriptions, allowing direct instantiation of FMU-based models in a tool-agnostic manner. This enables the creation of hierarchical models where subsystems can nest FMUs, and supports variability through multiple parameter sets for different simulation contexts. In SSP 2.0, enhancements include native support for FMI 3.0 clock mechanisms to handle event-driven simulations, parameterized connections that allow dynamic signal mappings based on variables, and XML schemas for validation to ensure compliance during import and export.[41] These features build on FMI's co-simulation capabilities for runtime execution without altering the underlying model exchange semantics.[41]
Common use cases for SSP involve automating workflows in large-scale simulations, such as assembling vehicle dynamics models from multiple FMUs for automotive testing, where entire systems can be exported from one tool and imported into another for parameterization and execution. This promotes interoperability in industries like aerospace and energy, reducing setup time for complex, multi-domain systems.[41] SSP was developed under the Modelica Association Project SSP, a collaborative effort involving over 30 member organizations, and continues to be maintained by this group to ensure open standardization.[42]
Applications and Integration
Implementation Examples
A common implementation example involves exporting a simple mass-spring-damper model from Modelica using Dymola to create an FMU compliant with FMI 2.0 for model exchange. In Dymola, the model is first built using the Modelica Standard Library components, such as a mass block connected to a spring-damper element, with inputs for external forces and outputs for position and velocity. To export, the user selects the Simulation tab, clicks the Translate menu arrow, and chooses FMU for Model Exchange, specifying FMI version 2.0 and the target platform; this generates a ZIP file containing the model description XML, binaries, and C source code for integration into an external solver.[43][44]
The resulting FMU's modelDescription.xml file defines the model's variables, including states like position and velocity. For a linear mass-spring-damper, the XML snippet under <ModelVariables> might appear as follows, where position and velocity are declared as continuous real variables with initial values and units:
xml
<ScalarVariable name="position" causality="local" variability="continuous">
<Real start="0.0" unit="m"/>
</ScalarVariable>
<ScalarVariable name="velocity" causality="local" variability="continuous">
<Real start="0.0" unit="m/s" derivative="0"/> <!-- References position index -->
</ScalarVariable>
<ScalarVariable name="position" causality="local" variability="continuous">
<Real start="0.0" unit="m"/>
</ScalarVariable>
<ScalarVariable name="velocity" causality="local" variability="continuous">
<Real start="0.0" unit="m/s" derivative="0"/> <!-- References position index -->
</ScalarVariable>
This structure allows an importer to provide derivatives and solve the ordinary differential equations externally.[10]
For co-simulation, an example integrates two FMUs representing coupled mechanical subsystems using the Python library PyFMI, which supports FMI 2.0. Consider exporting a direct inertia model (outputting angle, angular velocity, and acceleration) and an inverse inertia model (outputting torque) from Modelica, then loading them in Python via load_fmu('directInertia.fmu') and load_fmu('inverseInertia.fmu'). The models are connected by setting outputs as inputs (e.g., torque from inverse to direct), and a master simulation object is created with options like step size and linear correction for stability. The master loop advances time using fmi2DoStep calls at a fixed communication step of 0.01 seconds, iterating until the end time while exchanging data at each step to simulate the coupled rotation.[45]
In MATLAB/Simulink, importing an FMU follows a straightforward workflow to simulate coupled systems. The FMU block is added from the Simulink Library Browser under User-Defined Functions, and the .fmu file is specified in the block parameters dialog, automatically detecting the mode (e.g., model exchange) and FMI version. Parameters, such as spring stiffness or initial conditions, are set via the block's Parameter tab, overriding XML defaults (e.g., entering a real value for a stiffness parameter); inputs and outputs are connected to other Simulink blocks for coupling, like linking an electrical actuator to a mechanical plant FMU. The simulation is run using the Simulink toolbar, with results visualized in scopes showing coupled behavior, such as oscillating position from the mechanical response driving electrical current.[46]
For FMI 3.0, an example involves importing an FMU into Simulink to leverage new features like clock-based event handling. The workflow is similar to FMI 2.0: add the FMU block, specify the .fmu file supporting FMI 3.0, and connect inputs/outputs. Simulink detects the version and supports advanced types such as binary data or terminals for grouped variables. This enables simulations of hybrid systems, such as integrating a digital twin model with real-time clocks for precise event timing in control systems. As of December 2024, MathWorks documentation and tools fully support FMI 3.0 import and export.[47][2]
Debugging FMU implementations often begins with validation using the FMU Check web application, which unpacks the FMU, verifies XML compliance, checks binary executability, and tests basic functions like fmi2GetTypesPlatform against the declared platform. For platform mismatches, such as a Windows FMU on Linux, users must re-export the source code version from the originating tool (e.g., Dymola with C source enabled) and recompile binaries using compatible toolchains, ensuring the modelIdentifier and fmiTypesPlatform attributes match the target environment to avoid runtime errors during fmi2Instantiate.[48]
A real-world application demonstrates FMU integration in automotive brake system simulation, where models from multiple vendors form a vehicle environment for testing an electronic stability program (ESP) ECU. An engine FMU exported from Dymola (Dassault Systèmes, FMI 2.0) and a drivetrain FMU from SimulationX (ITI, FMI 2.0) replace native components in dSPACE's Automotive Simulation Models, coupled with the ESP ECU and vehicle dynamics. The setup simulates braking on a slippery road in VEOS software, comparing scenarios with ESP on (stable stop) versus off (skid), validating multi-vendor interoperability for hardware-in-the-loop testing.[49]
In the energy sector, FMUs are used for battery modeling, as in the BattGenie platform, where FMI-compliant models of lithium-ion cells are exported for integration across simulation tools. This supports consistent sharing of electrochemical models without exposing proprietary details, facilitating applications in electric vehicle design and grid storage simulations as of April 2025.[50]
Comparisons with Other Technologies
The Functional Mock-up Interface (FMI) differs from Simulink S-Functions in its standardization and interoperability. While S-Functions provide a proprietary mechanism for integrating custom code into MATLAB/Simulink environments, FMI offers a tool-independent standard that enables model exchange and co-simulation across diverse simulation tools without vendor lock-in.[51] FMI natively supports co-simulation through its interface for coupled solvers, whereas S-Functions often require custom wrappers or additional development to achieve similar multi-tool integration.[51]
In contrast to the High Level Architecture (HLA), which is designed for large-scale, distributed real-time simulations in defense and aerospace applications, FMI focuses on component-level model exchange and co-simulation for offline and embedded use cases.[52] HLA excels in federated, network-based environments with runtime management via a runtime infrastructure, but it introduces higher complexity and overhead for non-real-time scenarios; FMI, being lighter and simpler, is better suited for integrating subsystem models in a master-slave co-simulation setup without the need for distributed federation protocols.[52] These differences make FMI preferable for modular, tool-agnostic workflows, while HLA remains dominant for synchronized, real-time distributed systems.[52]
The August 2025 release of the FMI Layered Standard for Network Communication extends FMI's capabilities for distributed simulations over networks, bridging some gaps with HLA by enabling networked co-simulation in automotive and aerospace without full federation overhead. This layered approach builds on FMI 3.0, allowing FMUs to communicate via protocols like TCP/IP for real-time applications.[53]
Compared to OpenModelica's scripting capabilities, which allow interactive model manipulation and simulation control through Python or Julia interfaces, FMI facilitates secure model sharing via pre-compiled binaries or C code without exposing source code.[54] OpenModelica scripting enables dynamic parameterization and execution but typically requires sharing model source files for reproducibility across environments, potentially compromising intellectual property; FMI's encapsulated Functional Mock-up Units (FMUs) address this by bundling compiled executables with metadata, supporting seamless import/export between tools like OpenModelica and others.[54]
FMI's strengths lie in its broad industry adoption, as evidenced by integration in tools such as Simcenter Amesim for multidomain system simulation and MapleSim for symbolic modeling workflows.[36][55] However, a limitation is the potential overhead in file size for smaller models, where FMUs are typically larger than equivalent native binaries due to the inclusion of XML files describing model structure and variables.[10] This XML component, while essential for interoperability, can increase storage requirements by incorporating metadata not present in pure executable formats.[10]
Accompanying Standards and Recommendations
The co-simulation mode of the Functional Mock-up Interface (FMI-CS) supports real-time applications and embedded systems by defining interfaces for coupling simulation tools in distributed environments, enabling synchronized execution of models with fixed time steps suitable for hardware-in-the-loop testing.[56] These features emphasize deterministic communication and data exchange to meet timing constraints in embedded contexts, such as automotive control systems.[57]
The eFMI standard, an extension of FMI for embedded systems, facilitates the deployment of functional mock-up units (FMUs) in resource-constrained environments by specifying formats for model-to-code transformation and runtime integration, currently available as the 1.0.0 Beta 1 candidate-draft released in July 2024, with the first stable release in development.[58] This draft outlines workflows from physical modeling to embedded software, including C code generation for microcontrollers while preserving FMI semantics.[59]
Recommendations from the Modelica Association Project include best practices for FMU validation and testing, as detailed in the FMI 3.0 Implementers' Guide, which advises using reference FMUs for import validation and compliance checkers to verify interface adherence.[33] The FMILibrary, a C implementation supporting FMI versions 1.0 to 3.0, serves as a testing suite for simulating and validating FMUs across platforms, ensuring portability and correctness in co-simulation scenarios. The FMUComplianceChecker tool, which supports FMI 1.0 and 2.0 (now archived and no longer maintained), automates tests for model exchange and co-simulation FMUs, including fixed-step simulations and event handling verification. For FMI 3.0, validation should follow the Implementers' Guide recommendations.[60][33]
FMI integrates with SysML for model-based systems engineering by enabling the mapping of architectural models to executable simulations, where SysML diagrams define system interfaces that are synchronized with FMU inputs and outputs during co-simulation.[61] This synchronization supports hybrid synchronous-asynchronous workflows, allowing SysML to orchestrate FMI-based components for cyber-physical system design.[62]
Industry recommendations, such as VDI 2206 for the design of mechatronic systems, complement FMI by providing a procedural framework for integrating simulation models into multidisciplinary development processes, emphasizing iterative validation of coupled mechanical, electrical, and software elements.[63] For functional safety in automotive applications, FMI supports ISO 26262 compliance paths through verifiable model exchange and co-simulation, enabling hazard analysis and risk assessment via standardized FMUs in safety-critical verification workflows.[64]
Emerging integrations include FMI with the Robot Operating System (ROS) for robotics simulations, where FMUs are wrapped as ROS 2 nodes to enable co-simulation of physical models alongside robotic control algorithms in Gazebo environments.[65] This approach facilitates digital twins in robotics by combining FMI's model fidelity with ROS's middleware for real-time sensor-actuator interactions.[66]
SSP serves as a direct companion standard to FMI, defining system-level composition and parameterization for assembling FMUs into larger architectures.[1]