Models Step

The Models step contains the following elements.

Model list

Lists all names and types of the models in the project.

Add Model

Connect to FMU Model

Adds a new entry to the model list and allows you to connect to an FMU model (version 2.x).

Connect to Simulink Model

Adds a new entry to the model list and allows you to connect to a Simulink® model.

Connect to TSim Plugin

Adds a new entry to the model list and allows to connect to a TSiM Plugin model.

Connect to ASCET6-PSL Model

Adds a new entry to the model list and allows to connect to an ASCET PSL (PC Simulation Target) model.

Import ASCMO Model

Opens an open file dialog where you can select an ASCMO-STATIC or ASCMO-DYNAMIC model (*.ascmo or *.ascmodyn) to add a new entry to the model list.

Rename

Opens a window, where you can rename the selected model.

Delete Models

Deletes selected models selected in the table from the project. You can use the standard Ctrl/Shift selection functions in the table, or click and hold Lmb and drag the cursor over the cells/rows you want to select.

Input Mapping

The Input Mapping area provides editing options for the model selected in the Model list. These options are different for each model:

FMU Model Variant

  • FMU Model field with and Validate All button

    You can enter or select path and name of a *.fmu model file. %ProjectPath% will be replaced with MOCA project path.

  • FMU Parallelization checkbox: activates/deactivates parallelization of FMUs to speed up optimization.
  • Reset Mode combo box

    Select the desired reset mode, depending on the selection this has an influence on FMU optimization performance. See tooltip for more details.

  • Steady State checkbox

    Activate the checkbox, if you are using a steady state model.

    Use to open and configure Steady State Options. Enter time in seconds for Simulation Step Size (base sample time of the model), Time until steady state and Average last (average interval duration at the end of the steady state). See also Steady State .

