Matlab adapter - Tutorial

Table of Contents

  1. Introduction
  2. Getting Started
    1. Starting the Adapter
  3. Using the Software on a Typical Task
    1. Mapping from E-TM-10-25 to MATLAB
    2. Executing the script
    3. Mapping from MATLAB to E-TM-10-25
    4. Reviewing the exchange history

Introduction

In the tutorial section, you will see how to use the software performing basic tasks.

Getting Started

To get started 3 simple tasks are required to be accomplished.

Starting the Adapter

Run the DEHPMatlab.exe from the location where you have previously unzipped the adapter zip file.

The MATLAB adapter install location.

Figure 1:The MATLAB adapter install location.

The main window at start.

Figure 2:The main window at start.

Connecting to a COMET® server and opening an Iteration.

Figure 3:Connecting to a COMET® server and opening an Iteration.

The main window with the ElementDefinition tree after opening an Iteration.

Figure 4:The main window with the ElementDefinition tree after opening an Iteration.

Connection to the MATLAB Server.

Figure 5:Connection to the MATLAB Server.

The main window with both data source connected.

Figure 6:The main window with both data source connected.

Select the MATLAB Script to load.

Figure 7:Select the MATLAB Script to load.

The main window with the script loaded.

Figure 8:The main window with the script loaded.

Using the Software on a Typical Task

Mapping from E-TM-10-25 to MATLAB

  1. First, change the transfer direction so that the mapping source is the Hub Data Source.
  2. Select some ElementDefinitions that contain the values you want to map.
  3. Right click on your selection and select “Map Selection”.
  4. Map each desired value to one Variable.

Mapping a value from a Parameter to a Variable.

Figure 9:Mapping a value from a Parameter to a Variable.

The value has been mapped and the relevant trees are highlighting the differences.

Figure 10:The value has been mapped and the relevant trees are highlighting the differences.

Selecting mapped things to transfer.

Figure 11:Selecting mapped things to transfer.

Confirmation that the transfer went as expected.

Figure 12:Confirmation that the transfer went as expected.

Executing the script

  1. Run the script.

Run the Script

Figure 13:Run the Script

Mapping from MATLAB to E-TM-10-25

  1. First, change the transfer direction so that the mapping source is the MATLAB Data Source.
  2. You might want to run the experiment to be able to map more than the initial values.
  3. Select some Variables that contain the values you want to map.
  4. Right click on your selection and select “Map Selection”.
  5. Map each desired value to one Parameter or ParameterType.

Mapping a matrix to a SampledFunctionParameterType.

Figure 14:Mapping a matrix to a SampledFunctionParameterType.

When mapping a Matrix, only compatible ParameterType are available. Once an existing Parameter or a ParameterType has been selected, you are invited to configure the mapping of the SFPT, like shown in Figure 15. You can decide which Parameter Type of the SFPT correspond to which row or column of the Matrix and if one of the Independent Parameter Type contains TimeStep or not. If one of the Independent Parameter Type contains TimeStep, you can select a subset of values to mapped, like shown in Figure 16.

Configuring an SFPT with Tagged Values

Figure 15:Configuring an SFPT with Tagged Values

Selecting multiple tagged values

Figure 16:Selecting multiple tagged values

Searching for a ParameterType.

Figure 17:Searching for a ParameterType. When mapping a Variable which is not a Matrix, all ParameterType are available, excepts ArrayParameterType and SampledFunctionParameterType.

Mapping one value to a new QuantityKind Parameter of an existing ElementDefinition.

Figure 18:Mapping one value to a new QuantityKind Parameter of an existing ElementDefinition.

Mapping one matrix to a new ArayParameterType Parameter of a new ElementDefinition.

Figure 19:Mapping one matrix to a new ArayParameterType Parameter of a new ElementDefinition.

Preview of the defined mapping done in **Figure 19** Mapping one matrix to a new ArayParameterType Parameter of a new ElementDefinition.

Figure 20:Preview of the defined mapping done in Figure 19 Mapping one matrix to a new ArayParameterType Parameter of a new ElementDefinition.

Preview of the calculated value differences.

Figure 21:Preview of the calculated value differences.

The preview difference with context menu

Figure 22:The preview difference with context menu When mapping a Matrix, it is possible to preview the difference of values of the existing SFPT or ArrayParameterType and ones of that will be transfer. This preview is accessible by right clicking on the row corresponding to this matrix in the “Value Diff” tab, like shown in the Figure 22.

The difference of 2 matrices

Figure 23:The difference of 2 matrices

Selecting mapped thing to transfer.

Figure 24:Selecting mapped thing to transfer.

Expected result of a transfer from MATLAB to COMET®.

Figure 25:Expected result of a transfer from MATLAB to COMET®.

Reviewing the exchange history

The exchange history is available through the “Transfer History” button.

Reviewing the exchange history.

Figure 26:Reviewing the exchange history.


Table of contents