FMU
This block (co)simulates an FMU block.
Library
CoSimulation
Description
The FMU block enables the importing and simulation of an FMU as an intrinsic Activate block. The FMU can be of type Model-Exchange (ME) or Co-Simulation (CS). Both version 1.0 and 2.0 are supported. Inputs and outputs can be of Real, Integer, Boolean or String data types. Only scalar input and output are supported. The FMU block can also signal an external event to the FMU.
Parameters
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
FMUfilename | FMU file name | The full path of the FMU to be imported. | String | |
NX | Number of continuous states | Number of continuous-time states of the FMU. Click the 'Reload' button to automatically populate this field. | Scalar | |
NZ | Number of zero-crossing surfaces | Number of zero-crossing surfaces of the FMU. Click the 'Reload' button to automatically populate this field. | Scalar | |
nin | Number of inputs | Number of input ports of the FMU. Click the 'Reload' button to automatically populate this field. | Number | |
inports | Input ports | Structure | ||
inports/name | Name | Name of the input port. The name is extracted from the FMU file and is not editable. | Cell of strings | |
inports/description | Description | Description of the input port. The description is extracted from the FMU file and is not editable. | Cell of strings | |
inports/it | Datatype | Input datatype of the input port. The datatype is extracted from the FMU file and is not editable. | Cell of strings | |
inports/dodependency | Direct dependency vector for the input | Input-output dependency of the input port. The dependency is extracted from the FMU file and is not editable. Select the check box to indicate that the input directly affects the output port values. | Cell of vectors | |
nout | Number of outputs | Number of output ports of the FMU. Click the 'Reload' button to automatically populate this field. | Number | |
outports | Output ports | Structure | ||
outports/name | Name | Name of the output port. The name is extracted from the FMU file and is not editable. | Cell of strings | |
outports/description | Description | Description of the output port. The description is extracted from the FMU file and is not editable. | Cell of strings | |
outports/ot | Datatype | Output datatype of the output port. The datatype is extracted from the FMU file and is not editable. | Cell of strings | |
nparam | Number of parameters | Number of editable parameters of the FMU. Click the 'Reload' button to automatically populate this field. | Number | |
params | Parameters | Structure | ||
params/name | Name | Name of the parameter. The name is extracted from the FMU file and is not editable. | Cell of strings | |
params/description | Description | Description of the parameter. The description is extracted from the FMU file and is not editable. | Cell of strings | |
params/tp | Datatype | Parameter datatype of the output port. The datatype is extracted from the FMU file and is not editable. | Cell of strings | |
params/unit | Unit | Cell of strings | ||
params/value | Value | The value of the parameter. The default value is automatically extracted from the FMU and displayed. | ||
params/defvalue | Default value | |||
params/reference | Reference | Cell of scalars |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
run_as_me | Run as Model Exchange if both FMU types are provided | If the FMU provides both the Model Exchange and Co-Simulation API's, you can select the check box to apply the Model Exchange API, otherwise the Co-Simulation API is applied. | Scalar | 0 |
tolerancecontrolled | Error tolerance is provided to FMU | Scalar | 0 | |
stoptimedefined | Final time is provided to FMU | Scalar | 0 | |
deleteafteruse | Delete the unpacked FMU before exiting | The import block unzips the FMU on each run. Select the check box to delete the unzipped folder after the simulation runs. | Scalar | 0 |
inevent | Show FMU input event ports | Select the check box to enable the input event ports of the FMU import block. The FMU import block has two input event ports: External and End. The External event can be activated by any event and puts the FMU (of type ME) into the event iteration mode. The End event puts the block into terminate mode. | Scalar | 0 |
outevent | Show FMU output event ports | Select the check box to enable the output event ports of the FMU import block. The FMU import block has two output event ports:Discrete and End. The Discrete event is triggered when a time event is programmed inside the FMU block. The End event is triggered when the FMU requests a termination. | Scalar | 0 |
resources | FMU resource location | Location of the resource folder for the FMU. If a location is not specified, the default location is fmu://resources. | String | |
tempdir | Directory for unpacking the FMU | Specify a folder to unzip the FMU. If a folder is not specified, the FMU is unzipped into a temporary folder. | String | |
ipc | Run in safe mode | Protects Activate from crashes in the FMU. Simulations run slower in this mode. | Scalar | 0 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
enable_fmulogging | Enable FMU logging | Select the check box to enable the logger. | Number | 0 |
simloglevel | FMU interface logging level | Select a logging level for the interface to the FMU block. The levels Info, Warning, and Error are registered. | String | 'Nothing' |
add_Activate_messages | Add Activate messages | Select the check box to include messages from Activate in the log file. | Scalar | 0 |
fmulogging_cats | FMU logging categories (for FMI-2.0 and later) | The FMU can filter log messages. You can enter the required log categories. Log categories should be protected by double quotes and separated by a comma. | String | |
log_file_name | Log file name (*.log) | The log file name to be created. If this field is left empty, the logger is disabled. | String | |
csv | Separator character used in .csv file | The separator character in the output .csv file. | String | |
out_enum_as_int_flag | Print Enums and Booleans as integers in .csv file | Select the check box to activate the Enum values as integers, otherwise the text values are stored. | Scalar | 0 |
log_only_outputs | Store only input/output variables | Select the check box to store only input and output variables in the .csv and HDF files to reduce output file volume. | Scalar | 0 |
result_file | Result storage file name (*.csv/*.mtsf) | The full path of the output result file. The output file can be either a .csv or HDF file (with extension *.mtsf). | String |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
stepevent | Solver mesh-point events (step events) | If activated, when a step event occurs, the value of each variable is stored at that time instant. | Scalar | 0 |
stateevent | Zero-crossing events (state events) | If activated, when a state event (zero-crossing event) occurs, the value of each variable is stored at that time instant. | Scalar | 0 |
timeevent | Time events | If activated, when a time event occurs, the value of each variable is stored at that time instant. | Scalar | 0 |
OutputOn | Every output update | If activated, when the block outputs are updated, the value of each variable is stored at that time instant. | Scalar | 0 |
meshpoints | Meshpoints | If activated, the value of each variable is stored at the solver mesh points. | Scalar | 0 |
superdensetimes | Super dense time instants | If activated, the value of each variable is stored at the super dense time instants of the discrete events. | Scalar | 0 |
Name | Label | Description | Data Type | Valid Values |
---|---|---|---|---|
fixedComStepsize | Preferred fixed communication stepsize | FMUs of type Co-Simulation are simulated by performing input and output updating at intervals called communication points. The communication points can be defined by the Activate solvers or constant time. In the latter case, the constant communication interval size is provided here. This option is valid for FMI 2.0. | Scalar | |
provideDerivative | FMU input interpolation | If activated, the first derivative of inputs is computed using the numerical differentiation method and is given to the FMU/CS. | Scalar | 0 |
exploitOutDerivative | FMU output extrapolation order | Number | ||
visible | Secondary simulator should be visible | If activated, the FMU/CS is co-simulated interactively. | Scalar | 0 |
Ports
Name | Type | Description | IO Type | Number |
---|---|---|---|---|
Port 1 | explicit | output | nout | |
Port 2 | explicit | input | nin | |
Port 3 | activation | input | 2*inevent | |
Port 4 | activation | output | 2*outevent |
Advanced Properties
Name | Value | Description |
---|---|---|
always active | yes | |
direct-feedthrough | Depends on block parameters | |
zero-crossing | Depends on block parameters | |
mode | no | |
continuous-time state | Depends on block parameters | |
discrete-time state | no |