Simulink Model Variant

  • Pre Load Script field with button

    You can enter or select a path and name of an executable M-script that will be run before the model is loaded. %ProjectPath% will be replaced with MOCA project path.

  • Simulink Model field with and Open Model button

    You can enter or select a path and name of the Simulink® model (*.mdl: before R2012a or *.slx: from R2012a) to be optimized. A click on Open Model opens the model in Simulink®.

  • Post Load Script field with button

    You can enter or select a path and name of an executable M-script that will be run after the model has been loaded.

  • Data sample time field

    The sample time of the measured data.

    ClosedExample

    3 measurement points with a sample time dT = 0.1 result in a time vector:

    [0 0.1 0.2]

    If the data has been imported as dynamic data, that means data with a time vector, different time channels have been brought to a common base data rate (greatest common divisor) and then will be handed over to the Simulink® model.

    The fastest running simulation/optimization can be reached when the rate of the measurement data and the rate of the Simulink® model match, otherwise the inputs and outputs must be interpolated according to the rate.

    Note  

    The Data sample time value can differ from the model step size.

  • Data Sample Time: Enter a value which is given as input to Simulink®. This field is only editable with static data (without time channel). Usually this value is the same as the fixed step width of the model.

    or

    Time per Step (related to Steady State): Enter the value for simulation duration per row of data.

  • Steady State checkbox and Average last [s] field

    Activate this option, if you are using a steady state model.

    If steady State is activated, enter time in seconds to average the last values and determine a mean value.

  • Allow Fast Restart checkbox

    Deactivate this option to disable “Fast Restart” of Simulink® models e.g. for S-Functions which don't initialize correctly with “Fast Restart”.

  • Closed"Parameter Mapping" area

    • Scan Model

      Scans Simulink® model for parameters and suggests mappings to model parameters. See also Scanning the Simulink® Model and Mapping Parameters or Scan Model <model_name> for Parameter Mapping Window.

    • Edit Mapping

      Opens "Mapping of <parameter>" window. The init script is executed first, then the model is loaded and the existing MATLAB workspace variables are displayed.

      When you use this button in the Enumerations tab the "Change Masked Block" window opens and you can change the values and settings.

    • Delete Mapping

      Deletes selected mappings.

    • Get Calibration from Simulink

      Starts MATLAB®, runs the initialization script and gets axes and calibration from Simulink®.

    • Menu Button

      Opens a drop-down menu with the following entries:

      • Create New MOCA Parameter

        Opens "Create Parameter" window, where you can create a new MOCA parameter. See also Create a Parameter and references therein.

      • Edit Mapped MOCA Parameter

        Opens "Edit Parameter <parameter_name>" window, where you can edit parameter settings.

      • Import MOCA Parameters

        Opens "Import Parameters" window where you can import a list of MOCA parameters in Excel (*.xls, *.xlsx), DCM (*.dcm) or CSV (*.csv) format. See also Import Parameters Only.

      • Set Transpose Parameter for all Mapped Maps

        Sets column Conversion Table to Transpose Parameter.

    • Show Advanced checkbox

      Shows/hides advanced information of table data in Parameters tab.

    • >>/<<

      Shows/hides search list for a quicker selection of MOCA Parameter. Select MOCA Parameter combo box within the table first to browse through list.

    • Mapping table (Parameters)

      Column Name

      Meaning

      MOCA Parameter

      Shows the ASCMO-MOCA parameter with similar name as the Simulink® parameter.

      If no ASCMO-MOCA parameter with similar name is available, you can use this column to map a suitable ASCMO-MOCA parameter with any name.

      Type

      Lists the type of the Simulink parameter. Possible values are Scalar, Curve, Map, Cube-3D and Cube-4D.

      Table Data Simulink

      Shows the content of the "Table data" or "Constant value" field in the Simulink® block parameters.

      Breakpoints 1 Simulink –

      Breakpoints 4 Simulink

      Shows the content of the "Breakpoints <n>" fields in the Simulink® block parameters.

      If the Simulink® element does not use a "Breakpoints <n>" field, the respective table cell is empty.

      Conversion Table

      This column can be used if ASCMO-MOCA and Simulink® use different representations of curves, maps, 3D cubes or 4D cubes.

      ASCMO-MOCA expects arrays with 1, 2, 3 or 4 dimensions. Simulink® can represent 3D/4D cubes as 2D matrices, and even as 1D vectors.

      Transpose Table Data

      -

      Switches rows and columns of a matrix. Required if ASCMO-MOCA expects an m x n matrix, but Simulink® provides an n x m matrix.

      ClosedExample:

      ASCMO-MOCA expects the matrix .

      Simulink® offers .

      3D/4D Cube as 2D Matrix

      -

      Required if 3D/4D cube data are provided as 2D matrices in Simulink®.

      ClosedExample:

      ASCMO-MOCA expects a 3D matrix with 3Dmatrix(:;:;1) = and 3Dmatrix(:;:;2) = .

      Simulink® offers .

      Row Vector

      -

      Required if matrix/cube data are provided as vectors in Simulink®.

      ClosedExample:

      ASCMO-MOCA expects the matrix .

      Simulink® offers .

      Transpose Parameter

      -

      Tranpose Parameter does Transpose Table Data and also exchanges the axes.

      Conversion Axis

      Switches rows and columns of the Axes (Breakpoints 1 Simulink – Breakpoints 4 Simulink), e. g. 1x6 to 6x1.

      Count Breakpoints 1 Simulink –

      Count Breakpoints 4 Simulink

      These columns can be used to write the number of breakpoints to a Simulink® variable.

      Enter a variable name in the respective column, e.g., numBreakpointsX in column "Count Breakpoints <x> Simulink". ASCMO-MOCA creates the variable and assigns the proper value.

    See also Mapping Simulink® Parameters and Scanning the Simulink® Model and Mapping Parameters.

    In the Enumerations tab the mapped parameters of a subsystem mask of the Simulink® model and values are listed.

  • Closed"Input Mapping" area

    • Scan Model

      Scans Simulink® model for inputs and suggests mappings to model parameters.

    • Delete

      Deletes selected Input mapping(s).

    • >>/<<

      Shows/hides search list for a quicker selection of ASCMO-MOCA Name. Select MOCA Name combo box within the table first to browse through list.

    • mapping table

      Column Name

      Meaning

      MOCA Name

      Shows the imported data columns and the nodes from the function.

      Simulink Input

      Lists the Simulink® inputs.

      The following notations are possible.

      • In(n): scalar inport

      • In(n):Vector(m): inport as vector

      • In(n):Bus('BusSignal'): Inport that expects a bus signal. The import will be replaced by an import with Buscreator.

      • Simin('myFromWorkspace'): Using a FromWorkspace block. The workspace variable myFromWorkspace will be set.

        It is also possible to use vector and busses here, e. g. Simin('myVariable'):Vector(1) and Simin('myVariable'):Bus('mySignal').

      • ReplaceWithSimin('mySubsystem/myBlock'): Here, any block will be replaced by a FromWorkspace block and the appropriate variable will be set. This is, for example, used for LabCar Operator ports.

      • Simin('myVariable', 'myTimeVec'): Here, a FromWorkspace block uses two signals in its block mask: [myTimeVec, myVariable]. This is supported with this notation.

    See also Mapping Simulink® Inputs.

  • Closed"Output Mapping" area

    • Scan Model

      Scans Simulink® model for outputs and suggests mappings to model parameters and allows to add output mappings.

    • Delete

      Deletes selected Output mapping(s).

    • mapping table

      Column Name

      Meaning

      MOCA Name

      Shows the ASCMO-MOCA names of Simulink® outputs and ToWorkspace blocks.

      Simulink Output

      Lists the Simulink® outputs.

      The following notations are possible.

      • Out(n): outport

      • Simout('mySimout'): Using a ToWorkspace block. The workspace variable mySimoutwill be read.

      • ReplaceWithSimout('mySubsystem/myBlock'): Here, any block will be replaced by a ToWorkspace block, and the appropriate variable will be set. This is, for example, used for LabCar Operator ports.

    See also Mapping Simulink® Outputs.

  • Validate

    Validates the Simulink® model. Possible errors are reported. If the test is successful, a success message is displayed.

  • Set Calibration checkbox

    Activate to transfer the current calibration in ASCMO-MOCA to Simulink for verification. If deactivated, the original Simulink® calibration is used for verification.

