22.2.3. General CoSim

The user can set co-simulation environment for GCoSim which support the FMI1.0/2.0 CS (Co-Simulation), External and MATLAB/Simulink Interface for RecurDyn Client Mode and RecurDyn Host Mode.

../_images/image0306.png

Figure 22.7 General CoSim dialog box

22.2.3.1. 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 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.

../_images/image0316.png

Figure 22.8 GCoSim/FMI dialog box [RecurDyn Host]

../_images/image0323.png

Figure 22.9 GCoSim/FMI dialog box [RecurDyn Client]

  • Type: Import type and Export type are supported for FMI. In case of Import type, RecurDyn becomes a host. In case of Export type, RecurDyn becomes a client.

  • Interface Version: Selects a FMI version as 1.0 and 2.0.

  • Model File: Links the FMU file. This is activated in case of Import type.

  • Plant File Name: Shows the RecurDyn model file name.

  • GPlant Input: Allows to access the GPlant Input List dialog box.

  • GPlant Output: Allows to access the GPlant Output List dialog box.

  • Interface Time Step: Defines the interface sample time for the co-simulation. If this value is less than the value of maximum step size, the value of maximum step size is changed to this value. The time unit of Interface Time Step can be used to Milliseconds. Also, The Interface Time Step supports the value over 1.0e-12 seconds which is able to adjust the step size precisely for more accurate analysis. The setting of low value can make to increase simulation time dramatically.

    ../_images/image0335.png
  • Following the Interface Time of Host: In this RecurDyn Client (Export) case, Following the Interface Time of Host option is designed to continually follow the host’s interface time which it makes to change the interface time of RecurDyn Client model. If this option is applied, the Match Solving Stepsize with Report Step option is not applied.

  • Waiting Time (Seconds): Waits the first communication with Simulink as inputted time. (Unit: Second). The default value is 10. The inputted value of Waiting Time is 1≤ Waiting Time ≤600. This option is activated in case of Export type.

  • Active connection: Activation of that option supports data connection between FMI Host S/W and one RD model (Client) which is currently open and in use. It make that co-simulation can be executed without terminating RecurDyn GUI. In this case, Multi-CoSim is not supported.

  • Create a FMU File: Defines a name of the FMU file. The FMU file is crated at the same folder with the RecurDyn model after clicking Export. This is activated in case of Export type.

  • Delete CoSim Information: If this option is used, the user can delete co-simulation information.

22.2.3.3. External

../_images/image034_01.png

Figure 22.18 GCoSim/External Interface dialog box [RecurDyn Client]

../_images/image034_02.png

Figure 22.19 GCoSim/External Interface dialog box [RecurDyn Host]

  • Host Program: Allows the user to select the host program. A host program is a start program to execute the other client program for co-simulation. it supports External Program and RecurDyn Model.

  • Sampling Period (Control Time Step): Defines the control time step for the co-simulation.

  • Following the Interface Time of Host: In this RecurDyn Client (Export) case, Following the Interface Time of Host option is designed to continually follow the host’s interface time which it makes to change the interface time of RecurDyn Client model. If this option is applied, the post option for matching step size is not applied in post report.

  • Waiting Time (Seconds): Waits the first communication with external program as inputted time. (Unit: Second). The default value is 10. The inputted value of Waiting Time is 1≤ Waiting Time ≤600. This option is activated in case of Export type.

  • Client Program: Select client program.