Hauptinhalt

Limitations for Parameter Tunability in Generated FMUs

For a functional mockup unit (FMU), a tunable parameter is an exported FMI variable that has its causality attribute set to parameter and variability attribute set to tunable in the generated modelDescription.xml file of the FMU. When exporting a Simulink model as an FMU, you can configure model arguments, base workspace variables, and data dictionary variables to be exported as tunable parameters of the FMU.

Tunable Variables Limitations

These limitations apply when exporting Simulink variables as tunable parameters of an FMU.

  • You cannot export variables of complex type as tunable parameters of an FMU.

  • You cannot export variables with empty initial values or incomplete dimension information as tunable parameters of an FMU. According to the FMI standard, the initial dimensions of all exported variables must be defined as positive integers.

  • You must set the Parameter tunability parameter of Transfer Fcn and State-Space blocks as unconstrained to enable variables used to define block parameters to be exported as tunable parameters of an FMU.

  • You cannot export parameters of the Zero-Pole block as tunable parameters of an FMU.

  • To enable Simscape block parameters to be exported as tunable parameters of an FMU, you must set the Configurability setting of the block parameters as Run-time. For an example of exporting Simscape models as FMUs with tunable parameters, see Export Simscape Model as FMU with Tunable Parameters and Internal Variables.

Tunable Expressions Limitations

You can also use variables in an expression for Simulink block parameters. The variables used in the expressions can be conditionally exported as individual tunable parameters of the FMU with these limitations.

  • The variables used in an expression for block parameters of Fcn and If blocks cannot be exported as tunable parameters of an FMU.

  • You can write mask initialization code that creates and modifies variables. If you use those variables in an expression, the variables cannot be exported as tunable parameters of the generated FMU.

  • Expressions with complex (i) workspace variables and parameter objects are not supported.

  • This table lists limitations that apply for use of operators in expressions.

    CategoryOperators or Functions
    1+ - .* ./ < > <= >= == ~= & |
    2* /
    3abs acos asin atan atan2 boolean ceil cos cosh exp floor log log10 sign sin sinh sqrt tan tanh single int8 int16 int32 uint8 uint16 uint32
    4: .^ ^ {} [] \ .\ , ;
    • Use operators from category 1 without loss of tunability.

    • Use operators from category 2 in expressions as long as at least one operand is a scalar. For example, scalar-scalar and scalar-matrix operand combinations are supported, but matrix-matrix combinations are not supported.

    • You can use tunable workspace variables as arguments for the functions in category 3.

    • The operators in category 4 are not supported.

Exclude Variables from Export as Tunable Parameters

To exclude a variable from being exported as a tunable parameter of the FMU:

  • Set the ExportedParameter argument of the exportToFMU function as {''} to exclude all variables from being exported as tunable parameters. To exclude certain variables, specify a cell array with the names of variables that need to be exported as the value for this argument and exclude the other variables from the cell array.

  • Clear the Exported option for the variable in the Parameters tab of the FMU export dialog box.

    FMU export dialog box with parameter unchecked for export

See Also

|