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](../_images/image0306.png)
Figure 22.7 General CoSim dialog box
22.2.3.1. FMI
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](../_images/image0316.png)
Figure 22.8 GCoSim/FMI dialog box [RecurDyn Host]
![../_images/image0323.png](../_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.
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.2. Simulink
![../_images/image0345.png](../_images/image0345.png)
Figure 22.10 GCoSim/Simulink Interface dialog box [RecurDyn Client]
![../_images/image0355.png](../_images/image0355.png)
Figure 22.11 GCoSim/Simulink 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.
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 inputted value is supported for the value under 1.0e-7 in order to avoid to increase simulation time dramatically.
Following the Interface Time of Host: In this RecurDyn Client 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.
Create a Plant Block
Output file name: Defines a name of output files created after simulation.
Note
If you proceed with co-simulation using the GRDClient command, the name of Output file name in this dialog is applied.If you proceed with co-simulation using the GRDClient_block command, the Output File Name of Dynamic/Kinematic Analysis dialog is applied and the name of Output file name in this dialog is ignored.M-File to create Plant Block: Allows the user to enter the M-File name to use in Simulink. RecurDyn block is created in Simulink like these.
Figure 22.12 RecurDyn Host block (GRDHost command)
Figure 22.13 Block Parameter (GRDHost command)
Figure 22.14 RecurDyn Client block (GRDClient command)
Figure 22.15 Block Parameter block (GRDClient command)
Figure 22.16 RecurDyn Client block (GRDClient_block command)
Figure 22.17 Block Parameter block (GRDClient_block command)
Run Simulink Model: Defines information about Matlab program and Simulink model. This option is activated in only case that Host Program is set with RecurDyn.
Matlab Program: Defines the executable file name and the installation directory of Matlab program(x64).
M-File to run Simulink Model: Defines M-File name to be used for the batch job of Simulink Model.
Simulink Model: Defines the name of Simulink model that is built for the co-simulation with RecurDyn. This model should include RecurDyn Plant Block.
Note
22.2.3.3. External
![../_images/image034_01.png](../_images/image034_01.png)
Figure 22.18 GCoSim/External Interface dialog box [RecurDyn Client]
![../_images/image034_02.png](../_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.