TSiM Plugin

  • "TSiM Plugin" field with the and Validate button.

    You can enter or select a path and name of the TSiM Plugin.

    Click to select a TSiM Plugin (*.mexw64) from an open file dialog.

    Click Validate to check whether the model can be loaded and whether the configurations are valid. The model is not executed. It can automatically repair problems with group axes.

    Click Info Button to open the Closed"Info" window. The window displays information about the functions and the version of the TSiM Plugin. Depending on the version of the TSiM Plugin, different information is displayed.

  • Steady State checkbox

    Activate the checkbox, if you are using a steady state model.

    Use to open and configure Steady State Options. Enter time in seconds for Simulation Step Size (base sample time of the model), Time until steady state and Average last (average interval duration at the end of the steady state). See also Steady State .

    "Simulation Step Size" drop-down list to set the model step width. Current sample rate and calculated recommended sample rate is shown in the tooltip. "Multi Rate" must be chosen during data import in "Time Base" settings. Only usable for "Import Dynamic Data" within Data Step. See ASCMO Data Import .

  • DLL Parallelization checkbox: activates/deactivates Parallelization of DLLs to speed up optimization.
  • DLL Initialization: opens the DLL Initialization window, where you can set the initial value.

ASCET6-PSL Model Variant

  • "ASCET-PSL Model" field with and Validate All button

    You can enter or select path and name of an ASCET-PSL DLL file. %ProjectPath% will be replaced with MOCA project path.

ASCMO Model Variant

  • Import Models: Select the ASCMO outputs to import.

  • Input Mapping

    Column Name

    Meaning

    ASCMO Input Name

    Shows the names of the ASCMO-STATIC or ASCMO-DYNAMIC inputs.

    MOCA Name

    Allows you to map an ASCMO-STATIC or ASCMO-DYNAMIC input to a MOCA input channel or function node.

    ASCMO inputs and MOCA input channels or function nodes with matching names are mapped automatically.

  • Initial Output Value

    If a model contains output initialization, the first measured or estimated output value is used to initialize its internal state.

    Column Name

    Meaning

    Signal or Value

    Shows the names of the ASCMO-DYNAMIC output.

    MOCA Name

    Allows you to map an ASCMO-DYNAMIC output to a function node or a data channel. The first value of a data channel is used as model initialization. In a model formula in the Function Step the last value of the model inputs correspond to the initialization.

    Click in the column and type a value to manually set the initial value.

    ASCMO outputs and MOCA function nodes with matching names are mapped automatically.

See also  

Models

Steady State

Instructions (Models Step)

Step 4: Models