Matlab adapter - User manual

Table of Contents

  1. General
  2. Set-up and Initialization
  3. Getting Started
  4. Mode Selection and Control
  5. Normal Operations
  6. Normal Termination
  7. Recover Runs

General

To start the adapter, just run the executable from the unzipped folder.

Set-up and Initialization

No specific task needed to be done at this point.

Getting Started

From the main window connect to a e-TM-10-25 model. Once this is done, you should be able to browse the ElementDefinition tree. You can then now open a connection to a MATLAB Server and load a MATLAB script. After this step you can browse the Variable from the MATLAB model and run the experiment.

Mode Selection and Control

From the main window of the adapter, it is possible to:

  • To switch transfer direction,
  • To view messages on the status bar,
  • To visualize trees from both models,
  • To refresh the E-TM-10-25 session,
  • To Connect/Disconnect from data sources,
  • To preview the net change,
  • To visualize the exchange history,
  • To execute the loaded MATLAB script

Security wise, login to a E-TM-10-25 source can be done with your COMET® login/password which your model administrator can also provide.

Normal Operations

The MATLAB adapter lets you transfer values from any E-TM-10-25 Parameter that has at least one value in its ValueSets to a MATLAB variable that can be overridden.

  • You can map from one scalar actual value to any compatible MATLAB variable

The MATLAB adapter also lets you transfer pairs of values/experiment time from any MATLAB Variables in different manners:

  • You can choose to import all the recorded values or a selection for one chosen Variable to an existing or a new E-TM-10-25 Parameter or ParameterOverride of type ArrayParameterType, SampledFunctionParameterType or ScalarParameterType.
    • In the case the target Parameter is not an override, the Element Definition container can also be non-existent in the target model, it will then be added.
    • In the case you want to update a Parameter Override, it is possible to choose multiple Element Usages from one Element Definition. Then every override of one Parameter of type of the Parameter Type that you chose will be updated.
  • If only one value from a Variable is selected:
    • An ArrayParameterType can be picked.
      • An existing Parameter of type of the selected ArrayParameterType will be updated.
      • Or in the case no Parameter of type of the selected ArrayParameterType exists a new one will be created.
    • A SampledFunctionParameterType can be picked.
      • An existing Parameter of type of the selected SampledFunctionParameterType will be updated.
      • Or in the case no Parameter of type of the selected SampledFunctionParameterType exists a new one will be created.
    • A ScalarParameterType can be picked. Then if the ParameterType is compatible with the value type of the current variable.
      • An existing Parameter of type of the selected ScalarParameterType will be updated.
      • In the case no Parameter of type of the selected ScalarParameterType exists a new one will be created.
    • A Parameter can be chosen, then its value will get updated.

Important to note that every ArrayParameterType or SampledFunctionParameterType made available in the adapter have been created before in the connected model. The usable ArrayParameterType types follow the following rule:

  • The dimensions of the ArrayParameterType must be the same of the matrix.
  • The ArrayParameterType must have all components of the same ParameterType and if the ParameterType is a QuantityKind, the same MeasurementScale.
  • All components must be of QuantityKind type or TextParameterType. The usable SampledFunctionParameterType types follow the following rule:
  • The number of Independent and Dependent ParameterTypes must match to the number of rows/columns of the matrix.
  • The ParameterType of any Independent or Dependent ParameterTypes must match to the datatype of the matrix.

The previous operations register themselves in a process where once you have defined what value to transfer to what destination, you have the possibility to preview the impact on the target model, but also to filter those impact view based on a selection from the source model. In the different impact views, it is possible to select the mapped things you want to transfer. In the context menu, two actions are available:

  • To select all mapped things.
  • To deselect all mapped things.

In the Mapping panel, you can observe computed value differences for all parameter of mapped Element Definitions and Usages, when the mapping from the MATLAB to the Hub. Then you can transfer your mapped values to their configured destination. When you choose to transfer, the mapped values are then transferred to the configured target model. In the case anything goes wrong at this stage, you can cancel, and it will delete every configured mapping in the state of pending to transfer.

Normal Termination

After all transfer are complete the tree views are refreshed showing Parameters and Variables with their new value. From the main window terminating the program is simple in the way that any temporary files are cleaned up and the E-TM-10-25 session is closed by the program automatically.

Recover Runs

If the MATLAB session is unexpectedly closed, no pending transfer to a Variable is lost, and you might want to reconnect the same way you first connect to the MATLAB server. If the E-TM-10-25 server is not responding, you will notice it when attempting transfer in this direction or if you try to refresh the session. You might want to reconnect to the COMET® server the way you connect the first time. If there is any pending transfer to E-TM-10-25, you can attempt them, but you will most likely have to cancel the transfer is any error are raised. In the case where a transfer fails, the defined mapping is lost if the mapped elements have never been transferred. After transferring some mapped elements and if no mapping configuration were loaded or created before. It is still possible to save the mapping by means of creating a new mapping configuration and letting the adapter add the mapped element to the configuration. It also possible to create a new mapping configuration to clear the current mapped elements.


Table of contents