FMU
Use the FMU tool to add a Functional Mock-up Unit and connect it to a multibody model.
Add an FMU Entity
- Select the system to which the FMU entity is to be added.
-
Add the FMU entity to the system by any of the following methods:
- From the Model ribbon, click the FMU icon.
- Right-click on the system in the Model Browser and select from the context menu.
- Right-click on any existing FMU folder in the Model Browser and select Add FMU… from the context menu.
The Add FMU dialog is displayed. -
Specify a label and a variable name.
Note: By default, variables names of entities in MotionView follow a certain convention. For example, all FMU entities have a variable name starting with “fmu_”. This is the recommended convention to follow when building models in MotionView since it has many advantages in identifying the entity during model editing and model manipulation
- Use the Filename browser to locate the FMU file (.fmu) and select it.
- Click OK to close the window or Apply to continue creating entities.
View and Edit FMU
Property | Type | Description |
---|---|---|
Filename | File | FMU file name with path. |
FMU Type | String | Type of FMU.
If an FMU contains both types, this option is available for selection. |
Number of states | Integer | Number of states within the FMU. |
Number of inputs | Integer | Number of input channels the FMU is seeking. |
Number of outputs | Integer | Number of output channels from the FMU. |
Number of parameters | Integer | Number of parameters in the FMU. |
Check FMU | Runs the FMU compliance checker to provide more information and verify the validity of the FMU. See Comments. | |
Reload FMU | The FMU is reloaded. |
Click on Edit FMU... to view and edit Input, Output, Parameters and Settings.
This dialog has the following tabs:
Input
The input tab lists all the input channels in the input array with their name and description.
Provide a solver expression under the Value column to each of the channels as input to the FMU. The value of this solver expression is computed by MotionSolve during simulation and communicated to the FMU at every time-step of the simulation.
Output
This tab lists all the output channels in the output array from the FMU with their names and descriptions.
Parameters
The parameters tab lists the parameters and initial conditions along with their default values in the FMU. Parameters are variables that are exposed by the FMU and can take a different value at the beginning of the simulation. Parameters can be of the type Real, Integer, Boolean or String.
Settings
Property | Type | Description |
---|---|---|
Error tolerance factor | Real | Applicable for FMU of type Model Exchange only. A scale factor that is
multiplied to the displacement integration error tolerance define the integration
error tolerance for the continuous states of the FMU. Value > 0, Default: 1.0 |
Communication Interval | Real | Time interval that MotionSolve uses to
communicate with the FMU. Value > 0, Default: Maximum integration step size |
Static Hold | Boolean | Applicable for FMU of type Model Exchange only. Flag to hold the value of the FMU’s dynamic states constant during a static or quasi-static simulation. Default: False |
Use Address | Boolean | Turn this option ON if the FMU is run on a different machine. Default: OFF (FMU is executed on the same machine as MotionSolve). |
IP Address | String | If Use Address is ON, provide the IP address of the machine where the FMU is executed. |
Connect an FMU to the Model
- Provide solver expressions for each of the channels under the Value column of the Input tab.
-
Define the FMU Outputs. These are referenced by Force or Motion entities in the
Model.
The expression for the Forces/Motions in the Model use the ARYVAL function to reference the FMU outputs. The FMU outputs are available as attributes to the
y_array
data member of the FMU entity. For instance,{fmu_1.y_array.output_3}
, will contain the third output of the FMU.In the above model of a quadcopter, the vehicle position and velocities captured by the solver expressions DX(), DY() etc. are provided as inputs to the FMU. The output from the FMU is tapped using the output attributes of the
y_array
data member of the FMU that was resolved to the solver expression ARYVAL. In the demonstrated case, the motion on one of the blades uses the second and the third output. The expression{fmu_controller.y_array.output_2}
returns the second output from the FMU’s (fmu_controller
) output array (y_array
).
Comments
An FMU could be of the type Model Exchange (ME) or Co-simulation (CS) or both. An ME FMU contains the necessary states and variables that could be solved by the calling solver. A CS FMU can contain its own solver or calls another solver. In this case, two solvers co-simulate (one calling solver and other solving the FMU) to solve the entire model. An FMU may contain both modes ME and CS. In this case, the Type attribute in the FMU panel will be editable and you can select the mode in which the FMU is solved.
See the following for additional information:
MV-7012: Functional Mockup Unit (FMU) in MotionView and MotionSolve