Co-simulation with FMI

 

FMI stands for “Functional Mock-up Interface” and is a key development effort within the MODELISAR project.

The FMI specifications allow any modeling tool to generate the C code or binaries representing a dynamic system model which may then be seamlessly integrated in another modeling and simulation environment.

The FMI for the Co-Simulation specification deals with models with the built-in solvers and the coupling of simulation tools. The specifications are separated into an execution part and a model description part (XML schema). In summary, an FMU (Functional Mock-up Unit) implementing any of the FMI specifications consists of

     The XML model description.

     Implementation of the C function interface in binary and/or source code format.

     Resources such as input data.

     Image and documentation of the model.

 

The RecurDyn/Control FMI support consists of functions for the FMU import and FMU export on Windows.

 

Figure 1  FMI icon of the Control group in the Communicator tab

 

The Functional Mock-up Interface

The Functional-Mock-up Interface is a standard for the exchange of compiled dynamic models and is intended to promote the model reuse and the tool interoperability. Several tools provide to export the Functional Mock-up Units (FMUs), all of which can be used with the FMI for RecurDyn. The FMI provides two different formats for the exchange of models:

     FMI for Model Exchange (FMI-ME): The FMI-ME specification is based on a continuous-time hybrid Ordinary Differential Equation (ODE) representation. The FMI-ME provides inputs and outputs and exposes functions for setting the parameters and computing the derivatives of the ODE. The environments importing FMI-MEs need to provide an integrator, or an ODE solver that integrates the dynamics of the model.

     FMI for Co-simulation (FMI-CS): The FMI-CS specification provides a model representation where both the model and an integrator (ODE solver) is encapsulated inside the FMI-CS. The FMI-CS which is similar to the FMI-ME provides inputs and outputs and means to set the model parameters. It also provides a function to integrate the dynamics of the model for the time interval specified. The FMI entity for RecurDyn supports the Co-simulation specifications.

 

The FMI Entity for RecurDyn

The FMI entity for RecurDyn integrates the Modelica-based physical modeling into the RecurDyn/Control environment. The FMI entity offers the following main features:

     Simulation of compiled dynamic models and FMUs in Control. The FMUs can be generated by an FMI-compliant tool such as Dymola, SimulationX or Silver.

     Simulation of compiled dynamic models and FMUs using the RecurDyn's built-in integrators. This feature is useful to use the FMI entity without accessing Control.

     The FMI entity supports the FMI1.0 and FMI2.0 for Co-simulation.

 

Tested FMU models from different tools

The FMUs exported by different tools have been tested with the FMI entity. In the table, the test is OK if there is no problem using the FMUs exported from this tool. The FMU models which passed to crosscheck according to the specified FMI standard (https://www.fmi-standard.org/tools) can be used with the FMI entity.

 

Windows x64 system

RD Master(Import)

RD Slave(export)

Dymola(2016)

OK

-

Matlab(R12b)

-

OK

SimulationX(3.7)

OK

OK

Amesim(v15)

OK

OK

Simplorer(2018)

-

OK

Table1  Tested FMU models with different tools

 

The FMU is a file containing the functions for the evaluation of the equations for a model. The FMU model can be simulated in Hydraulic using the FMU File. The FMU can have the input and output ports that enable to incorporate the FMU model with RecurDyn. In the next section, “Sample/CoSimulation with FMU”, the basic steps for simulating the FMU model in Hydraulic are demonstrated. The functionality is intuitive, but it can be helpful to go through the simple example showing some combinations of the functionalities to understand their application. The FMU model can be loaded into the RecurDyn environment and be simulated by RecurDyn/Solver. The start values and parameters cannot be set in RecuryDyn, and if the model has inputs and outputs, these can be set with the user defined inputs and outputs data. The FMI1.0 and FMI2.0 for Co-simulation are supported.

 

Limitations

This page indicates the current limitations of the FMI entity.

     The input and output ports do not support the strings, integer and boolean.

     The generated FMU currently does not support to include several instances.

     The imported FMU does not offer to modify the parameter values and the start values as well as block outputs.

 

Note

In case of Amesim, do not close Amesim program during simulation in RecurDyn.

There is no need to execute other programs except Amesim.