Use of Connectors I – Naming Policy ‘integrate’ with one Equation Using a Different Notations

This tutorial section covers how to inert the equation of a colleague that uses another notation into your equation system.

Model description

In this example, we want to solve the following equation system:

    \begin{align*} &y_{j=1} + \alpha \cdot y_{j=2} = \beta \\[2ex]&\gamma \cdot y_{j=2}^{2} = -\delta + y_{j=1}. \end{align*}

However, your colleague has already used the first equation before – unfortunately with another notation:

    \begin{equation*} x_{i=1} + a \cdot x_{i=2} = b. \end{equation*}

Hence, you cannot simply include it in your equation system. To solve this problem, we will set up a connector.

Workflow

In the following, we demonstrate the workflow. Besides the equation “of the user”, we will also set up the equation “of the colleage”.

Notation of the user

Set up a notation with the following base names and indices:

Base names
  • \alpha, parameter 1
  • \beta, parameter 2
  • \gamma, parameter 3
  • \delta, parameter 4
  • y, variable
Indices
  • j, index 1…NJ

The resulting notation has ID 182730.

Notation of the colleague

Set up the notation “of the colleague” with the following base names and indices:

Base names
  • a, parameter 1
  • b, parameter 2
  • x, variable
Indices
  • i, index 1…NI

This notation has ID 182731.

Equation of the user

Go to the Equation tab and perform the following steps:

  1. Load the notation of the user
  2. Enter the second equation of the user’s equation system
  3. Save the equation

The user equation has ID 182732.

Equation of the colleague

Go to the Equation tab and perform the following steps:

  1. Load the notation of the colleague
  2. Enter the equation as defined by the “colleague”
  3. Save the equation

The colleague’s equation has ID 182733.

Connector

Now it is necessary to create a connector, which is basically a list of synonyms for variable names. Go to the Connector tab and proceed as follows:

  1. Add a helpful description for the connector
  2. Activate the tab Edit Matching. You see two sections: one for the Sub Notation and one for the Super Notation. Both sections contain a field to import the notation
  3. In the section for the Sub Notation, press the Import button and select the notation of the colleague, then confirm. Alternatively, you can select Import Notation from Connected Element and select the equation of the colleague. This automatically adds all variables used in this equation
  4. Add the user notation as Super Notation. As there is no analogous equation available, you need to select Import Notation directly
  5. Generate the missing variables for the Sub Notation and the Super Notation, i.e.,
    • Sub Notation: x_i, a, b
    • Super Notation: y_j, \alpha, \beta
  6. Select the analogous variables and click on Match to achieve the following matching:
    • x_i \rightarrow y_{j}
    • a \rightarrow \alpha
    • b \rightarrow \beta
  7. Make sure by clicking on the pair x_i; y_j to check whether the Index Matching was successful. The Sub index i should have been matched with the Super index j
  8. Save the connector

The connector is available with ID 182734. Figure 1 illustrates how both equations are combined to one equation system.

chart 2
Figure 1: Visualization of the variable naming when using the connector. Note: this figure must be updated to match the variables and names used in this example.

Equation system

To construct the equation system, go to the Equation System tab and take the following steps.

  1. Load the user equation
  2. Click on “Add EQU/EQS”
  3. Add the user equation as usual
  4. Select and load the colleague’s equation, but do not confirm to close this popup window
  5. Make sure that the Naming policy is integrate
  6. Turn on the option Use connector und load your saved connector
  7. Confirm
  8. Your equation system should now contain the colleague’s equation, but with your connector in the Connector column
  9. Add the user equation in the usual way without specifying any connector
  10. Save the equation system; should a warning appear because the notation of the equation is different from the equation system’s notation, acknowledge it. If you did everything as described, there will be no problem as you used a connector

The equation system has ID 182735.

Evaluation / Simulation

Go to the “Simulation” section and do the following:

  1. Load your equation system in the tab Equation System
  2. Set the maximum Value NJ to 2 in the tab Indexing
  3. Go to the tab Specifications; you will notice that the variables a, b, and x_i are not part of the variable specification as a result of the included connector
  4. Assign the variables \alpha, \beta, \gamma, and \delta as design values
  5. Assign the variables y_{j=1} and y_{j=2} as iteration values

Additional comments:

  • If you go to the Equation System tab in the “Simulation” section, you see the original notation of the equations without connector
  • In the Instantiated System tab, both equations are  presented in the symbols corresponding to the Super Notation

Initialization and results

To initialize and specify the model, take the following steps:

  1. Initialize this example with the design values and initial guesses given in Table 1
  2. Save the variable specification 
  3. Save the simulation
  4. Go to the Evaluation tab and generate the code for your preferred environment
  5. Solve the system using the generated code

This simulation is available with ID 182739 with variable specification 182741. The solution for all iteration variables is also given in Table 1.

NameDescriptionValue / Initial guessSolution
\alphaParameter 13
\betaParameter 23
\gammaParameter 32
\deltaParameter 42
y_{j=1}Variable 112.158
y_{j=2}Variable 210.281
Table 1: Overview of parameter values, initial guesses, and the solution.